This repository has been archived by the owner on May 29, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As spotted by the keen-eyed @shadowhand in #4, this definition was broken. Now amended, phew :)
- Loading branch information
9d57a59
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this actually fixes the problem... how could
$this->value
be an object (looks like it is meant to be aMaybe
)?9d57a59
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this
is theJust
value, but$this->value
is the value within the Just. Given that the other, at this point, is aJust
, we could probably write$this->value->concat($that->value)
, thinking about it, but the type-checker's not clever enough to spot that they're bothJust
, so the$value
would need to become a protected prop ofMaybe
, which seems counter-intuitive...Anyway, tl;dr, Maybe is a Semigroup if the contained value is a Semigroup (i.e. has a valid
concat
function), so the inner value needs to be an object!9d57a59
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I missed that this would only apply to a maybe-wrapped-maybe.