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
  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
  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
  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
  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- could not rea...Learn More
  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
  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
  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
  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
  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
  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
  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