2007/6/22, Andrew Coppin <[EMAIL PROTECTED]>:
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ï
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to