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

Francesco Ariis fa-ml at ariis.it
Tue Jan 17 15:26:03 UTC 2017

On Tue, Jan 17, 2017 at 02:49:11PM +0000, PICCA Frederic-Emmanuel wrote:
> Hello
> In fact I realize that my real problem is during the 'values' generation of my example.
> I have a class like this
> [...]

A repository would help! In any case writing:

    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).

More information about the Beginners mailing list