News for hackers. Stuff that matters.
Re:Why the world needs Haskell by Peaker on Wednesday July 10, 2013 @04:06AM (#6018069)
Or replace head with a better function.
Re:Why the world needs Haskell by mercurial on Wednesday July 10, 2013 @04:34AM (#6018147)
See the fantastic errors module, which has safe versions of head, etc.
Re:Why the world needs Haskell by epsylon on Wednesday July 10, 2013 @08:21AM (#6018991)
Or use pattern matching.
Re:Why the world needs Haskell by mercurial on Wednesday July 10, 2013 @11:16AM (#6020274)
Pattern matching is great, you can usually use it instead of head, but you want something like Control.Error.Safe.tryRead to replace other unsafe functions like read.