
26 Mar
2009
26 Mar
'09
10:32 a.m.
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.