Tag Archives: haskell

(Haskell) Simultaneous filter and map

The `filtermap` functional below allows to perform the standard `map` and `filter` operations in one go. The mapping function has to return a `Maybe` monad, and values of `Nothing` are filtered out.

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Haskell 99 Problems, numbers 1 through 9

I had originally started these problems from #10 (Run-length encoding). I went back and did 1-8 for completeness.

Posted in Haskell | Also tagged , , , | Leave a comment

(Haskell) Run-Length Encoding in Haskell

Problem 10 of the famous 99 Problems. I got 99 problems, but a Lisp ain’t one.

Posted in Haskell | Also tagged , , , , , | Leave a comment

(Haskell) Reverse map

`pam` is some sort of reverse `map` (hence the name). While `map` applies a function to a list of arguments, `pam` applies a list of functions to the same argument.

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Compare Binary Search Trees

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Recursive type representation in type level

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Interval of integral points

These functions return all points (pairs or triples of coordinates) within a given rectangle or box. “pam“ is the reverse map function which was defined [here](http://snipplr.com/view/18351/reverse-map/).

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Radix Conversion

Converts an integer from base 10 to a string of base x (where 0 > x >= 20). The only thing I’d improve is getting rid of all the calls to error. Perhaps hand back a Maybe String that simply hands back Nothing if unable to convert the number.

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Radix Conversion using ByteStrings

Another radix conversion, when you need to zippy greatness of Haskell’s ByteString.(Haskell strings are slooooow!)

Posted in Haskell | Also tagged , , , , | Leave a comment

(Haskell) Real World Haskell Exercise Chapter 4

The first fold exercise from RWH, Chapter 4

Posted in Haskell | Also tagged , , , , | Leave a comment