« Making Too Much of TDD | Main | The Thing of Software Development »

January 04, 2011


Dan Burton

If you hoogle the type signature for converting a function with 2 parameters into a function with one 2-tuple parameter, you find "uncurry".

(a -> b -> c) -> ((a,b) -> c)


let add x y = x + y
:t add
add :: (Num a) => a -> a -> a
:t uncurry add
uncurry add :: (Num a) => (a,a) -> a

Tupling up extra data in the return type is a little different, but sounds a lot like the Reader monad or State monad.


Two other functions of note -- Data.List.isPrefixOf, and Control.Arrow.&&&. The latter lets you write `(delimiter &&& body) text` which helps the pointfreeness.


For anyone curious: the wisely-chosen music is by Recoil. :)


Great music. I don't understand anything in Haskell :)


I watch it from time to time just to listen to the great music.

The comments to this entry are closed.