question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Alternative a.k.a ApplicativePlus as distinct from implicit Monoid and Applicative together

See original GitHub issue

An 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:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rzeiglercommented, Nov 20, 2016

#187 seems to cover what I was initially looking for when I opened this.

0reactions
joneshfcommented, Nov 30, 2015
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found