Gabriella439 / Haskell-MMorph-Library

Monad morphisms
BSD 3-Clause "New" or "Revised" License
47 stars 26 forks source link

mmorph 1.1.4 fails to build with GHC < 8.6.5 #54

Closed vmchale closed 3 years ago

vmchale commented 3 years ago
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - mmorph-1.1.4 (lib) (requires build)
 - hedgehog-1.0.4 (lib) (requires build)
 - accelerate-1.3.0.0 (lib:accelerate) (requires build)
 - mwc-random-accelerate-0.2.0.0 (lib) (requires build)
 - accelerate-kullback-liebler-0.1.2.1 (lib) (first run)
 - accelerate-kullback-liebler-0.1.2.1 (lib:accelerate-test) (first run)
Starting     mmorph-1.1.4 (lib)
Building     mmorph-1.1.4 (lib)

Failed to build mmorph-1.1.4.
Build log (
/home/vanessa/.cabal/logs/ghc-8.6.5/mmorph-1.1.4-8f9ac86904fbe0045bfa87620d451fb4470f304d7834eb814840e0e68f564044.log
):
Configuring library for mmorph-1.1.4..
Preprocessing library for mmorph-1.1.4..
Building library for mmorph-1.1.4..
[1 of 2] Compiling Control.Monad.Morph ( src/Control/Monad/Morph.hs, dist/build/Control/Monad/Morph.o )

src/Control/Monad/Morph.hs:80:1: warning: [-Wdeprecations]
    Module ‘Control.Monad.Trans.Error’ is deprecated:
      Use Control.Monad.Trans.Except instead
   |
80 | import qualified Control.Monad.Trans.Error         as E
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Control/Monad/Morph.hs:83:1: warning: [-Wdeprecations]
    Module ‘Control.Monad.Trans.List’ is deprecated:
      This transformer is invalid on most monads
   |
83 | import qualified Control.Monad.Trans.List          as L
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Control/Monad/Morph.hs:119:20: warning: [-Wdeprecations]
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
119 | instance MFunctor (E.ErrorT e) where
    |                    ^^^^^^^^

src/Control/Monad/Morph.hs:120:19: warning: [-Wdeprecations]
    In the use of data constructor ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
120 |     hoist nat m = E.ErrorT (nat (E.runErrorT m))
    |                   ^^^^^^^^

src/Control/Monad/Morph.hs:120:34: warning: [-Wdeprecations]
    In the use of ‘runErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
120 |     hoist nat m = E.ErrorT (nat (E.runErrorT m))
    |                                  ^^^^^^^^^^^

src/Control/Monad/Morph.hs:128:19: warning: [-Wdeprecations]
    In the use of type constructor or class ‘ListT’
    (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
128 | instance MFunctor L.ListT where
    |                   ^^^^^^^

src/Control/Monad/Morph.hs:129:19: warning: [-Wdeprecations]
    In the use of data constructor ‘ListT’
    (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
129 |     hoist nat m = L.ListT (nat (L.runListT m))
    |                   ^^^^^^^

src/Control/Monad/Morph.hs:129:33: warning: [-Wdeprecations]
    In the use of ‘runListT’ (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
129 |     hoist nat m = L.ListT (nat (L.runListT m))
    |                                 ^^^^^^^^^^

src/Control/Monad/Morph.hs:240:11: warning: [-Wdeprecations]
    In the use of type constructor or class ‘Error’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
240 | instance (E.Error e) => MMonad (E.ErrorT e) where
    |           ^^^^^^^

src/Control/Monad/Morph.hs:240:33: warning: [-Wdeprecations]
    In the use of type constructor or class ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
240 | instance (E.Error e) => MMonad (E.ErrorT e) where
    |                                 ^^^^^^^^

src/Control/Monad/Morph.hs:241:17: warning: [-Wdeprecations]
    In the use of data constructor ‘ErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
241 |     embed f m = E.ErrorT (do
    |                 ^^^^^^^^

src/Control/Monad/Morph.hs:242:14: warning: [-Wdeprecations]
    In the use of ‘runErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
242 |         x <- E.runErrorT (f (E.runErrorT m))
    |              ^^^^^^^^^^^

src/Control/Monad/Morph.hs:242:30: warning: [-Wdeprecations]
    In the use of ‘runErrorT’
    (imported from Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
    |
242 |         x <- E.runErrorT (f (E.runErrorT m))
    |                              ^^^^^^^^^^^

src/Control/Monad/Morph.hs:259:17: warning: [-Wdeprecations]
    In the use of type constructor or class ‘ListT’
    (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
259 | instance MMonad L.ListT where
    |                 ^^^^^^^

src/Control/Monad/Morph.hs:260:17: warning: [-Wdeprecations]
    In the use of data constructor ‘ListT’
    (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
260 |     embed f m = L.ListT (do
    |                 ^^^^^^^

src/Control/Monad/Morph.hs:261:14: warning: [-Wdeprecations]
    In the use of ‘runListT’ (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
261 |         x <- L.runListT (f (L.runListT m))
    |              ^^^^^^^^^^

src/Control/Monad/Morph.hs:261:29: warning: [-Wdeprecations]
    In the use of ‘runListT’ (imported from Control.Monad.Trans.List):
    Deprecated: "This transformer is invalid on most monads"
    |
261 |         x <- L.runListT (f (L.runListT m))
    |                             ^^^^^^^^^^
[2 of 2] Compiling Control.Monad.Trans.Compose ( src/Control/Monad/Trans/Compose.hs, dist/build/Control/Monad/Trans/Compose.o )

src/Control/Monad/Trans/Compose.hs:60:7: error:
    Not in scope: type constructor or class ‘MonadFail’
   |
60 |     , MonadFail
   |       ^^^^^^^^^
cabal: Failed to build mmorph-1.1.4 (which is required by lib:accelerate-test
from accelerate-kullback-liebler-0.1.2.1). See the build log above for
details.

I think a package revision would fix it.

Anton-Latukha commented 3 years ago

Good that we can catch this with daily scheduled CI checks.

singpolyma commented 3 years ago

I believe just updating in the hackage UI to set the base dependency correctly should prevent this version from getting picked up by my builds.

ddssff commented 3 years ago

A travis build of mine that has mmorph as a dependency succeeds on ghc-8.0.2 and 8.2.2, fails on 8.4.4 and 8.6.5, and succeeds on 8.8.4 and 8.10.2.

src/Control/Monad/Trans/Compose.hs:60:7: error:
1292    Not in scope: type constructor or class ‘MonadFail’
domenkozar commented 3 years ago

cc @Gabriel439

Gabriella439 commented 3 years ago

@domenkozar: Yes, I will address this soon. I've just been neck deep in making an offer on a house recently

Gabriella439 commented 3 years ago

Alright, so I added a revision for a base >= 4.13 minimum bound to mmorph-1.1.4 to stem the bleeding. I'll work on a longer-term fix soon

Gabriella439 commented 3 years ago

Fix is up here: https://github.com/Gabriel439/Haskell-MMorph-Library/pull/55

vmchale commented 3 years ago

Thanks!