<div dir="ltr">Round braces are used for grouping, it's necessary to avoid ambiguity since a function can be defined with more than one argument. When using case you don't have this potential ambiguity, so don't need the parentheses. Tuples are more of a special case in the grammar that isn't closely related to this.<br><div><br></div><div>safeHead p = case p of</div><div>  [] -> Nothing</div><div>  x : xs -> Just x<br><br>On Friday, October 24, 2014, Rohit Sharma <<a href="mailto:rohits79@gmail.com" target="_blank">rohits79@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">All,<div><br></div><div>I started learning haskell very recently and have a question on the pattern matching style for lists.<div><br></div><div>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?</div><div><br></div><div>safeHead [] = Nothing</div><div>safeHead (x:xs) = Just x</div></div><div><br></div><div>Thanks,</div><div>Rohit</div></div>
</blockquote>
</div></div>