clr-typed-0.2.0: A strongly typed Haskell interface to the CLR type system

Safe HaskellNone
LanguageHaskell2010

Clr.Inheritance

Documentation

type family SuperTypes (t :: Type) :: [Type] Source #

Instances

type SuperTypes (T "System.Byte" ([] Type)) Source # 
type SuperTypes (T "System.Byte" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Char" ([] Type)) Source # 
type SuperTypes (T "System.Char" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Double" ([] Type)) Source # 
type SuperTypes (T "System.Double" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Int16" ([] Type)) Source # 
type SuperTypes (T "System.Int16" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Int32" ([] Type)) Source # 
type SuperTypes (T "System.Int32" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Int64" ([] Type)) Source # 
type SuperTypes (T "System.Int64" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.IntPtr" ([] Type)) Source # 
type SuperTypes (T "System.IntPtr" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Object" ([] Type)) Source # 
type SuperTypes (T "System.Object" ([] Type)) = [] Type
type SuperTypes (T "System.SByte" ([] Type)) Source # 
type SuperTypes (T "System.SByte" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.Single" ([] Type)) Source # 
type SuperTypes (T "System.Single" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.String" ([] Type)) Source # 
type SuperTypes (T "System.String" ([] Type)) = (:) * (T "System.Object" ([] Type)) ([] *)
type SuperTypes (T "System.UInt16" ([] Type)) Source # 
type SuperTypes (T "System.UInt16" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.UInt32" ([] Type)) Source # 
type SuperTypes (T "System.UInt32" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.UInt64" ([] Type)) Source # 
type SuperTypes (T "System.UInt64" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.UIntPtr" ([] Type)) Source # 
type SuperTypes (T "System.UIntPtr" ([] Type)) = (:) * (T "System.ValueType" ([] Type)) ([] *)
type SuperTypes (T "System.ValueType" ([] Type)) Source # 
type SuperTypes (T "System.ValueType" ([] Type)) = (:) * (T "System.Object" ([] Type)) ([] *)

type family HasSuper (t :: Type) :: Bool where ... Source #

Equations

HasSuper t = (ListSize (SuperTypes t) `CmpNat` 0) == GT 

type family SuperTypesL (ts :: [Type]) :: [[Type]] where ... Source #

Equations

SuperTypesL '[] = '['[]] 
SuperTypesL (x ': xs) = SuperTypes x ': SuperTypesL xs 

type family WithAllSuperTypes (t :: Type) :: [Type] where ... Source #

type family WithAllSuperTypes' (ts :: [Type]) :: [[Type]] where ... Source #

Equations

WithAllSuperTypes' '[] = '[] 
WithAllSuperTypes' (x ': xs) = '[x] ': (SuperTypes x ': WithAllSuperTypes' (Concat (SuperTypesL (SuperTypes x)) `Append` xs)) 

type family Implements (t1 :: Type) (t2 :: Type) :: Bool where ... Source #

Equations

Implements t1 t1 = True 
Implements t1 t2 = t2 `Elem` WithAllSuperTypes t1 

type family IsValueType (a :: Type) :: Bool where ... Source #

Equations

IsValueType a = a `Implements` T "System.ValueType" '[] 

type family IsRefType (a :: Type) :: Bool where ... Source #

Equations

IsRefType a = Not (IsValueType a) 

upCast :: (t `Implements` t') ~ True => Object t -> Object t' Source #

type family ResolveBaseType (t :: Type) (m :: Type) :: Type where ... Source #

type family ResolveBaseType' (ts :: [Type]) (m :: Type) :: Type where ... Source #

Equations

ResolveBaseType' '[] m = TypeError (Text "Could not find declaring base type of member " :<>: ShowType m) 
ResolveBaseType' (t ': ts) m = If (t `HasMember` m) t (ResolveBaseType' ts m)