Code Monkey home page Code Monkey logo

Comments (7)

HeinrichApfelmus avatar HeinrichApfelmus commented on June 30, 2024

Oh!

I don't actually know why I've commented it out. It may have been because this instance requires the FlexibleInstances or some other extension that the Utrecht Haskell compiler didn't support. It was still there in version 0.5.

I should probably enable the instance again.

from reactive-banana.

Shimuuar avatar Shimuuar commented on June 30, 2024

But then why not to define instance for Event t a. That instance is same as

instance Monoid a => Monoid (Event t a) where
  mempty  = never
  mappend = unionWith mappend

For that particular instance a is Dual (Endo a). Event calming could be served by separate combinator. Say calmWith :: (a → a → a) → Event t a → Event t a

from reactive-banana.

mvcisback avatar mvcisback commented on June 30, 2024

Is there a reason the Monoid Instance is still commented out?

from reactive-banana.

HeinrichApfelmus avatar HeinrichApfelmus commented on June 30, 2024

Well, I could not find a good reason to add it back in. The current semantics of Event a (as of reactive-banana-0.8) allows for multiple simultaneous events, so accumE can work with union or unions just fine.

However, I now lean towards disallowing simultaneous events. In this case, the monoid instance for Event (a -> a) would become much more important, and I would definitely add it back in.

from reactive-banana.

mvcisback avatar mvcisback commented on June 30, 2024

@HeinrichApfelmus so its been awhile since I read Conal Elliott's paper, but isn't that issue circumvented via unamb :: a -> a -> a?

from reactive-banana.

HeinrichApfelmus avatar HeinrichApfelmus commented on June 30, 2024

That's a totally different story, I am afraid.

from reactive-banana.

HeinrichApfelmus avatar HeinrichApfelmus commented on June 30, 2024

The unions combinator currently serves as a substitute for a possible

instance Monoid (Event (a -> a))

I would leave it at that for now. See #104 for more discussion on possible Monoid instances for Event.

from reactive-banana.

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.