{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE StandaloneDeriving #-}
module Data.Type.Coercion.Related.Internal where
import Control.Category
import Prelude hiding (id, (.))
import Data.Coerce
import Data.Type.Coercion
newtype Related (a :: k) (b :: k) = Related { Related a b -> Coercion a b
getRelated :: Coercion a b }
deriving stock (Related a b -> Related a b -> Bool
(Related a b -> Related a b -> Bool)
-> (Related a b -> Related a b -> Bool) -> Eq (Related a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
/= :: Related a b -> Related a b -> Bool
$c/= :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
== :: Related a b -> Related a b -> Bool
$c== :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
Eq, Eq (Related a b)
Eq (Related a b)
-> (Related a b -> Related a b -> Ordering)
-> (Related a b -> Related a b -> Bool)
-> (Related a b -> Related a b -> Bool)
-> (Related a b -> Related a b -> Bool)
-> (Related a b -> Related a b -> Bool)
-> (Related a b -> Related a b -> Related a b)
-> (Related a b -> Related a b -> Related a b)
-> Ord (Related a b)
Related a b -> Related a b -> Bool
Related a b -> Related a b -> Ordering
Related a b -> Related a b -> Related a b
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall k (a :: k) (b :: k). Eq (Related a b)
forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
forall k (a :: k) (b :: k). Related a b -> Related a b -> Ordering
forall k (a :: k) (b :: k).
Related a b -> Related a b -> Related a b
min :: Related a b -> Related a b -> Related a b
$cmin :: forall k (a :: k) (b :: k).
Related a b -> Related a b -> Related a b
max :: Related a b -> Related a b -> Related a b
$cmax :: forall k (a :: k) (b :: k).
Related a b -> Related a b -> Related a b
>= :: Related a b -> Related a b -> Bool
$c>= :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
> :: Related a b -> Related a b -> Bool
$c> :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
<= :: Related a b -> Related a b -> Bool
$c<= :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
< :: Related a b -> Related a b -> Bool
$c< :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Bool
compare :: Related a b -> Related a b -> Ordering
$ccompare :: forall k (a :: k) (b :: k). Related a b -> Related a b -> Ordering
$cp1Ord :: forall k (a :: k) (b :: k). Eq (Related a b)
Ord, Int -> Related a b -> ShowS
[Related a b] -> ShowS
Related a b -> String
(Int -> Related a b -> ShowS)
-> (Related a b -> String)
-> ([Related a b] -> ShowS)
-> Show (Related a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (a :: k) (b :: k). Int -> Related a b -> ShowS
forall k (a :: k) (b :: k). [Related a b] -> ShowS
forall k (a :: k) (b :: k). Related a b -> String
showList :: [Related a b] -> ShowS
$cshowList :: forall k (a :: k) (b :: k). [Related a b] -> ShowS
show :: Related a b -> String
$cshow :: forall k (a :: k) (b :: k). Related a b -> String
showsPrec :: Int -> Related a b -> ShowS
$cshowsPrec :: forall k (a :: k) (b :: k). Int -> Related a b -> ShowS
Show)
deriving stock instance Coercible a b => Read (Related a b)
deriving newtype instance Coercible a b => Enum (Related a b)
deriving newtype instance Coercible a b => Bounded (Related a b)
instance Category Related where
id :: Related a a
id :: Related a a
id = Coercion a a -> Related a a
forall k (a :: k) (b :: k). Coercion a b -> Related a b
Related Coercion a a
forall k (a :: k) (b :: k). Coercible a b => Coercion a b
Coercion
(.) :: Related b c -> Related a b -> Related a c
Related Coercion b c
Coercion . :: Related b c -> Related a b -> Related a c
. Related Coercion a b
Coercion = Coercion a c -> Related a c
forall k (a :: k) (b :: k). Coercion a b -> Related a b
Related Coercion a c
forall k (a :: k) (b :: k). Coercible a b => Coercion a b
Coercion