[Haskell-cafe] Finite but not fixed length...

Stephen Tetley stephen.tetley at gmail.com
Wed Oct 13 13:11:29 EDT 2010


Hi Jonas

Thanks - I was meaning an equivalent to viewl on Data.Sequence, on plain lists:

viewl :: [a] -> Either () (a,[a])
viewl []     = Left ()
viewl (x:xs) = Right (x,xs)


It was a trick question because I can't see how you can do it without
decrement on the Peano numbers.

Best wishes

Stephen


More information about the Haskell-Cafe mailing list