
25 Oct
2014
25 Oct
'14
3:31 a.m.
All, I started learning haskell very recently and have a question on the pattern matching style for lists. In the below snippet i.e. "(x:xs)" why do we went with round braces and not square? I know we are using cons that tells this is not a tuple but would it not make more sense to write something like [x:xs] instead of (x:xs), i thought round braces was used for pair/tuples? safeHead [] = Nothing safeHead (x:xs) = Just x Thanks, Rohit