clash-lib-0.99.2: 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 #

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 # 
Instance details

Defined in Clash.Core.Type

Methods

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

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

Ord Type # 
Instance details

Defined in Clash.Core.Type

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 # 
Instance details

Defined in Clash.Core.Type

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Generic Type # 
Instance details

Defined in Clash.Core.Type

Associated Types

type Rep Type :: * -> * #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Hashable Type # 
Instance details

Defined in Clash.Core.Type

Methods

hashWithSalt :: Int -> Type -> Int #

hash :: Type -> Int #

NFData Type # 
Instance details

Defined in Clash.Core.Type

Methods

rnf :: Type -> () #

Alpha Type # 
Instance details

Defined in Clash.Core.Type

Pretty Type # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

Subst Term Type # 
Instance details

Defined in Clash.Core.Type

Subst Type Term # 
Instance details

Defined in Clash.Core.Term

Subst Type Type # 
Instance details

Defined in Clash.Core.Type

Subst Type Pat # 
Instance details

Defined in Clash.Core.Term

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

Defined in Clash.Core.Var

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) # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

type Rep Type # 
Instance details

Defined in Clash.Core.Type

data TypeView #

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 # 
Instance details

Defined in Clash.Core.Type

data ConstTy #

Type Constants

Constructors

TyCon !TyConName

TyCon type

Arrow

Function type

Instances
Show ConstTy # 
Instance details

Defined in Clash.Core.Type

Generic ConstTy # 
Instance details

Defined in Clash.Core.Type

Associated Types

type Rep ConstTy :: * -> * #

Methods

from :: ConstTy -> Rep ConstTy x #

to :: Rep ConstTy x -> ConstTy #

Hashable ConstTy # 
Instance details

Defined in Clash.Core.Type

Methods

hashWithSalt :: Int -> ConstTy -> Int #

hash :: ConstTy -> Int #

NFData ConstTy # 
Instance details

Defined in Clash.Core.Type

Methods

rnf :: ConstTy -> () #

Alpha ConstTy # 
Instance details

Defined in Clash.Core.Type

Subst a ConstTy # 
Instance details

Defined in Clash.Core.Type

type Rep ConstTy # 
Instance details

Defined in Clash.Core.Type

type Rep ConstTy = D1 (MetaData "ConstTy" "Clash.Core.Type" "clash-lib-0.99.2-HeLjqoT5HYQAP3RHiuY9iz" False) (C1 (MetaCons "TyCon" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TyConName)) :+: C1 (MetaCons "Arrow" PrefixI False) (U1 :: * -> *))

data LitTy #

Literal Types

Constructors

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

Defined in Clash.Core.Type

Methods

showsPrec :: Int -> LitTy -> ShowS #

show :: LitTy -> String #

showList :: [LitTy] -> ShowS #

Generic LitTy # 
Instance details

Defined in Clash.Core.Type

Associated Types

type Rep LitTy :: * -> * #

Methods

from :: LitTy -> Rep LitTy x #

to :: Rep LitTy x -> LitTy #

Hashable LitTy # 
Instance details

Defined in Clash.Core.Type

Methods

hashWithSalt :: Int -> LitTy -> Int #

hash :: LitTy -> Int #

NFData LitTy # 
Instance details

Defined in Clash.Core.Type

Methods

rnf :: LitTy -> () #

Alpha LitTy # 
Instance details

Defined in Clash.Core.Type

Pretty LitTy # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

Subst a LitTy # 
Instance details

Defined in Clash.Core.Type

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 # 
Instance details

Defined in Clash.Core.Type

type Kind = Type #

The level above types

type KindOrType = Type #

Either a Kind or a Type

type KiName = Name Kind #

Reference to a Kind

type TyName = Name Type #

Reference to a Type

type TyVar = Var Type #

Type variable

tyView :: Type -> TypeView #

An easier view on types

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

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 #

Determine the kind of a type

mkTyConTy :: TyConName -> Type #

Make a Type out of a TyCon

mkFunTy :: Type -> Type -> Type #

Make a function type of an argument and result type

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

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

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

Split a function type in an argument and result type

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

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) #

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]) #

Split a TyCon Application in a TyCon and its arguments

isPolyFunTy :: Type -> Bool #

Is a type a polymorphic or function type?

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

Is a type a polymorphic or function type under coreView?

isPolyTy :: Type -> Bool #

Is a type polymorphic?

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

Is a type a function type?

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

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

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

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

undefinedTy :: Type #

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