[Haskell-beginners] how to skip pattern match error when applying a mapM_

Manuel Vázquez Acosta mva.led at gmail.com
Tue Jan 17 23:31:55 UTC 2017


>From [1]:

    -- | Fail with a message.  This operation is not part of the
    -- mathematical definition of a monad, but is invoked on pattern-match
    -- failure in a @do@ expression.
    --
    -- As part of the MonadFail proposal (MFP), this function is moved
    -- to its own class 'MonadFail' (see "Control.Monad.Fail" for more
    -- details). The definition here will be removed in a future
    -- release.
    fail        :: String -> m a
    fail s      = errorWithoutStackTrace s

Best regards,
Manuel (also a newbie)

[1] http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Base.html#Monad


> thanks and what is the purpose of 
>
> fail _ = nothing
>
> Cheers
>
> Fred
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


More information about the Beginners mailing list