clash-lib-0.99.3: CAES Language for Synchronous Hardware - As a Library

Copyright(C) 2012-2016 University of Twente
2016 Myrtle Software Ltd
2017 Google Inc.
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Core.Type

Description

Types in CoreHW

Synopsis

Documentation

data Type Source #

Types in CoreHW: function and polymorphic types

Constructors

VarTy !Kind !TyName

Type variable

ConstTy !ConstTy

Type constant

ForAllTy !(Bind TyVar Type)

Polymorphic Type

AppTy !Type !Type

Type Application

LitTy !LitTy

Type literal

Instances
Eq Type Source # 
Instance details

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Show Type Source # 
Instance details

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Generic Type Source # 
Instance details

Associated Types

type Rep Type :: * -> * #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Hashable Type Source # 
Instance details

Methods

hashWithSalt :: Int -> Type -> Int #

hash :: Type -> Int #

NFData Type Source # 
Instance details

Methods

rnf :: Type -> () #

Alpha Type Source # 
Instance details
Pretty Type Source # 
Instance details

Methods

ppr :: LFresh m => Type -> m Doc Source #

pprPrec :: LFresh m => Rational -> Type -> m Doc Source #

Subst Term Type Source # 
Instance details
Subst Type Term # 
Instance details
Subst Type Type Source # 
Instance details
Subst Type Pat # 
Instance details
Generic b => Subst Type (Var b) # 
Instance details

Methods

isvar :: Var b -> Maybe (SubstName (Var b) Type) #

isCoerceVar :: Var b -> Maybe (SubstCoerce (Var b) Type) #

subst :: Name Type -> Type -> Var b -> Var b #

substs :: [(Name Type, Type)] -> Var b -> Var b #

Pretty (Var Type) Source # 
Instance details

Methods

ppr :: LFresh m => Var Type -> m Doc Source #

pprPrec :: LFresh m => Rational -> Var Type -> m Doc Source #

type Rep Type Source # 
Instance details

data TypeView Source #

An easier view on types

Constructors

FunTy !Type !Type

Function type

TyConApp !TyConName [Type]

Applied TyCon

OtherType !Type

Neither of the above

Instances
Show TypeView Source # 
Instance details

data ConstTy Source #

Type Constants

Constructors

TyCon !TyConName

TyCon type

Arrow

Function type

Instances
Show ConstTy Source # 
Instance details
Generic ConstTy Source # 
Instance details

Associated Types

type Rep ConstTy :: * -> * #

Methods

from :: ConstTy -> Rep ConstTy x #

to :: Rep ConstTy x -> ConstTy #

Hashable ConstTy Source # 
Instance details

Methods

hashWithSalt :: Int -> ConstTy -> Int #

hash :: ConstTy -> Int #

NFData ConstTy Source # 
Instance details

Methods

rnf :: ConstTy -> () #

Alpha ConstTy Source # 
Instance details
Subst a ConstTy Source # 
Instance details
type Rep ConstTy Source # 
Instance details
type Rep ConstTy = D1 (MetaData "ConstTy" "Clash.Core.Type" "clash-lib-0.99.3-inplace" False) (C1 (MetaCons "TyCon" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TyConName)) :+: C1 (MetaCons "Arrow" PrefixI False) (U1 :: * -> *))

data LitTy Source #

Literal Types

Constructors

NumTy !Integer 
SymTy !String 
Instances
Show LitTy Source # 
Instance details

Methods

showsPrec :: Int -> LitTy -> ShowS #

show :: LitTy -> String #

showList :: [LitTy] -> ShowS #

Generic LitTy Source # 
Instance details

Associated Types

type Rep LitTy :: * -> * #

Methods

from :: LitTy -> Rep LitTy x #

to :: Rep LitTy x -> LitTy #

Hashable LitTy Source # 
Instance details

Methods

hashWithSalt :: Int -> LitTy -> Int #

hash :: LitTy -> Int #

NFData LitTy Source # 
Instance details

Methods

rnf :: LitTy -> () #

Alpha LitTy Source # 
Instance details
Pretty LitTy Source # 
Instance details

Methods

ppr :: LFresh m => LitTy -> m Doc Source #

pprPrec :: LFresh m => Rational -> LitTy -> m Doc Source #

Subst a LitTy Source # 
Instance details

Methods

isvar :: LitTy -> Maybe (SubstName LitTy a) #

isCoerceVar :: LitTy -> Maybe (SubstCoerce LitTy a) #

subst :: Name a -> a -> LitTy -> LitTy #

substs :: [(Name a, a)] -> LitTy -> LitTy #

type Rep LitTy Source # 
Instance details

type Kind = Type Source #

The level above types

type KindOrType = Type Source #

Either a Kind or a Type

type KiName = Name Kind Source #

Reference to a Kind

type TyName = Name Type Source #

Reference to a Type

type TyVar = Var Type Source #

Type variable

tyView :: Type -> TypeView Source #

An easier view on types

coreView :: HashMap TyConOccName TyCon -> Type -> Maybe Type Source #

A view on types in which newtypes are transparent, the Signal type is transparent, and type functions are evaluated to WHNF (when possible).

Only strips away one "layer".

typeKind :: HashMap TyConOccName TyCon -> Type -> Kind Source #

Determine the kind of a type

mkTyConTy :: TyConName -> Type Source #

Make a Type out of a TyCon

mkFunTy :: Type -> Type -> Type Source #

Make a function type of an argument and result type

mkTyConApp :: TyConName -> [Type] -> Type Source #

Make a TyCon Application out of a TyCon and a list of argument types

splitFunTy :: HashMap TyConOccName TyCon -> Type -> Maybe (Type, Type) Source #

Split a function type in an argument and result type

splitFunForallTy :: Type -> ([Either TyVar Type], Type) Source #

Split a poly-function type in a: list of type-binders and argument types, and the result type

splitCoreFunForallTy :: HashMap TyConOccName TyCon -> Type -> ([Either TyVar Type], Type) Source #

Split a poly-function type in a: list of type-binders and argument types, and the result type. Looks through Signal and type functions.

splitTyConAppM :: Type -> Maybe (TyConName, [Type]) Source #

Split a TyCon Application in a TyCon and its arguments

isPolyFunTy :: Type -> Bool Source #

Is a type a polymorphic or function type?

isPolyFunCoreTy :: HashMap TyConOccName TyCon -> Type -> Bool Source #

Is a type a polymorphic or function type under coreView?

isPolyTy :: Type -> Bool Source #

Is a type polymorphic?

isFunTy :: HashMap TyConOccName TyCon -> Type -> Bool Source #

Is a type a function type?

applyFunTy :: HashMap TyConOccName TyCon -> Type -> Type -> Type Source #

Apply a function type to an argument type and get the result type

applyTy :: Fresh m => HashMap TyConOccName TyCon -> Type -> KindOrType -> m Type Source #

Substitute the type variable of a type (ForAllTy) with another type

undefinedTy :: Type Source #

The type of GHC.Err.undefined :: forall a . a