-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Useful type level operations (type families and related operators). -- -- Useful type level operations (type families and related operators). @package typelevel @version 1.2.3 module Data.Constraint.Struct type family Recursive (c :: Constraint) :: Constraint module Data.Constraints type family Constraints (cs :: [Constraint]) :: Constraint module Data.Proxify type family Deproxy p type family Proxified a proxify :: a -> Proxy (Proxified a) module Type.Any type family AnyType :: k module Type.Bool type family Not a type a && b = And a b infixr 3 && type family And a b type family Or a b type family Xor a b type family If (cond :: Bool) (a :: k) (b :: k) :: k type family If' (cond :: Bool) (a :: Constraint) (b :: Constraint) :: Constraint type family (a :: k) == (b :: k) type family (a :: k) > (b :: k) :: Bool type family (a :: k) < (b :: k) :: Bool class KnownBool (b :: Bool) boolVal :: KnownBool b => Proxy b -> Bool instance Type.Bool.KnownBool 'GHC.Types.True instance Type.Bool.KnownBool 'GHC.Types.False module Constraint.Container.Homo type family Homo (a :: *) :: Constraint module Type.Container type family In (el :: ke) (cont :: k) :: Bool type family Index2 (idx :: i) (cont :: c) :: el type family Index (el :: ke) (cont :: k) :: Maybe Nat type family IndexF (el :: ke) (cont :: k) :: Nat type family Append (el :: ke) (cont :: k) :: k type family Insert (el :: ke) (cont :: k) :: k type family Remove (el :: ke) (cont :: k) :: k type family Empty (cont :: k) :: Bool type family Size (cont :: k) :: Nat type family Reverse (cont :: k) :: k type family Unique (cont :: k) :: k type family Diff (c :: k) (c' :: k) :: k type family Union (c :: k) (c' :: k) :: k type family Every a :: [*] type family FromJust a type UnsafeIndex el cont = FromJust (Index el cont) module Type.Either type family IsLeft (a :: Either l r) :: Bool type family IsRight (a :: Either l r) :: Bool type family FromRight (a :: Either l r) type family FromLeft (a :: Either l r) module Type.Error type a :>: b = a :<>: ErrMsg " " :<>: b type Between' s a = Between s s a type Between l r a = ErrMsg l :<>: a :<>: ErrMsg r type Parensed a = Between "(" ")" a type Ticked a = Between' "`" a type Sentence a = a :<>: ErrMsg "." type TypeAssert ok = TypeErrorIf ok (ErrMsg "Assertion failed.") class TypeErrorIf (ok :: Bool) (err :: ErrorMessage) type ErrMsg = 'Text -- | The type-level equivalent of error. -- -- The polymorphic kind of this type allows it to be used in several -- settings. For instance, it can be used as a constraint, e.g. to -- provide a better error message for a non-existent instance, -- --
-- -- in a context -- instance TypeError (Text "Cannot Show functions." :$$: -- Text "Perhaps there is a missing argument?") -- => Show (a -> b) where -- showsPrec = error "unreachable" ---- -- It can also be placed on the right-hand side of a type-level function -- to provide an error for an invalid case, -- --
-- type family ByteSize x where -- ByteSize Word16 = 2 -- ByteSize Word8 = 1 -- ByteSize a = TypeError (Text "The type " :<>: ShowType a :<>: -- Text " is not exportable.") --type family TypeError (a :: ErrorMessage) :: b -- | A description of a custom type error. data ErrorMessage -- | Pretty print the type. ShowType :: k -> ErrorMessage [ShowType] :: forall t. () => t -> ErrorMessage -- | Put two pieces of error message next to each other. [:<>:] :: () => ErrorMessage -> ErrorMessage -> ErrorMessage -- | Stack two pieces of error message on top of each other. [:$$:] :: () => ErrorMessage -> ErrorMessage -> ErrorMessage infixl 6 :<>: infixl 5 :$$: instance Type.Error.TypeErrorIf 'GHC.Types.True err instance (TypeError ...) => Type.Error.TypeErrorIf 'GHC.Types.False err module Type.Error_old type a :>: b = a :<>: ErrMsg " " :<>: b type Between' s a = Between s s a type Between l r a = ErrMsg l :<>: a :<>: ErrMsg r type Parensed a = Between "(" ")" a type Ticked a = Between' "`" a type Sentence a = a :<>: ErrMsg "." type Assert' ok = Assert ok (ErrMsg "Assertion failed.") class Assert (ok :: Bool) (err :: ErrorMessage) type ErrMsg = 'Text -- | The type-level equivalent of error. -- -- The polymorphic kind of this type allows it to be used in several -- settings. For instance, it can be used as a constraint, e.g. to -- provide a better error message for a non-existent instance, -- --
-- -- in a context -- instance TypeError (Text "Cannot Show functions." :$$: -- Text "Perhaps there is a missing argument?") -- => Show (a -> b) where -- showsPrec = error "unreachable" ---- -- It can also be placed on the right-hand side of a type-level function -- to provide an error for an invalid case, -- --
-- type family ByteSize x where -- ByteSize Word16 = 2 -- ByteSize Word8 = 1 -- ByteSize a = TypeError (Text "The type " :<>: ShowType a :<>: -- Text " is not exportable.") --type family TypeError (a :: ErrorMessage) :: b -- | A description of a custom type error. data ErrorMessage -- | Pretty print the type. ShowType :: k -> ErrorMessage [ShowType] :: forall t. () => t -> ErrorMessage -- | Put two pieces of error message next to each other. [:<>:] :: () => ErrorMessage -> ErrorMessage -> ErrorMessage -- | Stack two pieces of error message on top of each other. [:$$:] :: () => ErrorMessage -> ErrorMessage -> ErrorMessage infixl 6 :<>: infixl 5 :$$: instance Type.Error_old.Assert 'GHC.Types.True err instance (TypeError ...) => Type.Error_old.Assert 'GHC.Types.False err module Type.Functor type f <$> as = FMap f as infixl 4 <$> type family FMap (f :: l -> k) (as :: [l]) :: [k] module Type.Hidden class Hidden t hide :: Hidden t => a -> t reveal :: Hidden t => t -> a data Any [Any] :: a -> Any instance GHC.Show.Show Type.Hidden.Any instance Type.Hidden.Hidden Type.Hidden.Any module Type.Inference -- | The Inferable type class describes a monad with a functional -- dependency on the given type. It allows for writing polymorphic code -- and ensuring Haskell that the type will be resolved while evaluating -- the monadic stack. type KnownType cls t = KnownTypeT cls t Identity newtype KnownTypeT (cls :: ck) (t :: tk) (m :: * -> *) (a :: *) KnownTypeT :: IdentityT m a -> KnownTypeT type family Infer (p :: k) m type family TryInfer (p :: k) m a :: Constraint inferT :: forall cls t m a. KnownTypeT cls t m a -> m a instance forall tk1 ck1 tk2 ck2 (cls1 :: ck2) (t1 :: tk2) (m1 :: * -> *) a1 t2 (cls2 :: ck1) (t3 :: tk1) (m2 :: * -> *) a2. (Type.Inference.KnownTypeT cls1 t1 m1 a1 Data.Type.Equality.~ t2) => Control.Lens.Wrapped.Rewrapped (Type.Inference.KnownTypeT cls2 t3 m2 a2) t2 instance forall tk ck (cls :: ck) (t :: tk) (m :: * -> *) a. Control.Lens.Wrapped.Wrapped (Type.Inference.KnownTypeT cls t m a) instance forall tk ck (m :: * -> *) (cls :: ck) (t :: tk). Control.Monad.Primitive.PrimMonad m => Control.Monad.Primitive.PrimMonad (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). GHC.Base.Alternative m => GHC.Base.Alternative (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). GHC.Base.Applicative m => GHC.Base.Applicative (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk). Control.Monad.Trans.Class.MonadTrans (Type.Inference.KnownTypeT cls t) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). Control.Monad.Fix.MonadFix m => Control.Monad.Fix.MonadFix (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Type.Inference.KnownTypeT cls t m) instance forall ck (cls :: ck) tk (t :: tk) (m :: * -> *) a. (Data.Functor.Classes.Show1 m, GHC.Show.Show a) => GHC.Show.Show (Type.Inference.KnownTypeT cls t m a) module Type.Known type family KnownKindVal (nat :: Type) type family KnownTypeVal (t :: k) class KnownType t fromType :: KnownType t => KnownTypeVal t fromType' :: forall t s. (KnownType t, Convertible' (KnownTypeVal t) s) => s -- | This class gives the integer associated with a type-level natural. -- There are instances of the class for every concrete literal: 0, 1, 2, -- etc. class KnownNat (n :: Nat) -- | This class gives the string associated with a type-level symbol. There -- are instances of the class for every concrete literal: "hello", etc. class KnownSymbol (n :: Symbol) instance GHC.TypeNats.KnownNat t => Type.Known.KnownType t instance GHC.TypeLits.KnownSymbol t => Type.Known.KnownType t module Type.Map data Map k v Map :: [(k, v)] -> Map k v type family MapLookup (k :: kk) (m :: Map kk kv) :: kv module Type.Maybe type family IsJust a type family CatMaybes (lst :: [Maybe k]) :: [k] type family FromJust (m :: Maybe k) :: k module Type.Monoid type a <> b = Concat a b infixr 6 <> type family Concat (a :: k) (b :: k) :: k module Type.Applicative type family AppBind' a b type family AppBind a b type a <*> b = AppBind a b infixl 4 <*> -- | Deprecated: Use Type.Known instead module Type.Promotion class Known (t :: k) (val :: *) typeVal :: Known t val => Proxy t -> val class KnownNats (nats :: [Nat]) natVals :: KnownNats nats => Proxy nats -> [Integer] instance Type.Promotion.KnownNats '[] instance (GHC.TypeNats.KnownNat n, Type.Promotion.KnownNats ns) => Type.Promotion.KnownNats (n : ns) instance (GHC.Num.Num i, GHC.TypeNats.KnownNat t) => Type.Promotion.Known t i instance (val Data.Type.Equality.~ GHC.Types.Bool) => Type.Promotion.Known 'GHC.Types.True val instance (val Data.Type.Equality.~ GHC.Types.Bool) => Type.Promotion.Known 'GHC.Types.False val instance (val Data.Type.Equality.~ GHC.Maybe.Maybe a2) => Type.Promotion.Known 'GHC.Maybe.Nothing val instance forall a1 val a2 (t :: a1). (val Data.Type.Equality.~ GHC.Maybe.Maybe a2, Type.Promotion.Known t a2) => Type.Promotion.Known ('GHC.Maybe.Just t) val instance forall b a val l r (t :: a). (val Data.Type.Equality.~ Data.Either.Either l r, Type.Promotion.Known t l) => Type.Promotion.Known ('Data.Either.Left t) val instance forall a b val l r (t :: b). (val Data.Type.Equality.~ Data.Either.Either l r, Type.Promotion.Known t r) => Type.Promotion.Known ('Data.Either.Right t) val instance Type.Promotion.Known '[] [a] instance forall a1 (t :: a1) a2 (ts :: [a1]). (Type.Promotion.Known t a2, Type.Promotion.Known ts [a2]) => Type.Promotion.Known (t : ts) [a2] module Type.Relation type family Super (a :: k) :: [k] type SemiSuper a = a : Super a module Type.Sequence type family Succ (a :: k) :: k type family Empty :: k type family Zero :: k type family Range (begin :: k) (end :: k) :: [k] type family Enumerate end module Type.Show class Typeable a => TypeShow a showType :: TypeShow a => String printType :: forall a m. (TypeShow a, MonadIO m) => m () ppPrintType :: forall a m. (TypeShow a, MonadIO m) => m () ppShowType :: forall a. TypeShow a => String ppTypeDoc :: forall a. TypeShow a => Doc class ListElemsShow a showListElems :: ListElemsShow a => String instance forall k (a :: [k]). (Type.Show.ListElemsShow a, Data.Typeable.Internal.Typeable a) => Type.Show.TypeShow a instance Type.Show.ListElemsShow '[] instance forall k (a :: k). Type.Show.TypeShow a => Type.Show.ListElemsShow '[a] instance forall a1 (a2 :: a1) (as :: [a1]). (Type.Show.TypeShow a2, Type.Show.ListElemsShow as) => Type.Show.ListElemsShow (a2 : as) instance forall k (a :: k). Data.Typeable.Internal.Typeable a => Type.Show.TypeShow a instance GHC.TypeNats.KnownNat n => Type.Show.TypeShow n instance forall k1 k2 (a :: k2) (b :: k1). (Type.Show.TypeShow a, Type.Show.TypeShow b, Data.Typeable.Internal.Typeable '(a, b)) => Type.Show.TypeShow '(a, b) module Type.Show_old class TypeShow a showType :: TypeShow a => Proxy a -> String showType :: (TypeShow a, Typeable a) => Proxy a -> String showType' :: forall t. TypeShow t => String printType :: TypeShow a => Proxy a -> IO () ppPrintType :: TypeShow a => Proxy a -> IO () ppShowType :: TypeShow a => Proxy a -> String ppTypeDoc :: TypeShow a => Proxy a -> Doc class ListElemsShow a showListElems :: ListElemsShow a => Proxy a -> String instance forall k (a :: [k]). Type.Show_old.ListElemsShow a => Type.Show_old.TypeShow a instance Type.Show_old.ListElemsShow '[] instance forall k (a :: k). Type.Show_old.TypeShow a => Type.Show_old.ListElemsShow '[a] instance forall a1 (a2 :: a1) (as :: [a1]). (Type.Show_old.TypeShow a2, Type.Show_old.ListElemsShow as) => Type.Show_old.ListElemsShow (a2 : as) instance GHC.TypeNats.KnownNat n => Type.Show_old.TypeShow n instance forall k1 k2 (a :: k2) (b :: k1). (Type.Show_old.TypeShow a, Type.Show_old.TypeShow b) => Type.Show_old.TypeShow '(a, b) module Type.Wrapped type family Unwrapped (a :: k) :: l module Type.Operators -- | The $$ operator is just like $ one but with even lower -- precedence level. Unlike value-level $, the type-level one has -- precedence level of `infixr 1` in order to be used in function -- arguments, like `edge :: Node $ Source a -> Node $ Target a -> -- a`. The $$ operator has higher precedence than `->`, so the -- above expression would not be valid when using it. type f $$ a = f a infixr 0 $$ type f $ a = f a infixr 1 $ type a & f = f a infixl 1 & module Type.Set type family ToList s type family AsSet' (a :: k) type family AsSet (a :: k) data Set (a :: [k]) module Type.List type family TakeUntil (a :: k) (ls :: [k]) :: [k] type family Update (n :: Nat) (a :: k) (lst :: [k]) :: [k] type family Select (n :: Nat) (a :: *) :: * type family PrependAll (els :: *) (lsts :: k) :: k type family Unzip2 (lst :: [*]) :: ([*], [*]) type family Zip5 (l1 :: [*]) (l2 :: [*]) (l3 :: [*]) (l4 :: [*]) (l5 :: [*]) :: [*] type family Zip4 (l1 :: [*]) (l2 :: [*]) (l3 :: [*]) (l4 :: [*]) :: [*] type family Zip3 (l1 :: [*]) (l2 :: [*]) (l3 :: [*]) :: [*] type family Zip2 (l1 :: [*]) (l2 :: [*]) :: [*] type Zip a b = Zip2 a b type family Replicate (n :: Nat) a type family DropInit (lst :: [k]) :: [k] type family Init (lst :: [k]) :: [k] type family Last (lst :: [k]) :: k type family Join (lst :: [[k]]) :: [k] type family Drop (n :: Nat) lst type family Take (n :: Nat) lst type family Reverse' lst lst' type family UniqueFix lst type family Head' lst type family Head lst data Recursive a type family SuccMaybe (m :: Maybe Nat) type family ElAt (idx :: Nat) (cont :: c) :: l type family RemovedIdx (idx :: Nat) (cont :: c) :: l type family Removed (el :: e) (cont :: c) :: l type family FromLst a data Lst (l :: [k]) module Type.Zip type family Zip lst lst' type family ZipWith f lst lst'