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