Document Rewrite

This commit is contained in:
Oliver Charles 2020-01-18 17:53:30 +00:00
parent 76241eb96d
commit 658b4e7d6e

View File

@ -18,6 +18,10 @@ import Rel8.HigherKinded
import Rel8.Top
-- | @Rewrite f g a b@ says that @a@ can be rewritten into @b@ by changing the
-- underlying data functor from @f@ to @g@. For higher-kinded data types, this
-- is akin to a map operation @t f -> t g@, but this class specifically doesn't
-- talk about higher-kinded data in order to be more general.
class Rewrite f g a b | f g a -> b, a -> f, b -> g, f g b -> a where
rewrite :: ( forall x. C f x -> C g x ) -> a -> b