You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A useful edition to this package would be the addition of a PartialMonoid typeclass that extends PartialSemigroup with identity:
class PartialSemigroup α ⇒ PartialMonoid α where
-- | Identity of '<>?'.
pempty ∷ α
pempty = fromJust $ pmconcat []
-- | Reduce a list with '<>?'.
pmconcat ∷ [α] → Maybe α
pmconcat = foldM (<>?) pempty
{-# MINIMAL (pempty) | pmconcat #-}
I'm working on a package for working with Minimalist Grammars in Haskell, and I have found that both PartialSemigroup and a PartialMonoid class (taken as above from my code) simplify constructing parsers greatly.
I would be willing to take on this issue.
The text was updated successfully, but these errors were encountered:
That sounds cool! I don't have a ton of free time for this but if you'd submit a PR I'd be glad to incorporate it. I wouldn't mind adding you as a package maintainer either, if you're up for that.
Wonderful, I'm planning on making a PR soon with this addition. I would certainly be okay being a package maintainer as well, if that makes things easier on your end.
A useful edition to this package would be the addition of a
PartialMonoid
typeclass that extendsPartialSemigroup
with identity:I'm working on a package for working with Minimalist Grammars in Haskell, and I have found that both
PartialSemigroup
and aPartialMonoid
class (taken as above from my code) simplify constructing parsers greatly.I would be willing to take on this issue.
The text was updated successfully, but these errors were encountered: