Giter Site home page Giter Site logo

control-monad-free's People

Contributors

bergmark avatar pepeiborra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

control-monad-free's Issues

control-monad-free-0.6.1 does not compile with ghc-8.6.1

Control/Monad/Free/Zip.hs:24:27: error:
    • Could not deduce (Control.Monad.Fail.MonadFail m)
        arising from a do statement
        with the failable pattern ‘(x : xx)’
      from the context: (Traversable t1, Traversable t2, Monad m)
        bound by the type signature for:
                   unsafeZipWithG :: forall (t1 :: * -> *) (t2 :: * -> *) (m :: *
                                                                                -> *) a b c.
                                     (Traversable t1, Traversable t2, Monad m) =>
                                     (a -> b -> m c) -> t1 a -> t2 b -> m (t2 c)
        at Control/Monad/Free/Zip.hs:22:1-106
      Possible fix:
        add (Control.Monad.Fail.MonadFail m) to the context of
          the type signature for:
            unsafeZipWithG :: forall (t1 :: * -> *) (t2 :: * -> *) (m :: *
                                                                         -> *) a b c.
                              (Traversable t1, Traversable t2, Monad m) =>
                              (a -> b -> m c) -> t1 a -> t2 b -> m (t2 c)
    • In a stmt of a 'do' block: (x : xx) <- get
      In the expression:
        do (x : xx) <- get
           put xx
           lift (f x y)
      In an equation for ‘zipG'’:
          zipG' y
            = do (x : xx) <- get
                 put xx
                 lift (f x y)
   |
24 |        where zipG' y = do (x:xx) <- get
   |                           ^^^^^^^^^^^^^

Missing function

I came across this sentence in a paper (IR for the Masses):
"Thus a reflection ρ : F I O → M I → M O is a natural transformation from the functor F I to the monad M I → M− and as such induces a monad morphism from the free monad on F I to this monad."

This suggests the following function:

induce :: (Functor f, Monad m) => (forall a. f a -> m a) -> Free f a -> m a
induce f = foldFree return (join . f)

(induce is probably not the best name for this function.)

mapFree can be written with induce:

mapFree eta = induce (Impure . fmap Pure . eta)

but that's slower than the current implementation, unless GHC can optimize the overhead away.

Build failure with GHC 7.10.1-rc1

Hi, I'm trying to compile hledger with the current GHC 7.10.1 release candidate, but I've run into trouble with control-monad-free because of the issues indicated by the following GHC 7.8.4 warnings:

Control/Monad/Free.hs:58:10: Warning:
    ‘Free’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.

Control/Monad/Free.hs:111:10: Warning:
    ‘FreeT’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.
[2 of 3] Compiling Control.Monad.Free.Zip ( Control/Monad/Free/Zip.hs, dist/build/Control/Monad/Free/Zip.o )
[3 of 3] Compiling Control.Monad.Free.Improve ( Control/Monad/Free/Improve.hs, dist/build/Control/Monad/Free/Improve.o )

Control/Monad/Free/Improve.hs:36:10: Warning:
    ‘C’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.

Control/Monad/Free/Improve.hs:44:10: Warning:
    ‘C’ is an instance of MonadPlus but not Alternative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.

Would it be possible to get an updated version of your package that remedies these issues?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.