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

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Tue Jan 17 17:34:05 UTC 2017


>     Just gamma <- get_position' (h5gamma d) 0
>     Just delta <- get_position' (h5delta d) idx
>     Just wavelength <- get_position' (h5wavelength d) 0

> is asking for a trouble down the road. Use a case to pattern match
> on nothing, (or `maybe`, or LambdaCase if you are into extensions).

I tought that was the purpose of the Monad to avoid writting these boillerplate ?

What I am missing ?

Cheers

Frederic


More information about the Beginners mailing list