Bodigrim / logict

A continuation-based backtracking logic programming monad
https://hackage.haskell.org/package/logict
Other
85 stars 13 forks source link

eta-expand runLogicT for GHC HEAD compatibility #9

Closed utdemir closed 4 years ago

utdemir commented 4 years ago

GHC HEAD (soon GHC 9) has some typechecker changes which was causing the previous code fail to typecheck.

This is the type error:

Control/Monad/Logic.hs:105:13: error:
    • Couldn't match type: forall r1.
                           (a -> m r1 -> m r1) -> m r1 -> m r1
                     with: (a -> m r -> m r) -> m r -> m r
      Expected: LogicT m a -> (a -> m r -> m r) -> m r -> m r
        Actual: LogicT m a -> forall r. (a -> m r -> m r) -> m r -> m r
    • In the expression: unLogicT
      In an equation for ‘runLogicT’: runLogicT = unLogicT
    • Relevant bindings include
        runLogicT :: LogicT m a -> (a -> m r -> m r) -> m r -> m r
          (bound at Control/Monad/Logic.hs:105:1)
    |
105 | runLogicT = unLogicT
    |             ^^^^^^^^

With this simple change it seems to be happy.

Bodigrim commented 4 years ago

Thanks! I'll cut a new release once GHC 9.0 is out.