ty-0.1.7: Typed type representations and equality proofs

Copyright(c) Conal Elliott 2009
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Data.Ty

Description

Typed typerefs

Synopsis

Documentation

class Typeable k a #

The class Typeable allows a concrete representation of a type to be calculated.

Minimal complete definition

typeRep#

module Data.IsTy

data Ty a Source #

Phantom type wrapper around a TypeRep

Instances

IsTy Ty Source # 

Associated Types

type IsTyConstraint (Ty :: * -> *) z :: Constraint Source #

Methods

tyEq :: (IsTyConstraint Ty a, IsTyConstraint Ty b) => Ty a -> Ty b -> Maybe (a :=: b) Source #

Eq (Ty a) Source # 

Methods

(==) :: Ty a -> Ty a -> Bool #

(/=) :: Ty a -> Ty a -> Bool #

Show (Ty a) Source # 

Methods

showsPrec :: Int -> Ty a -> ShowS #

show :: Ty a -> String #

showList :: [Ty a] -> ShowS #

type IsTyConstraint Ty z Source # 
type IsTyConstraint Ty z = Yes Ty z

ty :: Typeable a => Ty a Source #

tyOf :: Typeable a => a -> Ty a Source #

The Ty of a value

tyOf1 :: forall f a. Typeable a => f a -> Ty a Source #

The Ty of a value from a constructor application

tyOf2 :: forall g f a. Typeable a => g (f a) -> Ty a Source #

The Ty of a value from a nested constructor application

(=:=) :: forall a b. (Typeable a, Typeable b, Eq a) => a -> b -> Maybe (a :=: b) Source #

Equality of typed values. Just Refl means the the types match and the values match.

data AsPairTy :: * -> * where Source #

Constructors

PairTy :: Ty a -> Ty b -> AsPairTy (a, b)