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.
Tag Archives: haskell
I had originally started these problems from #10 (Run-length encoding). I went back and did 1-8 for completeness.
Problem 10 of the famous 99 Problems. I got 99 problems, but a Lisp ain’t one.
`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.
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/).
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.
Another radix conversion, when you need to zippy greatness of Haskell’s ByteString.(Haskell strings are slooooow!)
The first fold exercise from RWH, Chapter 4