[Haskell-cafe] Use unsafePerformIO to catch Exception?

Henning Thielemann lemming at henning-thielemann.de
Thu Mar 26 10:32:39 EDT 2009

On Thu, 26 Mar 2009, Jules Bean wrote:

> There are programming styles which avoid using 'head'. You are free to use 
> those if you don't like it. I myself am content to use 'head' on lists which 
> I know are guaranteed to be non-empty.

Since I became aware that viewl (Data.Sequence) and uncons (ByteString) 
are appropriate in most cases where I used 'head' (and 'tail' and 'null') 
before, I use 'viewL' from my utility-ht package. Data.List.HT.viewL is 
total. I also often use Data.List.HT.switchL.

More information about the Haskell-Cafe mailing list