Closed deepfire closed 5 years ago
Prelude Data.These Data.Align Control.Monad> :t join align
join align :: Align f => f b -> f (These b b)
Prelude Data.These Data.Align Control.Monad> :t fmap (join These)
fmap (join These) :: Functor f => f a -> f (These a a)
join
is used there for (->) a
monad.
Prelude Data.These Data.Align Control.Monad> :t join :: (a -> a -> x) -> a -> x
join :: (a -> a -> x) -> a -> x :: (a -> a -> x) -> a -> x
I agree, using join
is not the most clear way to stay that law, but it way more concise than alternatives. bimap
is over These
(which is Bifunctor
), not the functor we write Align
instance for.
That said, if you can improve the comments, I'll more than happily accept the PR
Control.Monad.join (I take it..) is mentioned in the laws required of
Align
instances:It seems illegal, since
Monad
isn't required forAlign
, and so the semantics are unclear.(..to say nothing of the
Bifunctor
law..)