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

Methods

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

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

Ord Term Source # 

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 # 

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

Generic Term Source # 

Associated Types

type Rep Term :: * -> * #

Methods

from :: Term -> Rep Term x #

to :: Rep Term x -> Term #

Hashable Term Source # 

Methods

hashWithSalt :: Int -> Term -> Int #

hash :: Term -> Int #

NFData Term Source # 

Methods

rnf :: Term -> () #

Alpha Term Source # 
Pretty Term Source # 

Methods

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

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

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

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 # 

Methods

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

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

Pretty (Id, Term) Source # 

Methods

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

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

type Rep Term Source # 
type Rep Term = D1 * (MetaData "Term" "Clash.Core.Term" "clash-lib-0.99-CApG5XjEMCZFUVyS8kIjXv" False) ((:+:) * ((:+:) * ((:+:) * (C1 * (MetaCons "Var" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Type)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * TmName)))) (C1 * (MetaCons "Data" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * DataCon)))) ((:+:) * (C1 * (MetaCons "Literal" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Literal))) ((:+:) * (C1 * (MetaCons "Prim" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Type)))) (C1 * (MetaCons "Lam" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Bind Id Term))))))) ((:+:) * ((:+:) * (C1 * (MetaCons "TyLam" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Bind TyVar Term)))) ((:+:) * (C1 * (MetaCons "App" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Term)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Term)))) (C1 * (MetaCons "TyApp" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Term)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Type)))))) ((:+:) * (C1 * (MetaCons "Letrec" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Bind (Rec [LetBinding]) Term)))) ((:+:) * (C1 * (MetaCons "Case" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Term)) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Type)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [Alt]))))) (C1 * (MetaCons "Cast" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Term)) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Type)) (S1 * (MetaSel (Nothing 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 # 

Methods

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

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

Show Pat Source # 

Methods

showsPrec :: Int -> Pat -> ShowS #

show :: Pat -> String #

showList :: [Pat] -> ShowS #

Generic Pat Source # 

Associated Types

type Rep Pat :: * -> * #

Methods

from :: Pat -> Rep Pat x #

to :: Rep Pat x -> Pat #

Hashable Pat Source # 

Methods

hashWithSalt :: Int -> Pat -> Int #

hash :: Pat -> Int #

NFData Pat Source # 

Methods

rnf :: Pat -> () #

Alpha Pat Source # 
Pretty Pat Source # 

Methods

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

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

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