{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Safe #-}
module Data.Parameterized.Compose
( testEqualityComposeBare
) where
import Data.Functor.Compose
import Data.Orphans ()
import Data.Type.Equality
testEqualityComposeBare :: forall k l (f :: k -> *) (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 testEquality_ (Compose x) (Compose y) =
case (testEquality_ x y :: Maybe (g x :~: g y)) of
Just Refl -> Just (Refl :: x :~: y)
Nothing -> Nothing