Closed erykciepiela closed 4 years ago
Levitated
and Dropped
, as picking one over other for Maybe
is arbitrary (cf Sum
and Product
Monoid
s in base
)Either
is not a coproduct in the category of partial orders, so I'd also have a different type for it (c.f. instances for (a,b)
and Lexicographic
).To clarify, I'd not object having a type isomorphic to Either
which is:
-- The name of this construction is escaping me atm
data SomeName a b = Upper a | Lower b
which your instance, but not for Either
.
Thanks for insightful comments. I think I get the point and general spirit of the library now.
As for Either
instance, in the spirit of Levitated
and Dropped
I would propose Stacked
.
Regarding Maybe
I would propose conversion functions from Maybe
to Dropped
and Lifted
.
All these as part of the other PR #99.
Add
(Lattice a, Lattice b) => Lattice (Either a b)
instance constructed by considering all minimal elements ofb
greater than all maximal elements ofa
AddLattice a => Lattice (Maybe a)
instance constructed by using Nothing as0
element