htree-0.2.0.0: a library to build and work with heterogeneous, type level indexed rose trees
Safe HaskellNone
LanguageGHC2021

Data.HTree

Description

a module for useful reexports from the modules

Synopsis

lists

data HList (f :: k -> Type) (ts :: [k]) where Source #

A heterogeneous list

>>> "bla" `HCons` 23 `HCons` HNil :: HList Identity '[ String, Int ]
HCons (Identity "bla") (HCons (Identity 23) HNil)

Constructors

HCons :: forall {k} (f :: k -> Type) (x :: k) (xs :: [k]). f x -> HList f xs -> HList f (x ': xs) infixr 5 
HNil :: forall {k} (f :: k -> Type). HList f ('[] :: [k]) 

Bundled Patterns

pattern (:::) :: forall {a} f (x :: a) xs. f x -> HList f xs -> HList f (x ': xs) infixr 5

pattern synonym for HCons

>>> t = "bla" ::: 23 ::: HNil :: HList Identity '[ String, Int ]
>>> t
HCons (Identity "bla") (HCons (Identity 23) HNil)
>>> case t of (x ::: _) -> runIdentity x
"bla"
pattern HSing :: forall {k} f (a :: k). f a -> HList f '[a]

pattern that allows to construct a singleton HList

>>> HSing 42 :: HList Identity '[ Int ]
HCons (Identity 42) HNil

Instances

Instances details
(forall x. Eq x => Eq (f x), Typeable f) => Eq (EList (Has (Both (Typeable :: Type -> Constraint) Eq) f)) Source # 
Instance details

Defined in Data.HTree.Existential

Methods

(==) :: EList (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> EList (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

(/=) :: EList (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> EList (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

Eq (f k2) => Eq (EList (HasIs k2 f)) Source # 
Instance details

Defined in Data.HTree.Existential

Methods

(==) :: EList (HasIs k2 f) -> EList (HasIs k2 f) -> Bool #

(/=) :: EList (HasIs k2 f) -> EList (HasIs k2 f) -> Bool #

(Show (f x), Show (HList f xs)) => Show (HList f (x ': xs)) Source # 
Instance details

Defined in Data.HTree.List

Methods

showsPrec :: Int -> HList f (x ': xs) -> ShowS #

show :: HList f (x ': xs) -> String #

showList :: [HList f (x ': xs)] -> ShowS #

Show (HList f ('[] :: [k])) Source # 
Instance details

Defined in Data.HTree.List

Methods

showsPrec :: Int -> HList f ('[] :: [k]) -> ShowS #

show :: HList f ('[] :: [k]) -> String #

showList :: [HList f ('[] :: [k])] -> ShowS #

(Eq (f x), Eq (HList f xs)) => Eq (HList f (x ': xs)) Source # 
Instance details

Defined in Data.HTree.List

Methods

(==) :: HList f (x ': xs) -> HList f (x ': xs) -> Bool #

(/=) :: HList f (x ': xs) -> HList f (x ': xs) -> Bool #

Eq (HList f ('[] :: [k])) Source # 
Instance details

Defined in Data.HTree.List

Methods

(==) :: HList f ('[] :: [k]) -> HList f ('[] :: [k]) -> Bool #

(/=) :: HList f ('[] :: [k]) -> HList f ('[] :: [k]) -> Bool #

trees

data HTree (f :: k -> Type) (t :: TyTree k) where Source #

a heterogeneous rose tree indexed by a TyTree

Constructors

HNode :: forall {k} (f :: k -> Type) (a :: k) (ts :: TyForest k). f a -> HForest f ts -> HTree f ('TyNode a ts) infixr 4 

Bundled Patterns

pattern HLeaf :: forall {a1} f (a2 :: a1). f a2 -> HTree f ('TyNode a2 ('[] :: [TyTree a1]))

a pattern synonym for the leaf of an HTree

Instances

Instances details
(HasField' 'BFS (Labeled l typ) t, Functor f) => HasField (l :: k) (HTree f t) (f typ) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

getField :: HTree f t -> f typ #

(forall x. Eq x => Eq (f x), Typeable f) => Eq (ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f)) Source # 
Instance details

Defined in Data.HTree.Existential

Methods

(==) :: ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

(/=) :: ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

(Show (f a2), Show (HForest f t)) => Show (HTree f ('TyNode a2 t)) Source # 
Instance details

Defined in Data.HTree.Tree

Methods

showsPrec :: Int -> HTree f ('TyNode a2 t) -> ShowS #

show :: HTree f ('TyNode a2 t) -> String #

showList :: [HTree f ('TyNode a2 t)] -> ShowS #

(Eq (f a2), Eq (HForest f t)) => Eq (HTree f ('TyNode a2 t)) Source # 
Instance details

Defined in Data.HTree.Tree

Methods

(==) :: HTree f ('TyNode a2 t) -> HTree f ('TyNode a2 t) -> Bool #

(/=) :: HTree f ('TyNode a2 t) -> HTree f ('TyNode a2 t) -> Bool #

pattern HNodeL :: forall {l1} (l2 :: l1) a f (ts :: TyForest Type). Functor f => f a -> HForest f ts -> HTree f ('TyNode (Labeled l2 a) ts) infixr 4 Source #

a pattern that allows for direct construction and destruction of nodes with labels

data TyTree (k1 :: k) where Source #

a type level rose-tree that is only intended to store something of a certain kind, e.g. Type

Constructors

TyNode :: forall a. a -> TyForest a -> TyTree a infixr 4 

Instances

Instances details
HasField' strat typ t => Decide strat 'False typ ('TyNode typ' (t ': ts')) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence' :: forall {proxy :: forall k. k -> Type}. proxy strat -> proxy 'False -> Path typ ('TyNode typ' (t ': ts')) Source #

HasField' strat typ ('TyNode typ' ts) => Decide strat 'True typ ('TyNode typ' (t' ': ts)) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence' :: forall {proxy :: forall k. k -> Type}. proxy strat -> proxy 'True -> Path typ ('TyNode typ' (t' ': ts)) Source #

HasField' 'BFS typ ('TyNode typ (t ': ts)) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'BFS -> Path typ ('TyNode typ (t ': ts)) Source #

HasField' 'BFS typ ('TyNode typ ('[] :: [TyTree Type])) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'BFS -> Path typ ('TyNode typ ('[] :: [TyTree Type])) Source #

Decide 'BFS (AnyElem typ ts) typ ('TyNode typ' (t ': ts)) => HasField' 'BFS typ ('TyNode typ' (t ': ts)) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'BFS -> Path typ ('TyNode typ' (t ': ts)) Source #

HasField' 'DFS typ ('TyNode typ (t ': ts)) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'DFS -> Path typ ('TyNode typ (t ': ts)) Source #

HasField' 'DFS typ ('TyNode typ ('[] :: [TyTree Type])) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'DFS -> Path typ ('TyNode typ ('[] :: [TyTree Type])) Source #

Decide 'DFS (Not (Elem typ t)) typ ('TyNode typ' (t ': ts)) => HasField' 'DFS typ ('TyNode typ' (t ': ts)) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

evidence :: proxy 'DFS -> Path typ ('TyNode typ' (t ': ts)) Source #

(forall x. Eq x => Eq (f x), Typeable f) => Eq (ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f)) Source # 
Instance details

Defined in Data.HTree.Existential

Methods

(==) :: ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

(/=) :: ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> ETree (Has (Both (Typeable :: Type -> Constraint) Eq) f) -> Bool #

type TyNodeL (l1 :: l) a = 'TyNode (Labeled l1 a) infixr 4 Source #

a type syonym that allows for easy construction of TyTrees that have labeled nodes

mapping a tree

hmap :: forall {k} f g (t :: TyTree k). (forall (a :: k). f a -> g a) -> HTree f t -> HTree g t Source #

map a function over an HTree

hcmap :: forall {k} f g (t :: TyTree k). forall (c :: k -> Constraint) -> AllTree c t => (forall (a :: k). c a => f a -> g a) -> HTree f t -> HTree g t Source #

map a function with a constraint over an HTree

traversing a tree

htraverse :: forall {k} h f g (t :: TyTree k). Applicative h => (forall (a :: k). f a -> h (g a)) -> HTree f t -> h (HTree g t) Source #

traverse a structure with a function

hctraverse :: forall {k} h f g (t :: TyTree k). forall (c :: k -> Constraint) -> (AllTree c t, Applicative h) => (forall (a :: k). c a => f a -> h (g a)) -> HTree f t -> h (HTree g t) Source #

traverse a structure such that a constraint holds; this is the workhorse of mapping and traversing

folding a tree

value level

hFoldMap :: forall {k} f (t :: TyTree k) b. Semigroup b => (forall (a :: k). f a -> b) -> HTree f t -> b Source #

monoidally folds down a tree to a single value, this is similar to foldMap

hcFoldMap :: forall {k} f (t :: TyTree k) b. forall (c :: k -> Constraint) -> (AllTree c t, Semigroup b) => (forall (a :: k). c a => f a -> b) -> HTree f t -> b Source #

monoidally folds down a tree to a single value using a constraint on the element in the wrapping functor, this is similar to foldMap

hFlatten :: forall {k} (f :: k -> Type) (t :: TyTree k). HTree f t -> HList f (FlattenTree t) Source #

flatten a heterogeneous tree down to a heterogeneous list

type level

type family FlattenTree (t :: TyTree k) :: [k] where ... Source #

a type family that flattens a tree down to a list

Equations

FlattenTree ('TyNode x xs :: TyTree k) = x ': FlattenForest xs 

type family FlattenForest (f :: TyForest k) :: [k] where ... Source #

a type family that flattens a forest down to a list

Equations

FlattenForest ('[] :: [TyTree k]) = '[] :: [k] 
FlattenForest (x ': xs :: [TyTree k]) = FlattenTree x ++ FlattenForest xs 

searching a tree

newtype Labeled (l1 :: l) a Source #

a newtype that is labeled with some typelevel tag

Constructors

MkLabeled 

Fields

Instances

Instances details
Functor (Labeled l2) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

fmap :: (a -> b) -> Labeled l2 a -> Labeled l2 b #

(<$) :: a -> Labeled l2 b -> Labeled l2 a #

Foldable (Labeled l2) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

fold :: Monoid m => Labeled l2 m -> m #

foldMap :: Monoid m => (a -> m) -> Labeled l2 a -> m #

foldMap' :: Monoid m => (a -> m) -> Labeled l2 a -> m #

foldr :: (a -> b -> b) -> b -> Labeled l2 a -> b #

foldr' :: (a -> b -> b) -> b -> Labeled l2 a -> b #

foldl :: (b -> a -> b) -> b -> Labeled l2 a -> b #

foldl' :: (b -> a -> b) -> b -> Labeled l2 a -> b #

foldr1 :: (a -> a -> a) -> Labeled l2 a -> a #

foldl1 :: (a -> a -> a) -> Labeled l2 a -> a #

toList :: Labeled l2 a -> [a] #

null :: Labeled l2 a -> Bool #

length :: Labeled l2 a -> Int #

elem :: Eq a => a -> Labeled l2 a -> Bool #

maximum :: Ord a => Labeled l2 a -> a #

minimum :: Ord a => Labeled l2 a -> a #

sum :: Num a => Labeled l2 a -> a #

product :: Num a => Labeled l2 a -> a #

Traversable (Labeled l2) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

traverse :: Applicative f => (a -> f b) -> Labeled l2 a -> f (Labeled l2 b) #

sequenceA :: Applicative f => Labeled l2 (f a) -> f (Labeled l2 a) #

mapM :: Monad m => (a -> m b) -> Labeled l2 a -> m (Labeled l2 b) #

sequence :: Monad m => Labeled l2 (m a) -> m (Labeled l2 a) #

Generic (Labeled l2 a) Source # 
Instance details

Defined in Data.HTree.Labeled

Associated Types

type Rep (Labeled l2 a) 
Instance details

Defined in Data.HTree.Labeled

type Rep (Labeled l2 a) = D1 ('MetaData "Labeled" "Data.HTree.Labeled" "htree-0.2.0.0-inplace" 'True) (C1 ('MetaCons "MkLabeled" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from :: Labeled l2 a -> Rep (Labeled l2 a) x #

to :: Rep (Labeled l2 a) x -> Labeled l2 a #

Show a => Show (Labeled l2 a) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

showsPrec :: Int -> Labeled l2 a -> ShowS #

show :: Labeled l2 a -> String #

showList :: [Labeled l2 a] -> ShowS #

Eq a => Eq (Labeled l2 a) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

(==) :: Labeled l2 a -> Labeled l2 a -> Bool #

(/=) :: Labeled l2 a -> Labeled l2 a -> Bool #

Ord a => Ord (Labeled l2 a) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

compare :: Labeled l2 a -> Labeled l2 a -> Ordering #

(<) :: Labeled l2 a -> Labeled l2 a -> Bool #

(<=) :: Labeled l2 a -> Labeled l2 a -> Bool #

(>) :: Labeled l2 a -> Labeled l2 a -> Bool #

(>=) :: Labeled l2 a -> Labeled l2 a -> Bool #

max :: Labeled l2 a -> Labeled l2 a -> Labeled l2 a #

min :: Labeled l2 a -> Labeled l2 a -> Labeled l2 a #

type Rep (Labeled l2 a) Source # 
Instance details

Defined in Data.HTree.Labeled

type Rep (Labeled l2 a) = D1 ('MetaData "Labeled" "Data.HTree.Labeled" "htree-0.2.0.0-inplace" 'True) (C1 ('MetaCons "MkLabeled" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

class HasField (x :: k) r a | x r -> a where #

Constraint representing the fact that the field x belongs to the record type r and has field type a. This will be solved automatically, but manual instances may be provided as well.

Methods

getField :: r -> a #

Selector function to extract the field from the record.

Instances

Instances details
(HasField' 'BFS (Labeled l typ) t, Functor f) => HasField (l :: k) (HTree f t) (f typ) Source # 
Instance details

Defined in Data.HTree.Labeled

Methods

getField :: HTree f t -> f typ #

getElem :: forall {k} (t :: TyTree Type) f. forall (strat :: SearchStrategy) (l :: k) typ -> (HasField' strat (Labeled l typ) t, Functor f) => HTree f t -> f typ Source #

searches a tree for an element and returns that element, specialised to Labeled and unwraps

>>> import Data.Functor.Identity
>>> type T = TyNodeL "top" Int [ TyNodeL "inter" Int '[ TyNodeL "foo" Int '[]], TyNodeL "foo" Int '[]]
>>> t :: HTree Identity T = 42 `HNodeL` HNodeL 4 (HNodeL 69 HNil `HCons` HNil) `HCons` HNodeL 67 HNil `HCons` HNil
>>> getElem DFS "foo" Int t
Identity 69
>>> getElem BFS "foo" Int t
Identity 67

useful reexports

data Proxy (t :: k) #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the undefined :: a idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep1 (Proxy :: k -> Type)

@since base-4.6.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))

Methods

from1 :: forall (a :: k). Proxy a -> Rep1 (Proxy :: k -> Type) a #

to1 :: forall (a :: k). Rep1 (Proxy :: k -> Type) a -> Proxy a #

MonadZip (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: Proxy a -> Proxy b -> Proxy (a, b) #

mzipWith :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

munzip :: Proxy (a, b) -> (Proxy a, Proxy b) #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Contravariant (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Proxy a -> Proxy a' #

(>$) :: b -> Proxy b -> Proxy a #

Alternative (Proxy :: Type -> Type)

@since base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

Applicative (Proxy :: Type -> Type)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Functor (Proxy :: Type -> Type)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Monad (Proxy :: Type -> Type)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

MonadPlus (Proxy :: Type -> Type)

@since base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Foldable (Proxy :: Type -> Type)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Monoid (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Semigroup (Proxy s)

@since base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Bounded (Proxy t)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Generic (Proxy t) 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep (Proxy t)

@since base-4.6.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Ix (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int #

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int #

Read (Proxy t)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Show (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Eq (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

@since base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

type Rep1 (Proxy :: k -> Type)

@since base-4.6.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (Proxy t)

@since base-4.6.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))

type Type = TYPE LiftedRep #

The kind of types with lifted values. For example Int :: Type.

type Constraint = CONSTRAINT LiftedRep #

The kind of lifted constraints

type Dict c = Has (Charge c :: Type -> Constraint) (Proxy :: Type -> Type) () Source #

a Dict witnesses some constraint

pattern Dict :: () => c => Dict c Source #

match on a Dict

withDict :: Dict c -> (c => r) -> r Source #

destructing a Dict