Haskell - Argument Capture

Just learnt about argument capture in Haskell - I had no clue this existed:

let lss@(l:ls) = [0..10] in
  "lss has a head of: " ++ show l ++
  ", and a length of: " ++ show (length lss)

Result:

"lss has a head of: 0, and a length of: 11"

Note the ‘lss@’ before the pattern match ‘(l:ls)’. This is declaring that I wish to bind the whole list to ‘lss’, the head of the list to ‘l’, and the tail to `ls’.

Nice.

1 note

Setup an amazon ec2 webserver, installed node.js and going through David Herron’s: “Node Web Development” book.

Things I Wish to Learn

Haskell, Erlang, and Python.

Can anyone recommend effective books for these?

8 notes

I’m learning LaTeX and downloading MacTeX!

Going to use it for authoring my dissertation document.

3 notes