haskell / fgl

A Functional Graph Library for Haskell
http://hackage.haskell.org/package/fgl
Other
185 stars 54 forks source link

FLG doesn't build with MonadFailDesugaring #79

Closed recursion-ninja closed 5 years ago

recursion-ninja commented 6 years ago

GHC 8.6.1-beta1 enables the MonadFailDesugaring language extension by default as part of the migration plan for the MonadFail proposal. Currently fgl doesn't build with this new extension enabled:

        • Could not deduce (Control.Monad.Fail.MonadFail m)
            arising from a do statement
            with the failable pattern ‘(Just c, g')’
          from the context: GraphM m gr
            bound by the class declaration for ‘GraphM’
            at Data/Graph/Inductive/Monad.hs:42:20-25
          Possible fix:
            add (Control.Monad.Fail.MonadFail m) to the context of
              the type signature for:
                matchAnyM :: forall a b. m (gr a b) -> m (GDecomp gr a b)
              or the class declaration for ‘GraphM’
        • In a stmt of a 'do' block: (Just c, g') <- matchM v g
          In the expression:
            do (Just c, g') <- matchM v g
               return (c, g')
          In a case alternative:
              (v, _) : _
                -> do (Just c, g') <- matchM v g
                      return (c, g')
       |
    59 |                      (v,_):_ -> do (Just c,g') <- matchM v g

Ideally this would get fixed before the upcoming GHC 8.6.1 release.

ivan-m commented 6 years ago

I do not have any easy way to test using the beta version at the moment so I will not be able to test this out myself any time soon.

recursion-ninja commented 6 years ago

@ivan-m Would you like me to try and create a pull request to resolve the issue?

ivan-m commented 6 years ago

That would be great, thanks!

recursion-ninja commented 6 years ago

Sunday is the earliest I can invest some time in this. More likely later this coming week. I'll keep you posted.