[Haskell-cafe] Re: Is "take" behaving correctly?

Jules Bean jules at jellybean.co.uk
Thu Sep 13 09:02:15 EDT 2007


Jeff Polakow wrote:
> 
> Hello,
>  
>  > There are 4 variants of tail:
>  >
>  > tail :: [a] -> [a] -- normal
>  > tailDef :: [a] -> [a] -> [a] -- returns the first argument on []
>  > tailMay :: [a] -> Maybe [a] -- returns a Nothing
>  > tailNote :: String -> [a] -> [a] -- crashes, but with a helpful message
>  > tailSafe :: [a] -> [a] -- returns [] on []
>  >
> Is there a reason for not having
> 
>     tailM :: Monad m => [a] -> m [a]


Monads are not an (elegant, or deliberate) abstraction of failure.

Jules



More information about the Haskell-Cafe mailing list