[Haskell-cafe] pattern matching instead of prelude.head

Lyndon Maydwell maydwell at gmail.com
Fri Sep 16 04:29:14 CEST 2011

Pattern matching will warn you if you neglect to consider the empty list.

On Fri, Sep 16, 2011 at 10:24 AM, Michael Litchard <michael at schmong.org> wrote:
> Someone commented on StackOverflow that pattern matching the first
> element of a list was preferable to head. This makes sense
> intuitively. Could someone articulate the reason why this is true?
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list