Git Product home page Git Product logo

Comments (4)

ekmett avatar ekmett commented on August 28, 2024

I'm not actively against adding this. =)

Let me check the extensions used, and if it doesn't extend the set then it'll definitely go in.

from free.

Gabriella439 avatar Gabriella439 commented on August 28, 2024

Like I said, it's not a blocking issue. If worse comes to worse I'll
just include it as a utility function in pipes.

On 09/07/2012 02:31 PM, Edward A. Kmett wrote:

I'm not actively against adding this. =)

Let me check the extensions used, and if it doesn't extend the set
then it'll definitely go in.


Reply to this email directly or view it on GitHub
#5 (comment).

from free.

Gabriella439 avatar Gabriella439 commented on August 28, 2024

Oh, I just realized that if the Rank2Types extension is a problem you can copy what Ross does for transformers. Instead of providing a natural transformation he specializes the first argument to the concrete function that the compiler infers:

mapFreeT
  :: (Monad m, Functor f)
  => (m (FreeF f a (FreeT g n b)) -> n (FreeF g b (FreeT g n b)))
  -> FreeT f m a -> FreeT g n b

This still works correctly for monad morphisms, at the expense of an uglier type signature that hides the purpose of the function. However, you could add a documentation note saying something like:

"The typical use is to pass mapFreeT a monad morphism of type forall r . m r -> n r as its first argument so that you get a new monad morphism that modifies the base monad: forall r . FreeT f m r -> FreeT f n r"

from free.

ekmett avatar ekmett commented on August 28, 2024

I just decided to add the Rank2Types requirement. This will let me move the Church encoded free monad from kan-extensions to here, which reduces the amount of crap people need to install in order to use it considerably.

from free.

Related Issues (20)

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.