k0ral / imm

Execute arbitrary actions for each unread element of RSS/Atom feeds
http://hackage.haskell.org/package/imm
Creative Commons Zero v1.0 Universal
16 stars 4 forks source link

Build failure with mono-traversable 1.0/chunked-data 0.3 #7

Closed snoyberg closed 8 years ago

snoyberg commented 8 years ago
> /tmp/stackage-build8$ stack unpack imm-1.0.0.0
Unpacked imm-1.0.0.0 to /tmp/stackage-build8/imm-1.0.0.0/
> /tmp/stackage-build8/imm-1.0.0.0$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup configure --package-db=clear --package-db=global --package-db=/home/stackage/work/builds/nightly/pkgdb --libdir=/home/stackage/work/builds/nightly/lib --bindir=/home/stackage/work/builds/nightly/bin --datadir=/home/stackage/work/builds/nightly/share --libexecdir=/home/stackage/work/builds/nightly/libexec --sysconfdir=/home/stackage/work/builds/nightly/etc --docdir=/home/stackage/work/builds/nightly/doc/imm-1.0.0.0 --htmldir=/home/stackage/work/builds/nightly/doc/imm-1.0.0.0 --haddockdir=/home/stackage/work/builds/nightly/doc/imm-1.0.0.0 --flags=
Configuring imm-1.0.0.0...
> /tmp/stackage-build8/imm-1.0.0.0$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup build
Building imm-1.0.0.0...
Preprocessing library imm-1.0.0.0...
[ 1 of 20] Compiling Paths_imm        ( dist/build/autogen/Paths_imm.hs, dist/build/Paths_imm.o )
[ 2 of 20] Compiling Imm.Prelude      ( src/lib/Imm/Prelude.hs, dist/build/Imm/Prelude.o )

src/lib/Imm/Prelude.hs:39:1: error:
    Failed to load interface for ‘Data.Sequences.Lazy’
    Perhaps you meant
      Data.Sequence.Lens (needs flag -package-key lens-4.14)
      Data.Sequences (from mono-traversable-1.0.0)
    Use -v to see a list of the files searched for.

src/lib/Imm/Prelude.hs:43:1: error:
    Failed to load interface for ‘Data.Textual.Encoding’
    Perhaps you meant
      Data.Text.Encoding (from text-1.2.2.1)
      Data.Text.Lazy.Encoding (from text-1.2.2.1)
    Use -v to see a list of the files searched for.
k0ral commented 8 years ago

@snoyberg I feel misguided for asking it, but why has the signature of omapM_ changed in mono-traversable-1.0 ? It used to be aligned (only more general) with the one from Data.Foldable (cf here vs there).

snoyberg commented 8 years ago

You mean the generalization to Applicative? Or something else?

snoyberg commented 8 years ago

Signature from 0.10.2:

omapM_ :: (MonoFoldable mono, Monad m) => (Element mono -> m ()) -> mono -> m ()

From 1.0.0:

omapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()
k0ral commented 8 years ago

Hmm indeed, my bad. My confusion comes from the fact that my code used to build fine, now it's failing because:

Couldn't match type `Bool' with `()'
    Expected type: Element (Maybe Authentication) -> IO ()
      Actual type: Authentication -> IO Bool
    In the second argument of `forM_', namely

Sorry for the noise, there must be something else at hand, I'll check better. Out of curiosity, what prevents you from generalizing to the below signature ?

omapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m a) -> mono -> m ()
snoyberg commented 8 years ago

It's a combination of a performance a correctness issue.

k0ral commented 8 years ago

Fixed in 7540c8c6d363cdbf31d32d09e288862c69650698, included in new release 1.0.1.0. Thank you !