Tag: Haskell
Posts of Tag: Haskell
  1. How can I change my data types without causing a recompile in Haskell?

    After watching a video of a talk by Bret Victor, I was inspired to write a quick hack that was somewhat similar to a development environment he demonstrated in the talk. Basically the idea is, one has the app r...Learn More
    Haskell
  2. CPU emulation in haskell, functional data structures, and maybe zippers?

    Well, not exactly. I have more of a functional data structures question. Say I want to model the execution of a CPU. I have some set of instructions that mutate the CPU state (say it's a stack based cpu. Only ...Learn More
    Haskellfunctional-programming
  3. How to change function calls with parenthesis using composition in Haskell?

    Here's what I write: (take 2 (repeat " ")) I want to change it to expr without parenthesis. Can I use "." like so: ceiling (negate (tan (cos (max 50 x)))) can be changed to ceiling . negate . tan . cos . m...Learn More
    Haskell
  4. Comparing list length with arrows

    Inspired by Comparing list length If I want to find the longest list in a list of lists, the simplest way is probably: longestList :: [[a]] -> [a] longestList = maximumBy (comparing length) A more effic...Learn More
    listComparisonHaskellarrows
  5. Error building GHC on Windows

    While attempting to bootstrap Haskell on Windows without the Haskell Platform I ran into the following error C:\git\Haskell\ghc\libraries\haskeline\dist-install\build/libHShaskeline-0.7.1.2.a: could not rea...Learn More
    HaskellGhc
  6. Haskell tail recursion predictability

    One of the biggest issues I have with haskell is to be able to (correctly) predict the performance of haskell code. While I have some more difficult problems, I realize I have almost no understanding. Take some...Learn More
    OptimizationHaskell
  7. Checking if a string consists of balanced parenthesis

    I wrote the following program to check strings for balanced parenthesis: isBalanced xs = isBalanced' xs [] isBalanced' [] [] = True isBalanced' [] _ = False isBalanced' ('(':xs) ys = isBalanced' xs (')':ys) ...Learn More
    RecursionHaskellpattern-matchingformal-languagespushdown-automaton
  8. Haskell - Filtering Lists by Comparison

    I need to filter a list with a mask in Haskell. It applies the function to an element of the mask list and the corresponding element in the data list, and if the function returns true, the corresponding element...Learn More
    listHaskellCompare
  9. Unboxing boxed value in vector of four tuples

    There is a performance issue I am trying to debug as part of a more complicated code. It seems that append function that I am using to create a dynamic, growable vector of (Int,Int,Int,Int) is causing one of th...Learn More
    PerformanceVectorHaskellGhcunboxing
  10. Haskell: Lists vs Streams

    I've noticed streams seem to act a lot like lists, except with constant time append. Of course, adding constant time append to lists isn't too complicated, and DList does exactly that. Lets assume for the rest...Learn More
    StreamlistHaskell
  11. Pattern matching against a tuple in the IO Monad in Haskell

    I've been studying Haskell in my spare time and have recently crossed into the area of monadic functions. I've distilled the code from an excercise I've been working on into this very contrived example to isola...Learn More
    HaskellTuplespattern-matching
  12. Haskell: Appending to a list from multiple locations in a program

    I would like to have a list that may be updated (appended to) from more than one location in the code. Since in haskell, calling a function once is the same as calling it twice and discarding the result of the ...Learn More
    MemoizationHaskellfunctional-programmingglobal-variables