Module
Data.Reflectable
- Package
- purescript-prelude
- Repository
- purescript/purescript-prelude
#Reflectable Source
class Reflectable :: forall k. k -> Type -> Constraint
class Reflectable v t | v -> t where
A type-class for reflectable types.
Instances for the following kinds are solved by the compiler:
- Boolean
- Int
- Ordering
- Symbol
Members
reflectType :: Proxy v -> t
#reifyType Source
reifyType :: forall t r. Reifiable t => t -> (forall v. Reflectable v t => Proxy v -> r) -> r
Reify a value of type t
such that it can be consumed by a
function constrained by the Reflectable
type class. For
example:
twiceFromType :: forall v. Reflectable v Int => Proxy v -> Int
twiceFromType = (_ * 2) <<< reflectType
twiceOfTerm :: Int
twiceOfTerm = reifyType 21 twiceFromType
- Modules
- Control.
Applicative - Control.
Apply - Control.
Bind - Control.
Category - Control.
Monad - Control.
Semigroupoid - Data.
Boolean - Data.
BooleanAlgebra - Data.
Bounded - Data.
Bounded. Generic - Data.
CommutativeRing - Data.
DivisionRing - Data.
Eq - Data.
Eq. Generic - Data.
EuclideanRing - Data.
Field - Data.
Function - Data.
Functor - Data.
Generic. Rep - Data.
HeytingAlgebra - Data.
HeytingAlgebra. Generic - Data.
Monoid - Data.
Monoid. Additive - Data.
Monoid. Conj - Data.
Monoid. Disj - Data.
Monoid. Dual - Data.
Monoid. Endo - Data.
Monoid. Generic - Data.
Monoid. Multiplicative - Data.
NaturalTransformation - Data.
Ord - Data.
Ord. Generic - Data.
Ordering - Data.
Reflectable - Data.
Ring - Data.
Ring. Generic - Data.
Semigroup - Data.
Semigroup. First - Data.
Semigroup. Generic - Data.
Semigroup. Last - Data.
Semiring - Data.
Semiring. Generic - Data.
Show - Data.
Show. Generic - Data.
Symbol - Data.
Unit - Data.
Void - Prelude
- Record.
Unsafe - Type.
Proxy
Reflect a type
v
to its term-level representation.