{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Safe #-}
module Data.Parameterized.Compose
( testEqualityComposeBare
) where
import Data.Functor.Compose
import Data.Kind
import Data.Orphans ()
import Data.Type.Equality
testEqualityComposeBare :: forall k l (f :: k -> Type) (g :: l -> k) x y.
(forall w z. f w -> f z -> Maybe (w :~: z))
-> Compose f g x
-> Compose f g y
-> Maybe (x :~: y)
testEqualityComposeBare :: (forall (w :: k) (z :: k). f w -> f z -> Maybe (w :~: z))
-> Compose f g x -> Compose f g y -> Maybe (x :~: y)
testEqualityComposeBare forall (w :: k) (z :: k). f w -> f z -> Maybe (w :~: z)
testEquality_ (Compose f (g x)
x) (Compose f (g y)
y) =
case (f (g x) -> f (g y) -> Maybe (g x :~: g y)
forall (w :: k) (z :: k). f w -> f z -> Maybe (w :~: z)
testEquality_ f (g x)
x f (g y)
y :: Maybe (g x :~: g y)) of
Just g x :~: g y
Refl -> (x :~: y) -> Maybe (x :~: y)
forall a. a -> Maybe a
Just (x :~: y
forall k (a :: k). a :~: a
Refl :: x :~: y)
Maybe (g x :~: g y)
Nothing -> Maybe (x :~: y)
forall a. Maybe a
Nothing