
5 Nov
2003
5 Nov
'03
7:47 a.m.
Karthik Kumar
I got get this working thanks to the fst and snd function.
(x,y) <- head [('a', 1), ('b', 2)]
You could also (possibly easier to read) do it like the above, only use an '=' (x,y) = head [('a', 1), ('b', 2)] (The <- operator is used for monadic computations and list comprehensions: main = do x <- readFile ... or mapFst xs = [ x | (x,y) <- xs ] ) -kzm -- If I haven't seen further, it is by standing in the footprints of giants