Karthik Kumar <[EMAIL PROTECTED]> writes:

> 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
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to