Skip to content

0.3.0.0 is broken for GHCs prior {-# OVERLAPPABLE #-} #4

@phadej

Description

@phadej
diff --git a/test/Main.hs b/test/Main.hs
index 1c3ceaa..2f61f9b 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -7,7 +7,9 @@ import Control.Monad.Time
 
 main :: IO ()
 main = do
-  currentTime >>= print
+  now <- currentTime
+  print now
   -- Test that generic MonadTrans instance works.
   runReaderT currentTime 'x' >>= print
   evalStateT (runReaderT currentTime 'x') 'y' >>= print
+  runReaderT currentTime now >>= print
% cabal new-build -w ghc-7.8.4 --enable-tests
Resolving dependencies...
Build profile: -w ghc-7.8.4 -O1
In order, the following will be built (use -v for more details):
 - monad-time-0.3.0.0 (lib) (first run)
 - monad-time-0.3.0.0 (test:monad-time-test) (first run)
Configuring library for monad-time-0.3.0.0..
Preprocessing library for monad-time-0.3.0.0..
Building library for monad-time-0.3.0.0..
[1 of 1] Compiling Control.Monad.Time ( src/Control/Monad/Time.hs, /home/ogre/Documents/other-haskell/monad-time/dist-newstyle/build/x86_64-linux/ghc-7.8.4/monad-time-0.3.0.0/build/Control/Monad/Time.o )

src/Control/Monad/Time.hs:16:10: Warning: Unrecognised pragma

src/Control/Monad/Time.hs:20:10: Warning: Unrecognised pragma
Configuring test suite 'monad-time-test' for monad-time-0.3.0.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: monad-time -any && ==0.3.0.0. This version range includes
the current package but isn't needed as the current package's library will
always be used.
Preprocessing test suite 'monad-time-test' for monad-time-0.3.0.0..
Building test suite 'monad-time-test' for monad-time-0.3.0.0..
[1 of 1] Compiling Main             ( test/Main.hs, /home/ogre/Documents/other-haskell/monad-time/dist-newstyle/build/x86_64-linux/ghc-7.8.4/monad-time-0.3.0.0/t/monad-time-test/build/monad-time-test/monad-time-test-tmp/Main.o )

test/Main.hs:15:14:
    Overlapping instances for MonadTime
                                (ReaderT time-1.4.2:Data.Time.Clock.UTC.UTCTime IO)
      arising from a use of ‘currentTime’
    Matching instances:
      instance (MonadTime m, MonadTrans t, Monad (t m)) =>
               MonadTime (t m)
        -- Defined in ‘Control.Monad.Time’
      instance Monad m =>
               MonadTime (ReaderT time-1.4.2:Data.Time.Clock.UTC.UTCTime m)
        -- Defined in ‘Control.Monad.Time’
    In the first argument of ‘runReaderT’, namely ‘currentTime’
    In the first argument of ‘(>>=)’, namely
      ‘runReaderT currentTime now’
    In a stmt of a 'do' block: runReaderT currentTime now >>= print

I recommend:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions