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

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

Clash.Core.Term

Description

Term representation in the CoreHW language: System F + LetRec + Case

Synopsis

Documentation

data Term #

Term representation in the CoreHW language: System F + LetRec + Case

Constructors

Var !Type !TmName

Variable reference

Data !DataCon

Datatype constructor

Literal !Literal

Literal

Prim !Text !Type

Primitive

Lam !(Bind Id Term)

Term-abstraction

TyLam !(Bind TyVar Term)

Type-abstraction

App !Term !Term

Application

TyApp !Term !Type

Type-application

Letrec !(Bind (Rec [LetBinding]) Term)

Recursive let-binding

Case !Term !Type [Alt]

Case-expression: subject, type of alternatives, list of alternatives

Cast !Term !Type !Type

Cast a term from one type to another

Instances
Eq Term # 
Instance details

Defined in Clash.Core.Term

Methods

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

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

Ord Term # 
Instance details

Defined in Clash.Core.Term

Methods

compare :: Term -> Term -> Ordering #

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

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

(>) :: Term -> Term -> Bool #

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

max :: Term -> Term -> Term #

min :: Term -> Term -> Term #

Show Term # 
Instance details

Defined in Clash.Core.Term

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

Generic Term # 
Instance details

Defined in Clash.Core.Term

Associated Types

type Rep Term :: * -> * #

Methods

from :: Term -> Rep Term x #

to :: Rep Term x -> Term #

Hashable Term # 
Instance details

Defined in Clash.Core.Term

Methods

hashWithSalt :: Int -> Term -> Int #

hash :: Term -> Int #

NFData Term # 
Instance details

Defined in Clash.Core.Term

Methods

rnf :: Term -> () #

Alpha Term # 
Instance details

Defined in Clash.Core.Term

Pretty Term # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

Subst Term Term # 
Instance details

Defined in Clash.Core.Term

Subst Term Type # 
Instance details

Defined in Clash.Core.Type

Subst Term Pat # 
Instance details

Defined in Clash.Core.Term

Subst Type Term # 
Instance details

Defined in Clash.Core.Term

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

Defined in Clash.Core.Var

Methods

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

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

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

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

Pretty (Var Term) # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

Pretty (Id, Term) # 
Instance details

Defined in Clash.Core.Pretty

Methods

ppr :: LFresh m => (Id, Term) -> m Doc #

pprPrec :: LFresh m => Rational -> (Id, Term) -> m Doc #

type Rep Term # 
Instance details

Defined in Clash.Core.Term

type Rep Term = D1 (MetaData "Term" "Clash.Core.Term" "clash-lib-0.99.2-HeLjqoT5HYQAP3RHiuY9iz" False) (((C1 (MetaCons "Var" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TmName)) :+: C1 (MetaCons "Data" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 DataCon))) :+: (C1 (MetaCons "Literal" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Literal)) :+: (C1 (MetaCons "Prim" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type)) :+: C1 (MetaCons "Lam" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Bind Id Term)))))) :+: ((C1 (MetaCons "TyLam" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Bind TyVar Term))) :+: (C1 (MetaCons "App" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Term) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Term)) :+: C1 (MetaCons "TyApp" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Term) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type)))) :+: (C1 (MetaCons "Letrec" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Bind (Rec [LetBinding]) Term))) :+: (C1 (MetaCons "Case" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Term) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Alt]))) :+: C1 (MetaCons "Cast" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Term) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Type)))))))

type TmName = Name Term #

Term reference

type LetBinding = (Id, Embed Term) #

Binding in a LetRec construct

data Pat #

Patterns in the LHS of a case-decomposition

Constructors

DataPat !(Embed DataCon) !(Rebind [TyVar] [Id])

Datatype pattern, '[TyVar]' bind existentially-quantified type-variables of a DataCon

LitPat !(Embed Literal)

Literal pattern

DefaultPat

Default pattern

Instances
Eq Pat # 
Instance details

Defined in Clash.Core.Term

Methods

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

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

Show Pat # 
Instance details

Defined in Clash.Core.Term

Methods

showsPrec :: Int -> Pat -> ShowS #

show :: Pat -> String #

showList :: [Pat] -> ShowS #

Generic Pat # 
Instance details

Defined in Clash.Core.Term

Associated Types

type Rep Pat :: * -> * #

Methods

from :: Pat -> Rep Pat x #

to :: Rep Pat x -> Pat #

Hashable Pat # 
Instance details

Defined in Clash.Core.Term

Methods

hashWithSalt :: Int -> Pat -> Int #

hash :: Pat -> Int #

NFData Pat # 
Instance details

Defined in Clash.Core.Term

Methods

rnf :: Pat -> () #

Alpha Pat # 
Instance details

Defined in Clash.Core.Term

Pretty Pat # 
Instance details

Defined in Clash.Core.Pretty

Methods

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

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

Subst Term Pat # 
Instance details

Defined in Clash.Core.Term

Subst Type Pat # 
Instance details

Defined in Clash.Core.Term

type Rep Pat # 
Instance details

Defined in Clash.Core.Term

type Alt = Bind Pat Term #