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
The Ap newtype wrapper provides a way of using an Applicative instance as a Monoid instance.
I think a similar thing can be done for Semialign and Align.
newtypeAlfa=Al{getAl::fa}instance (Semialignf, Semigroupa) =>Semigroup (Alfa) whereAl a <>Al b =Al (salign a b)
instance (Alignf, Semigroupa) =>Monoid (Alfa) wheremempty=Al nil
The Monoid laws should follow from salign being associative and nil being an identity of salign.
I haven't looked at other type classes, but perhaps this admits instances for them too.
The text was updated successfully, but these errors were encountered:
The
Ap
newtype wrapper provides a way of using anApplicative
instance as aMonoid
instance.I think a similar thing can be done for
Semialign
andAlign
.The
Monoid
laws should follow fromsalign
being associative andnil
being an identity ofsalign
.I haven't looked at other type classes, but perhaps this admits instances for them too.
The text was updated successfully, but these errors were encountered: