Category 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 | 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 | 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 | Tagged , , , , , , | Leave a comment

(Haskell) Merge sort

Posted in Haskell | 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 | Tagged , , , , , | Leave a comment

(Haskell) Compare Binary Search Trees

Posted in Haskell | Tagged , , , , , | Leave a comment

(Haskell) Apply list of functions to list of arguments, one-to-one

Easy if you know how… ;)

Posted in Haskell | Tagged , , , | Leave a comment

(Haskell) Recursive type representation in type level

Posted in Haskell | Tagged , , , , , | Leave a comment

(Haskell) Simple Broadcatcher

HSH is a cool haskell library that allows you to leverage your shell scripting prowess in haskell programs. In this simple broadcatcher, I use curl for http get, and other standard unix tools for tracking history (so we don’t get the same file twice). The feed parsing and filtering is done in haskell using the [...]

Posted in Haskell | 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 | Tagged , , , , , | Leave a comment