Add Alternative a.k.a ApplicativePlus as distinct from implicit Monoid and Applicative together
See original GitHub issueAn Applicative with a Monoid instance gives rise to Alternative (Haskell) or ApplicativePlus (Scala) that is usually distinct from the Monoid formed from the semigroup of the augmented type. I was wondering if there should be an additional definition for a class like Alternative with a method name such as choice
or or
that is specifically an Applicative with a Monoid for the higher kind itself rather than proxying to the Semigroup instance.
In particular, I would love defined semantics for things like:
Option.None.or(Option.Some(1)) == Option.Some(1)
be defined rather than
Option.Some(1).concat(Option.Some(1))
complaining about no concat on a field.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Alternative reform · Issue #6 · purescript/purescript-control
Add Alternative a.k.a ApplicativePlus as distinct from implicit Monoid and Applicative together fantasyland/fantasy-land#117.
Read more >How is "a monoid on applicative functors" different than "a ...
Alternative is a family of monoids in the category of types (not endofunctors). This family is generated by an applicative functor f ....
Read more >learning Scalaz — Combined Pages - eed3si9n
The third approach in Scala is to provide an implicit conversion or implicit parameters ... You can still provide different monoid directly to...
Read more >index for package scalaz - scalaz_2.12 7.3.0-M16 javadoc
Lens Composable, functional alternative to getters and setters; scalaz. ... Derive a Semigroup or Monoid instance from an Apply or Applicative.
Read more >Learning Scalaz from Learning Scalaz - James Earl Douglas
There seem to be two distinct ways to do type classes in Scala: either through implicit values, or implicit conversions. These can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#187 seems to cover what I was initially looking for when I opened this.
There was a decent amount of discussion in ps-land about the laws: https://github.com/purescript/purescript-control/issues/6 In particular, this comment: https://github.com/purescript/purescript-control/issues/6#issuecomment-44097271
Also here, https://github.com/plaid/sanctuary/pull/11#discussion_r25558476