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

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

Methods

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

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

Ord Term Source # 
Instance details

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

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

Generic Term Source # 
Instance details

Associated Types

type Rep Term :: * -> * #

Methods

from :: Term -> Rep Term x #

to :: Rep Term x -> Term #

Hashable Term Source # 
Instance details

Methods

hashWithSalt :: Int -> Term -> Int #

hash :: Term -> Int #

NFData Term Source # 
Instance details

Methods

rnf :: Term -> () #

Alpha Term Source # 
Instance details
Pretty Term Source # 
Instance details

Methods

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

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

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

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

Methods

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

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

Pretty (Id, Term) Source # 
Instance details

Methods

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

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

type Rep Term Source # 
Instance details
type Rep Term = D1 (MetaData "Term" "Clash.Core.Term" "clash-lib-0.99.3-inplace" 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 Source #

Term reference

type LetBinding = (Id, Embed Term) Source #

Binding in a LetRec construct

data Pat Source #

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

Methods

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

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

Show Pat Source # 
Instance details

Methods

showsPrec :: Int -> Pat -> ShowS #

show :: Pat -> String #

showList :: [Pat] -> ShowS #

Generic Pat Source # 
Instance details

Associated Types

type Rep Pat :: * -> * #

Methods

from :: Pat -> Rep Pat x #

to :: Rep Pat x -> Pat #

Hashable Pat Source # 
Instance details

Methods

hashWithSalt :: Int -> Pat -> Int #

hash :: Pat -> Int #

NFData Pat Source # 
Instance details

Methods

rnf :: Pat -> () #

Alpha Pat Source # 
Instance details
Pretty Pat Source # 
Instance details

Methods

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

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

Subst Term Pat Source # 
Instance details
Subst Type Pat Source # 
Instance details
type Rep Pat Source # 
Instance details