
23 Jun
2007
23 Jun
'07
9:38 a.m.
2007/6/22, Andrew Coppin
Chaddaï Fouché wrote:
You should be using BS.null f rather than BS.length f > 0.
While we're on the subject... anybody know a neat way to check, say, whether a list contains exactly 1 element? (Obviously pattern matching can do it, but that requires big case-expressions...)
Big case-expression ? isLength1 [x] = "Ok" isLength _ = "Nok" How is [x] big in any way ? If you need to test for more than one element you can just put put a guard with length -- Jedaï