cryptol-2.5.0: Cryptol: The Language of Cryptography

Copyright(c) 2013-2016 Galois Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Cryptol.Parser.AST

Contents

Description

 

Synopsis

Names

data Ident Source #

Identifiers, along with a flag that indicates whether or not they're infix operators. The boolean is present just as cached information from the lexer, and never used during comparisons.

Instances

Eq Ident Source # 

Methods

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

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

Ord Ident Source # 

Methods

compare :: Ident -> Ident -> Ordering #

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

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

(>) :: Ident -> Ident -> Bool #

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

max :: Ident -> Ident -> Ident #

min :: Ident -> Ident -> Ident #

Show Ident Source # 

Methods

showsPrec :: Int -> Ident -> ShowS #

show :: Ident -> String #

showList :: [Ident] -> ShowS #

IsString Ident Source # 

Methods

fromString :: String -> Ident #

Generic Ident Source # 

Associated Types

type Rep Ident :: * -> * #

Methods

from :: Ident -> Rep Ident x #

to :: Rep Ident x -> Ident #

NFData Ident Source # 

Methods

rnf :: Ident -> () #

PP Ident Source # 

Methods

ppPrec :: Int -> Ident -> Doc Source #

type Rep Ident Source # 

type ModName = Text Source #

Module names are just text.

data PName Source #

Names that originate in the parser.

Constructors

UnQual !Ident

Unqualified names like x, Foo, or +.

Qual !ModName !Ident

Qualified names like Foo::bar or module::!.

NewName !Pass !Int

Fresh names generated by a pass.

Instances

Eq PName Source # 

Methods

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

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

Ord PName Source # 

Methods

compare :: PName -> PName -> Ordering #

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

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

(>) :: PName -> PName -> Bool #

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

max :: PName -> PName -> PName #

min :: PName -> PName -> PName #

Show PName Source # 

Methods

showsPrec :: Int -> PName -> ShowS #

show :: PName -> String #

showList :: [PName] -> ShowS #

Generic PName Source # 

Associated Types

type Rep PName :: * -> * #

Methods

from :: PName -> Rep PName x #

to :: Rep PName x -> PName #

NFData PName Source # 

Methods

rnf :: PName -> () #

PPName PName Source # 
PP PName Source # 

Methods

ppPrec :: Int -> PName -> Doc Source #

RemovePatterns [Decl PName] Source # 
RemovePatterns (Expr PName) Source # 
RemovePatterns (Module PName) Source # 
RemovePatterns (Program PName) Source # 
BindsNames (TParam PName) Source #

Generate the naming environment for a type parameter.

BindsNames (Schema PName) Source #

Generate a type renaming environment from the parameters that are bound by this schema.

BindsNames (Module PName) Source #

The naming environment for a single module. This is the mapping from unqualified names to fully qualified names with uniques.

BindsNames (InModule (Newtype PName)) Source # 
BindsNames (InModule (Bind PName)) Source #

Introduce the name

BindsNames (InModule (Decl PName)) Source #

The naming environment for a single declaration.

BindsNames (InModule (TopDecl PName)) Source # 
type Rep PName Source # 

data Named a Source #

Constructors

Named 

Fields

Instances

Functor Named Source # 

Methods

fmap :: (a -> b) -> Named a -> Named b #

(<$) :: a -> Named b -> Named a #

Foldable Named Source # 

Methods

fold :: Monoid m => Named m -> m #

foldMap :: Monoid m => (a -> m) -> Named a -> m #

foldr :: (a -> b -> b) -> b -> Named a -> b #

foldr' :: (a -> b -> b) -> b -> Named a -> b #

foldl :: (b -> a -> b) -> b -> Named a -> b #

foldl' :: (b -> a -> b) -> b -> Named a -> b #

foldr1 :: (a -> a -> a) -> Named a -> a #

foldl1 :: (a -> a -> a) -> Named a -> a #

toList :: Named a -> [a] #

null :: Named a -> Bool #

length :: Named a -> Int #

elem :: Eq a => a -> Named a -> Bool #

maximum :: Ord a => Named a -> a #

minimum :: Ord a => Named a -> a #

sum :: Num a => Named a -> a #

product :: Num a => Named a -> a #

Traversable Named Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Named a -> f (Named b) #

sequenceA :: Applicative f => Named (f a) -> f (Named a) #

mapM :: Monad m => (a -> m b) -> Named a -> m (Named b) #

sequence :: Monad m => Named (m a) -> m (Named a) #

Eq a => Eq (Named a) Source # 

Methods

(==) :: Named a -> Named a -> Bool #

(/=) :: Named a -> Named a -> Bool #

Show a => Show (Named a) Source # 

Methods

showsPrec :: Int -> Named a -> ShowS #

show :: Named a -> String #

showList :: [Named a] -> ShowS #

Generic (Named a) Source # 

Associated Types

type Rep (Named a) :: * -> * #

Methods

from :: Named a -> Rep (Named a) x #

to :: Rep (Named a) x -> Named a #

NFData a => NFData (Named a) Source # 

Methods

rnf :: Named a -> () #

HasLoc a => HasLoc (Named a) Source # 

Methods

getLoc :: Named a -> Maybe Range Source #

NoPos t => NoPos (Named t) Source # 

Methods

noPos :: Named t -> Named t Source #

type Rep (Named a) Source # 
type Rep (Named a) = D1 (MetaData "Named" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "Named" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "name") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located Ident))) (S1 (MetaSel (Just Symbol "value") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))

data Pass Source #

Passes that can generate fresh names.

Constructors

NoPat 
MonoValues 

Instances

Eq Pass Source # 

Methods

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

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

Ord Pass Source # 

Methods

compare :: Pass -> Pass -> Ordering #

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

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

(>) :: Pass -> Pass -> Bool #

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

max :: Pass -> Pass -> Pass #

min :: Pass -> Pass -> Pass #

Show Pass Source # 

Methods

showsPrec :: Int -> Pass -> ShowS #

show :: Pass -> String #

showList :: [Pass] -> ShowS #

Generic Pass Source # 

Associated Types

type Rep Pass :: * -> * #

Methods

from :: Pass -> Rep Pass x #

to :: Rep Pass x -> Pass #

NFData Pass Source # 

Methods

rnf :: Pass -> () #

type Rep Pass Source # 
type Rep Pass = D1 (MetaData "Pass" "Cryptol.Parser.Name" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "NoPat" PrefixI False) U1) (C1 (MetaCons "MonoValues" PrefixI False) U1))

data Assoc Source #

Information about associativity.

Constructors

LeftAssoc 
RightAssoc 
NonAssoc 

Instances

Eq Assoc Source # 

Methods

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

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

Show Assoc Source # 

Methods

showsPrec :: Int -> Assoc -> ShowS #

show :: Assoc -> String #

showList :: [Assoc] -> ShowS #

Generic Assoc Source # 

Associated Types

type Rep Assoc :: * -> * #

Methods

from :: Assoc -> Rep Assoc x #

to :: Rep Assoc x -> Assoc #

NFData Assoc Source # 

Methods

rnf :: Assoc -> () #

type Rep Assoc Source # 
type Rep Assoc = D1 (MetaData "Assoc" "Cryptol.Utils.PP" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "LeftAssoc" PrefixI False) U1) ((:+:) (C1 (MetaCons "RightAssoc" PrefixI False) U1) (C1 (MetaCons "NonAssoc" PrefixI False) U1)))

Types

data Schema n Source #

Constructors

Forall [TParam n] [Prop n] (Type n) (Maybe Range) 

Instances

Rename Schema Source #

Rename a schema, assuming that none of its type variables are already in scope.

Eq n => Eq (Schema n) Source # 

Methods

(==) :: Schema n -> Schema n -> Bool #

(/=) :: Schema n -> Schema n -> Bool #

Show n => Show (Schema n) Source # 

Methods

showsPrec :: Int -> Schema n -> ShowS #

show :: Schema n -> String #

showList :: [Schema n] -> ShowS #

Generic (Schema n) Source # 

Associated Types

type Rep (Schema n) :: * -> * #

Methods

from :: Schema n -> Rep (Schema n) x #

to :: Rep (Schema n) x -> Schema n #

NFData n => NFData (Schema n) Source # 

Methods

rnf :: Schema n -> () #

PPName name => PP (Schema name) Source # 

Methods

ppPrec :: Int -> Schema name -> Doc Source #

AddLoc (Schema name) Source # 

Methods

addLoc :: Schema name -> Range -> Schema name Source #

dropLoc :: Schema name -> Schema name Source #

HasLoc (Schema name) Source # 

Methods

getLoc :: Schema name -> Maybe Range Source #

NoPos (Schema name) Source # 

Methods

noPos :: Schema name -> Schema name Source #

BindsNames (Schema PName) Source #

Generate a type renaming environment from the parameters that are bound by this schema.

type Rep (Schema n) Source # 

data TParam n Source #

Constructors

TParam 

Fields

Instances

Rename TParam Source # 
Eq n => Eq (TParam n) Source # 

Methods

(==) :: TParam n -> TParam n -> Bool #

(/=) :: TParam n -> TParam n -> Bool #

Show n => Show (TParam n) Source # 

Methods

showsPrec :: Int -> TParam n -> ShowS #

show :: TParam n -> String #

showList :: [TParam n] -> ShowS #

Generic (TParam n) Source # 

Associated Types

type Rep (TParam n) :: * -> * #

Methods

from :: TParam n -> Rep (TParam n) x #

to :: Rep (TParam n) x -> TParam n #

NFData n => NFData (TParam n) Source # 

Methods

rnf :: TParam n -> () #

PPName name => PP (TParam name) Source # 

Methods

ppPrec :: Int -> TParam name -> Doc Source #

AddLoc (TParam name) Source # 

Methods

addLoc :: TParam name -> Range -> TParam name Source #

dropLoc :: TParam name -> TParam name Source #

HasLoc (TParam name) Source # 

Methods

getLoc :: TParam name -> Maybe Range Source #

NoPos (TParam name) Source # 

Methods

noPos :: TParam name -> TParam name Source #

BindsNames (TParam PName) Source #

Generate the naming environment for a type parameter.

type Rep (TParam n) Source # 
type Rep (TParam n) = D1 (MetaData "TParam" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "TParam" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "tpName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 n)) ((:*:) (S1 (MetaSel (Just Symbol "tpKind") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Kind))) (S1 (MetaSel (Just Symbol "tpRange") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Range))))))

data Kind Source #

Constructors

KNum 
KType 

Instances

Eq Kind Source # 

Methods

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

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

Show Kind Source # 

Methods

showsPrec :: Int -> Kind -> ShowS #

show :: Kind -> String #

showList :: [Kind] -> ShowS #

Generic Kind Source # 

Associated Types

type Rep Kind :: * -> * #

Methods

from :: Kind -> Rep Kind x #

to :: Rep Kind x -> Kind #

NFData Kind Source # 

Methods

rnf :: Kind -> () #

PP Kind Source # 

Methods

ppPrec :: Int -> Kind -> Doc Source #

type Rep Kind Source # 
type Rep Kind = D1 (MetaData "Kind" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "KNum" PrefixI False) U1) (C1 (MetaCons "KType" PrefixI False) U1))

data Type n Source #

Constructors

TFun (Type n) (Type n)
[8] -> [8]
TSeq (Type n) (Type n)
[8] a
TBit
Bit
TNum Integer
10
TChar Char
a
TInf
inf
TUser n [Type n]

A type variable or synonym

TApp TFun [Type n]
2 + x
TRecord [Named (Type n)]
{ x : [8], y : [32] }
TTuple [Type n]
([8], [32])
TWild

_, just some type.

TLocated (Type n) Range

Location information

TParens (Type n)
 (ty)
TInfix (Type n) (Located n) Fixity (Type n)
 ty + ty

Instances

Rename Type Source #

Resolve fixity, then rename the resulting type.

Eq n => Eq (Type n) Source # 

Methods

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

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

Show n => Show (Type n) Source # 

Methods

showsPrec :: Int -> Type n -> ShowS #

show :: Type n -> String #

showList :: [Type n] -> ShowS #

Generic (Type n) Source # 

Associated Types

type Rep (Type n) :: * -> * #

Methods

from :: Type n -> Rep (Type n) x #

to :: Rep (Type n) x -> Type n #

NFData n => NFData (Type n) Source # 

Methods

rnf :: Type n -> () #

PPName name => PP (Type name) Source # 

Methods

ppPrec :: Int -> Type name -> Doc Source #

AddLoc (Type name) Source # 

Methods

addLoc :: Type name -> Range -> Type name Source #

dropLoc :: Type name -> Type name Source #

HasLoc (Type name) Source # 

Methods

getLoc :: Type name -> Maybe Range Source #

NoPos (Type name) Source # 

Methods

noPos :: Type name -> Type name Source #

type Rep (Type n) Source # 
type Rep (Type n) = D1 (MetaData "Type" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "TFun" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))) ((:+:) (C1 (MetaCons "TSeq" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))) (C1 (MetaCons "TBit" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "TNum" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer))) (C1 (MetaCons "TChar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char)))) ((:+:) (C1 (MetaCons "TInf" PrefixI False) U1) (C1 (MetaCons "TUser" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 n)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Type n]))))))) ((:+:) ((:+:) (C1 (MetaCons "TApp" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TFun)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Type n])))) ((:+:) (C1 (MetaCons "TRecord" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Named (Type n)]))) (C1 (MetaCons "TTuple" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Type n]))))) ((:+:) ((:+:) (C1 (MetaCons "TWild" PrefixI False) U1) (C1 (MetaCons "TLocated" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Range))))) ((:+:) (C1 (MetaCons "TParens" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))) (C1 (MetaCons "TInfix" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located n)))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Fixity)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))))))))

data Prop n Source #

Constructors

CFin (Type n)
 fin x
CEqual (Type n) (Type n)
 x == 10
CGeq (Type n) (Type n)
 x >= 10
CArith (Type n)
 Arith a
CCmp (Type n)
 Cmp a
CLocated (Prop n) Range

Location information

CType (Type n)

After parsing

Instances

Rename Prop Source # 
Eq n => Eq (Prop n) Source # 

Methods

(==) :: Prop n -> Prop n -> Bool #

(/=) :: Prop n -> Prop n -> Bool #

Show n => Show (Prop n) Source # 

Methods

showsPrec :: Int -> Prop n -> ShowS #

show :: Prop n -> String #

showList :: [Prop n] -> ShowS #

Generic (Prop n) Source # 

Associated Types

type Rep (Prop n) :: * -> * #

Methods

from :: Prop n -> Rep (Prop n) x #

to :: Rep (Prop n) x -> Prop n #

NFData n => NFData (Prop n) Source # 

Methods

rnf :: Prop n -> () #

PPName name => PP (Prop name) Source # 

Methods

ppPrec :: Int -> Prop name -> Doc Source #

AddLoc (Prop name) Source # 

Methods

addLoc :: Prop name -> Range -> Prop name Source #

dropLoc :: Prop name -> Prop name Source #

HasLoc (Prop name) Source # 

Methods

getLoc :: Prop name -> Maybe Range Source #

NoPos (Prop name) Source # 

Methods

noPos :: Prop name -> Prop name Source #

type Rep (Prop n) Source # 

Declarations

data Module name Source #

Constructors

Module 

Instances

Show name => Show (Module name) Source # 

Methods

showsPrec :: Int -> Module name -> ShowS #

show :: Module name -> String #

showList :: [Module name] -> ShowS #

Generic (Module name) Source # 

Associated Types

type Rep (Module name) :: * -> * #

Methods

from :: Module name -> Rep (Module name) x #

to :: Rep (Module name) x -> Module name #

NFData name => NFData (Module name) Source # 

Methods

rnf :: Module name -> () #

(Show name, PPName name) => PP (Module name) Source # 

Methods

ppPrec :: Int -> Module name -> Doc Source #

HasLoc (Module name) Source # 

Methods

getLoc :: Module name -> Maybe Range Source #

NoPos (Module name) Source # 

Methods

noPos :: Module name -> Module name Source #

RemovePatterns (Module PName) Source # 
BindsNames (Module PName) Source #

The naming environment for a single module. This is the mapping from unqualified names to fully qualified names with uniques.

type Rep (Module name) Source # 

newtype Program name Source #

Constructors

Program [TopDecl name] 

Instances

Show name => Show (Program name) Source # 

Methods

showsPrec :: Int -> Program name -> ShowS #

show :: Program name -> String #

showList :: [Program name] -> ShowS #

(Show name, PPName name) => PP (Program name) Source # 

Methods

ppPrec :: Int -> Program name -> Doc Source #

NoPos (Program name) Source # 

Methods

noPos :: Program name -> Program name Source #

RemovePatterns (Program PName) Source # 

data TopDecl name Source #

Constructors

Decl (TopLevel (Decl name)) 
TDNewtype (TopLevel (Newtype name)) 
Include (Located FilePath) 

Instances

Rename TopDecl Source # 
Show name => Show (TopDecl name) Source # 

Methods

showsPrec :: Int -> TopDecl name -> ShowS #

show :: TopDecl name -> String #

showList :: [TopDecl name] -> ShowS #

Generic (TopDecl name) Source # 

Associated Types

type Rep (TopDecl name) :: * -> * #

Methods

from :: TopDecl name -> Rep (TopDecl name) x #

to :: Rep (TopDecl name) x -> TopDecl name #

NFData name => NFData (TopDecl name) Source # 

Methods

rnf :: TopDecl name -> () #

(Show name, PPName name) => PP (TopDecl name) Source # 

Methods

ppPrec :: Int -> TopDecl name -> Doc Source #

HasLoc (TopDecl name) Source # 

Methods

getLoc :: TopDecl name -> Maybe Range Source #

NoPos (TopDecl name) Source # 

Methods

noPos :: TopDecl name -> TopDecl name Source #

FromDecl (TopDecl Name) Source # 
BindsNames (InModule (TopDecl PName)) Source # 
type Rep (TopDecl name) Source # 

data Decl name Source #

Constructors

DSignature [Located name] (Schema name) 
DFixity !Fixity [Located name] 
DPragma [Located name] Pragma 
DBind (Bind name) 
DPatBind (Pattern name) (Expr name) 
DType (TySyn name) 
DLocated (Decl name) Range 

Instances

Rename Decl Source # 
Eq name => Eq (Decl name) Source # 

Methods

(==) :: Decl name -> Decl name -> Bool #

(/=) :: Decl name -> Decl name -> Bool #

Show name => Show (Decl name) Source # 

Methods

showsPrec :: Int -> Decl name -> ShowS #

show :: Decl name -> String #

showList :: [Decl name] -> ShowS #

Generic (Decl name) Source # 

Associated Types

type Rep (Decl name) :: * -> * #

Methods

from :: Decl name -> Rep (Decl name) x #

to :: Rep (Decl name) x -> Decl name #

NFData name => NFData (Decl name) Source # 

Methods

rnf :: Decl name -> () #

(Show name, PPName name) => PP (Decl name) Source # 

Methods

ppPrec :: Int -> Decl name -> Doc Source #

AddLoc (Decl name) Source # 

Methods

addLoc :: Decl name -> Range -> Decl name Source #

dropLoc :: Decl name -> Decl name Source #

HasLoc (Decl name) Source # 

Methods

getLoc :: Decl name -> Maybe Range Source #

NoPos (Decl name) Source # 

Methods

noPos :: Decl name -> Decl name Source #

RemovePatterns [Decl PName] Source # 
FromDecl (Decl Name) Source # 
BindsNames (InModule (Decl PName)) Source #

The naming environment for a single declaration.

type Rep (Decl name) Source # 
type Rep (Decl name) = D1 (MetaData "Decl" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) ((:+:) (C1 (MetaCons "DSignature" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Located name])) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Schema name))))) ((:+:) (C1 (MetaCons "DFixity" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Fixity)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Located name])))) (C1 (MetaCons "DPragma" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Located name])) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Pragma)))))) ((:+:) ((:+:) (C1 (MetaCons "DBind" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Bind name)))) (C1 (MetaCons "DPatBind" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern name))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr name)))))) ((:+:) (C1 (MetaCons "DType" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (TySyn name)))) (C1 (MetaCons "DLocated" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Decl name))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Range)))))))

data Fixity Source #

Constructors

Fixity 

Fields

Instances

Eq Fixity Source # 

Methods

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

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

Show Fixity Source # 
Generic Fixity Source # 

Associated Types

type Rep Fixity :: * -> * #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

NFData Fixity Source # 

Methods

rnf :: Fixity -> () #

type Rep Fixity Source # 
type Rep Fixity = D1 (MetaData "Fixity" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "Fixity" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "fAssoc") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Assoc)) (S1 (MetaSel (Just Symbol "fLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

defaultFixity :: Fixity Source #

The fixity used when none is provided.

data TySyn n Source #

Constructors

TySyn (Located n) [TParam n] (Type n) 

Instances

Rename TySyn Source # 
Eq n => Eq (TySyn n) Source # 

Methods

(==) :: TySyn n -> TySyn n -> Bool #

(/=) :: TySyn n -> TySyn n -> Bool #

Show n => Show (TySyn n) Source # 

Methods

showsPrec :: Int -> TySyn n -> ShowS #

show :: TySyn n -> String #

showList :: [TySyn n] -> ShowS #

Generic (TySyn n) Source # 

Associated Types

type Rep (TySyn n) :: * -> * #

Methods

from :: TySyn n -> Rep (TySyn n) x #

to :: Rep (TySyn n) x -> TySyn n #

NFData n => NFData (TySyn n) Source # 

Methods

rnf :: TySyn n -> () #

PPName name => PP (TySyn name) Source # 

Methods

ppPrec :: Int -> TySyn name -> Doc Source #

NoPos (TySyn name) Source # 

Methods

noPos :: TySyn name -> TySyn name Source #

type Rep (TySyn n) Source # 

data Bind name Source #

Bindings. Notes:

  • The parser does not associate type signatures and pragmas with their bindings: this is done in a separate pass, after de-sugaring pattern bindings. In this way we can associate pragmas and type signatures with the variables defined by pattern bindings as well.
  • Currently, there is no surface syntax for defining monomorphic bindings (i.e., bindings that will not be automatically generalized by the type checker. However, they are useful when de-sugaring patterns.

Constructors

Bind 

Fields

Instances

Rename Bind Source #

Rename a binding.

Eq name => Eq (Bind name) Source # 

Methods

(==) :: Bind name -> Bind name -> Bool #

(/=) :: Bind name -> Bind name -> Bool #

Show name => Show (Bind name) Source # 

Methods

showsPrec :: Int -> Bind name -> ShowS #

show :: Bind name -> String #

showList :: [Bind name] -> ShowS #

Generic (Bind name) Source # 

Associated Types

type Rep (Bind name) :: * -> * #

Methods

from :: Bind name -> Rep (Bind name) x #

to :: Rep (Bind name) x -> Bind name #

NFData name => NFData (Bind name) Source # 

Methods

rnf :: Bind name -> () #

(Show name, PPName name) => PP (Bind name) Source # 

Methods

ppPrec :: Int -> Bind name -> Doc Source #

HasLoc (Bind name) Source # 

Methods

getLoc :: Bind name -> Maybe Range Source #

NoPos (Bind name) Source # 

Methods

noPos :: Bind name -> Bind name Source #

BindsNames (InModule (Bind PName)) Source #

Introduce the name

type Rep (Bind name) Source # 

data BindDef name Source #

Constructors

DPrim 
DExpr (Expr name) 

Instances

Rename BindDef Source # 
Eq name => Eq (BindDef name) Source # 

Methods

(==) :: BindDef name -> BindDef name -> Bool #

(/=) :: BindDef name -> BindDef name -> Bool #

Show name => Show (BindDef name) Source # 

Methods

showsPrec :: Int -> BindDef name -> ShowS #

show :: BindDef name -> String #

showList :: [BindDef name] -> ShowS #

Generic (BindDef name) Source # 

Associated Types

type Rep (BindDef name) :: * -> * #

Methods

from :: BindDef name -> Rep (BindDef name) x #

to :: Rep (BindDef name) x -> BindDef name #

NFData name => NFData (BindDef name) Source # 

Methods

rnf :: BindDef name -> () #

(Show name, PPName name) => PP (BindDef name) Source # 

Methods

ppPrec :: Int -> BindDef name -> Doc Source #

type Rep (BindDef name) Source # 
type Rep (BindDef name) = D1 (MetaData "BindDef" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "DPrim" PrefixI False) U1) (C1 (MetaCons "DExpr" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr name)))))

data Pragma Source #

Instances

Eq Pragma Source # 

Methods

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

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

Show Pragma Source # 
Generic Pragma Source # 

Associated Types

type Rep Pragma :: * -> * #

Methods

from :: Pragma -> Rep Pragma x #

to :: Rep Pragma x -> Pragma #

NFData Pragma Source # 

Methods

rnf :: Pragma -> () #

PP Pragma Source # 

Methods

ppPrec :: Int -> Pragma -> Doc Source #

NoPos Pragma Source # 

Methods

noPos :: Pragma -> Pragma Source #

type Rep Pragma Source # 
type Rep Pragma = D1 (MetaData "Pragma" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "PragmaNote" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))) (C1 (MetaCons "PragmaProperty" PrefixI False) U1))

data ExportType Source #

Export information for a declaration.

Constructors

Public 
Private 

data ExportSpec name Source #

Constructors

ExportSpec 

Fields

Instances

Show name => Show (ExportSpec name) Source # 

Methods

showsPrec :: Int -> ExportSpec name -> ShowS #

show :: ExportSpec name -> String #

showList :: [ExportSpec name] -> ShowS #

Generic (ExportSpec name) Source # 

Associated Types

type Rep (ExportSpec name) :: * -> * #

Methods

from :: ExportSpec name -> Rep (ExportSpec name) x #

to :: Rep (ExportSpec name) x -> ExportSpec name #

Ord name => Monoid (ExportSpec name) Source # 

Methods

mempty :: ExportSpec name #

mappend :: ExportSpec name -> ExportSpec name -> ExportSpec name #

mconcat :: [ExportSpec name] -> ExportSpec name #

NFData name => NFData (ExportSpec name) Source # 

Methods

rnf :: ExportSpec name -> () #

type Rep (ExportSpec name) Source # 
type Rep (ExportSpec name) = D1 (MetaData "ExportSpec" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "ExportSpec" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "eTypes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set name))) (S1 (MetaSel (Just Symbol "eBinds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set name)))))

exportBind :: Ord name => TopLevel name -> ExportSpec name Source #

Add a binding name to the export list, if it should be exported.

exportType :: Ord name => TopLevel name -> ExportSpec name Source #

Add a type synonym name to the export list, if it should be exported.

isExportedBind :: Ord name => name -> ExportSpec name -> Bool Source #

Check to see if a binding is exported.

isExportedType :: Ord name => name -> ExportSpec name -> Bool Source #

Check to see if a type synonym is exported.

data TopLevel a Source #

Constructors

TopLevel 

Instances

Functor TopLevel Source # 

Methods

fmap :: (a -> b) -> TopLevel a -> TopLevel b #

(<$) :: a -> TopLevel b -> TopLevel a #

Foldable TopLevel Source # 

Methods

fold :: Monoid m => TopLevel m -> m #

foldMap :: Monoid m => (a -> m) -> TopLevel a -> m #

foldr :: (a -> b -> b) -> b -> TopLevel a -> b #

foldr' :: (a -> b -> b) -> b -> TopLevel a -> b #

foldl :: (b -> a -> b) -> b -> TopLevel a -> b #

foldl' :: (b -> a -> b) -> b -> TopLevel a -> b #

foldr1 :: (a -> a -> a) -> TopLevel a -> a #

foldl1 :: (a -> a -> a) -> TopLevel a -> a #

toList :: TopLevel a -> [a] #

null :: TopLevel a -> Bool #

length :: TopLevel a -> Int #

elem :: Eq a => a -> TopLevel a -> Bool #

maximum :: Ord a => TopLevel a -> a #

minimum :: Ord a => TopLevel a -> a #

sum :: Num a => TopLevel a -> a #

product :: Num a => TopLevel a -> a #

Traversable TopLevel Source # 

Methods

traverse :: Applicative f => (a -> f b) -> TopLevel a -> f (TopLevel b) #

sequenceA :: Applicative f => TopLevel (f a) -> f (TopLevel a) #

mapM :: Monad m => (a -> m b) -> TopLevel a -> m (TopLevel b) #

sequence :: Monad m => TopLevel (m a) -> m (TopLevel a) #

Show a => Show (TopLevel a) Source # 

Methods

showsPrec :: Int -> TopLevel a -> ShowS #

show :: TopLevel a -> String #

showList :: [TopLevel a] -> ShowS #

Generic (TopLevel a) Source # 

Associated Types

type Rep (TopLevel a) :: * -> * #

Methods

from :: TopLevel a -> Rep (TopLevel a) x #

to :: Rep (TopLevel a) x -> TopLevel a #

NFData a => NFData (TopLevel a) Source # 

Methods

rnf :: TopLevel a -> () #

PP a => PP (TopLevel a) Source # 

Methods

ppPrec :: Int -> TopLevel a -> Doc Source #

HasLoc a => HasLoc (TopLevel a) Source # 
NoPos a => NoPos (TopLevel a) Source # 

Methods

noPos :: TopLevel a -> TopLevel a Source #

type Rep (TopLevel a) Source # 

data Import Source #

An import declaration.

Constructors

Import 

Instances

Eq Import Source # 

Methods

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

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

Show Import Source # 
Generic Import Source # 

Associated Types

type Rep Import :: * -> * #

Methods

from :: Import -> Rep Import x #

to :: Rep Import x -> Import #

NFData Import Source # 

Methods

rnf :: Import -> () #

PP Import Source # 

Methods

ppPrec :: Int -> Import -> Doc Source #

type Rep Import Source # 

data ImportSpec Source #

The list of names following an import.

INVARIANT: All of the Name entries in the list are expected to be unqualified names; the QName or NewName constructors should not be present.

Constructors

Hiding [Ident] 
Only [Ident] 

data Newtype name Source #

Constructors

Newtype 

Fields

Instances

Rename Newtype Source # 
Eq name => Eq (Newtype name) Source # 

Methods

(==) :: Newtype name -> Newtype name -> Bool #

(/=) :: Newtype name -> Newtype name -> Bool #

Show name => Show (Newtype name) Source # 

Methods

showsPrec :: Int -> Newtype name -> ShowS #

show :: Newtype name -> String #

showList :: [Newtype name] -> ShowS #

Generic (Newtype name) Source # 

Associated Types

type Rep (Newtype name) :: * -> * #

Methods

from :: Newtype name -> Rep (Newtype name) x #

to :: Rep (Newtype name) x -> Newtype name #

NFData name => NFData (Newtype name) Source # 

Methods

rnf :: Newtype name -> () #

PPName name => PP (Newtype name) Source # 

Methods

ppPrec :: Int -> Newtype name -> Doc Source #

HasLoc (Newtype name) Source # 

Methods

getLoc :: Newtype name -> Maybe Range Source #

NoPos (Newtype name) Source # 

Methods

noPos :: Newtype name -> Newtype name Source #

BindsNames (InModule (Newtype PName)) Source # 
type Rep (Newtype name) Source # 
type Rep (Newtype name) = D1 (MetaData "Newtype" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "Newtype" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "nName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located name))) ((:*:) (S1 (MetaSel (Just Symbol "nParams") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TParam name])) (S1 (MetaSel (Just Symbol "nBody") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Named (Type name)])))))

Interactive

data ReplInput name Source #

Input at the REPL, which can either be an expression or a let statement.

Constructors

ExprInput (Expr name) 
LetInput (Decl name) 

Instances

Eq name => Eq (ReplInput name) Source # 

Methods

(==) :: ReplInput name -> ReplInput name -> Bool #

(/=) :: ReplInput name -> ReplInput name -> Bool #

Show name => Show (ReplInput name) Source # 

Methods

showsPrec :: Int -> ReplInput name -> ShowS #

show :: ReplInput name -> String #

showList :: [ReplInput name] -> ShowS #

Expressions

data Expr n Source #

Constructors

EVar n
 x
ELit Literal
 0x10
ETuple [Expr n]
 (1,2,3)
ERecord [Named (Expr n)]
 { x = 1, y = 2 }
ESel (Expr n) Selector
 e.l
EList [Expr n]
 [1,2,3]
EFromTo (Type n) (Maybe (Type n)) (Maybe (Type n))
[1, 5 ..  117 ]
EInfFrom (Expr n) (Maybe (Expr n))
 [1, 3 ...]
EComp (Expr n) [[Match n]]
 [ 1 | x <- xs ]
EApp (Expr n) (Expr n)
 f x
EAppT (Expr n) [TypeInst n]
 f `{x = 8}, f`{8}
EIf (Expr n) (Expr n) (Expr n)
 if ok then e1 else e2
EWhere (Expr n) [Decl n]
 1 + x where { x = 2 }
ETyped (Expr n) (Type n)
 1 : [8]
ETypeVal (Type n)

`(x + 1), x is a type

EFun [Pattern n] (Expr n)
 \x y -> x
ELocated (Expr n) Range

position annotation

EParens (Expr n)

(e) (Removed by Fixity)

EInfix (Expr n) (Located n) Fixity (Expr n)

a + b (Removed by Fixity)

Instances

Rename Expr Source # 
Eq n => Eq (Expr n) Source # 

Methods

(==) :: Expr n -> Expr n -> Bool #

(/=) :: Expr n -> Expr n -> Bool #

Show n => Show (Expr n) Source # 

Methods

showsPrec :: Int -> Expr n -> ShowS #

show :: Expr n -> String #

showList :: [Expr n] -> ShowS #

Generic (Expr n) Source # 

Associated Types

type Rep (Expr n) :: * -> * #

Methods

from :: Expr n -> Rep (Expr n) x #

to :: Rep (Expr n) x -> Expr n #

NFData n => NFData (Expr n) Source # 

Methods

rnf :: Expr n -> () #

(Show name, PPName name) => PP (Expr name) Source # 

Methods

ppPrec :: Int -> Expr name -> Doc Source #

AddLoc (Expr n) Source # 

Methods

addLoc :: Expr n -> Range -> Expr n Source #

dropLoc :: Expr n -> Expr n Source #

HasLoc (Expr name) Source # 

Methods

getLoc :: Expr name -> Maybe Range Source #

NoPos (Expr name) Source # 

Methods

noPos :: Expr name -> Expr name Source #

RemovePatterns (Expr PName) Source # 
type Rep (Expr n) Source # 
type Rep (Expr n) = D1 (MetaData "Expr" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "EVar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 n))) (C1 (MetaCons "ELit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Literal)))) ((:+:) (C1 (MetaCons "ETuple" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Expr n]))) (C1 (MetaCons "ERecord" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Named (Expr n)]))))) ((:+:) ((:+:) (C1 (MetaCons "ESel" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Selector)))) (C1 (MetaCons "EList" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Expr n])))) ((:+:) (C1 (MetaCons "EFromTo" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Type n)))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Type n))))))) ((:+:) (C1 (MetaCons "EInfFrom" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Expr n)))))) (C1 (MetaCons "EComp" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [[Match n]])))))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "EApp" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))))) (C1 (MetaCons "EAppT" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TypeInst n]))))) ((:+:) (C1 (MetaCons "EIf" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n)))))) ((:+:) (C1 (MetaCons "EWhere" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Decl n])))) (C1 (MetaCons "ETyped" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))))))) ((:+:) ((:+:) (C1 (MetaCons "ETypeVal" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))) (C1 (MetaCons "EFun" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pattern n])) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n)))))) ((:+:) (C1 (MetaCons "ELocated" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Range)))) ((:+:) (C1 (MetaCons "EParens" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n)))) (C1 (MetaCons "EInfix" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located n)))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Fixity)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr n)))))))))))

data NumInfo Source #

Infromation about the representation of a numeric constant.

Constructors

BinLit Int

n-digit binary literal

OctLit Int

n-digit octal literal

DecLit

overloaded decimal literal

HexLit Int

n-digit hex literal

CharLit

character literal

PolyLit Int

polynomial literal

data Match name Source #

Constructors

Match (Pattern name) (Expr name)

p <- e

MatchLet (Bind name) 

Instances

Rename Match Source # 
Eq name => Eq (Match name) Source # 

Methods

(==) :: Match name -> Match name -> Bool #

(/=) :: Match name -> Match name -> Bool #

Show name => Show (Match name) Source # 

Methods

showsPrec :: Int -> Match name -> ShowS #

show :: Match name -> String #

showList :: [Match name] -> ShowS #

Generic (Match name) Source # 

Associated Types

type Rep (Match name) :: * -> * #

Methods

from :: Match name -> Rep (Match name) x #

to :: Rep (Match name) x -> Match name #

NFData name => NFData (Match name) Source # 

Methods

rnf :: Match name -> () #

(Show name, PPName name) => PP (Match name) Source # 

Methods

ppPrec :: Int -> Match name -> Doc Source #

HasLoc (Match name) Source # 

Methods

getLoc :: Match name -> Maybe Range Source #

NoPos (Match name) Source # 

Methods

noPos :: Match name -> Match name Source #

type Rep (Match name) Source # 

data Pattern n Source #

Constructors

PVar (Located n)
 x
PWild
 _
PTuple [Pattern n]
 (x,y,z)
PRecord [Named (Pattern n)]
 { x = (a,b,c), y = z }
PList [Pattern n]
 [ x, y, z ]
PTyped (Pattern n) (Type n)
 x : [8]
PSplit (Pattern n) (Pattern n)
 (x # y)
PLocated (Pattern n) Range

Location information

Instances

Rename Pattern Source # 
Eq n => Eq (Pattern n) Source # 

Methods

(==) :: Pattern n -> Pattern n -> Bool #

(/=) :: Pattern n -> Pattern n -> Bool #

Show n => Show (Pattern n) Source # 

Methods

showsPrec :: Int -> Pattern n -> ShowS #

show :: Pattern n -> String #

showList :: [Pattern n] -> ShowS #

Generic (Pattern n) Source # 

Associated Types

type Rep (Pattern n) :: * -> * #

Methods

from :: Pattern n -> Rep (Pattern n) x #

to :: Rep (Pattern n) x -> Pattern n #

NFData n => NFData (Pattern n) Source # 

Methods

rnf :: Pattern n -> () #

PPName name => PP (Pattern name) Source # 

Methods

ppPrec :: Int -> Pattern name -> Doc Source #

AddLoc (Pattern name) Source # 

Methods

addLoc :: Pattern name -> Range -> Pattern name Source #

dropLoc :: Pattern name -> Pattern name Source #

HasLoc (Pattern name) Source # 

Methods

getLoc :: Pattern name -> Maybe Range Source #

NoPos (Pattern name) Source # 

Methods

noPos :: Pattern name -> Pattern name Source #

type Rep (Pattern n) Source # 
type Rep (Pattern n) = D1 (MetaData "Pattern" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "PVar" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located n)))) (C1 (MetaCons "PWild" PrefixI False) U1)) ((:+:) (C1 (MetaCons "PTuple" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pattern n]))) (C1 (MetaCons "PRecord" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Named (Pattern n)]))))) ((:+:) ((:+:) (C1 (MetaCons "PList" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pattern n]))) (C1 (MetaCons "PTyped" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))))) ((:+:) (C1 (MetaCons "PSplit" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern n))))) (C1 (MetaCons "PLocated" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Range)))))))

data Selector Source #

Selectors are used for projecting from various components. Each selector has an option spec to specify the shape of the thing that is being selected. Currently, there is no surface syntax for list selectors, but they are used during the desugaring of patterns.

Constructors

TupleSel Int (Maybe Int)

Zero-based tuple selection. Optionally specifies the shape of the tuple (one-based).

RecordSel Ident (Maybe [Ident])

Record selection. Optionally specifies the shape of the record.

ListSel Int (Maybe Int)

List selection. Optionally specifies the length of the list.

Instances

Eq Selector Source # 
Ord Selector Source # 
Show Selector Source # 
Generic Selector Source # 

Associated Types

type Rep Selector :: * -> * #

Methods

from :: Selector -> Rep Selector x #

to :: Rep Selector x -> Selector #

NFData Selector Source # 

Methods

rnf :: Selector -> () #

PP Selector Source # 

Methods

ppPrec :: Int -> Selector -> Doc Source #

type Rep Selector Source # 

data TypeInst name Source #

Constructors

NamedInst (Named (Type name)) 
PosInst (Type name) 

Instances

Rename TypeInst Source # 
Eq name => Eq (TypeInst name) Source # 

Methods

(==) :: TypeInst name -> TypeInst name -> Bool #

(/=) :: TypeInst name -> TypeInst name -> Bool #

Show name => Show (TypeInst name) Source # 

Methods

showsPrec :: Int -> TypeInst name -> ShowS #

show :: TypeInst name -> String #

showList :: [TypeInst name] -> ShowS #

Generic (TypeInst name) Source # 

Associated Types

type Rep (TypeInst name) :: * -> * #

Methods

from :: TypeInst name -> Rep (TypeInst name) x #

to :: Rep (TypeInst name) x -> TypeInst name #

NFData name => NFData (TypeInst name) Source # 

Methods

rnf :: TypeInst name -> () #

PPName name => PP (TypeInst name) Source # 

Methods

ppPrec :: Int -> TypeInst name -> Doc Source #

NoPos (TypeInst name) Source # 

Methods

noPos :: TypeInst name -> TypeInst name Source #

type Rep (TypeInst name) Source # 
type Rep (TypeInst name) = D1 (MetaData "TypeInst" "Cryptol.Parser.AST" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) ((:+:) (C1 (MetaCons "NamedInst" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Named (Type name))))) (C1 (MetaCons "PosInst" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type name)))))

Positions

data Located a Source #

Constructors

Located 

Fields

Instances

Functor Located Source # 

Methods

fmap :: (a -> b) -> Located a -> Located b #

(<$) :: a -> Located b -> Located a #

Eq a => Eq (Located a) Source # 

Methods

(==) :: Located a -> Located a -> Bool #

(/=) :: Located a -> Located a -> Bool #

Show a => Show (Located a) Source # 

Methods

showsPrec :: Int -> Located a -> ShowS #

show :: Located a -> String #

showList :: [Located a] -> ShowS #

Generic (Located a) Source # 

Associated Types

type Rep (Located a) :: * -> * #

Methods

from :: Located a -> Rep (Located a) x #

to :: Rep (Located a) x -> Located a #

NFData a => NFData (Located a) Source # 

Methods

rnf :: Located a -> () #

PPName a => PPName (Located a) Source # 
PP a => PP (Located a) Source # 

Methods

ppPrec :: Int -> Located a -> Doc Source #

AddLoc (Located a) Source # 
HasLoc (Located a) Source # 

Methods

getLoc :: Located a -> Maybe Range Source #

NoPos (Located t) Source # 

Methods

noPos :: Located t -> Located t Source #

type Rep (Located a) Source # 
type Rep (Located a) = D1 (MetaData "Located" "Cryptol.Parser.Position" "cryptol-2.5.0-62ntwDPh16AFY461fF3rK" False) (C1 (MetaCons "Located" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "srcRange") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Range)) (S1 (MetaSel (Just Symbol "thing") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))))

type LPName = Located PName Source #

A name with location information.

type LString = Located String Source #

A string with location information.

type LIdent = Located Ident Source #

An identifier with location information.

class NoPos t where Source #

Minimal complete definition

noPos

Methods

noPos :: t -> t Source #

Instances

NoPos Pragma Source # 

Methods

noPos :: Pragma -> Pragma Source #

NoPos t => NoPos [t] Source # 

Methods

noPos :: [t] -> [t] Source #

NoPos t => NoPos (Maybe t) Source # 

Methods

noPos :: Maybe t -> Maybe t Source #

NoPos (Located t) Source # 

Methods

noPos :: Located t -> Located t Source #

NoPos (Prop name) Source # 

Methods

noPos :: Prop name -> Prop name Source #

NoPos (Type name) Source # 

Methods

noPos :: Type name -> Type name Source #

NoPos (TParam name) Source # 

Methods

noPos :: TParam name -> TParam name Source #

NoPos (Schema name) Source # 

Methods

noPos :: Schema name -> Schema name Source #

NoPos t => NoPos (Named t) Source # 

Methods

noPos :: Named t -> Named t Source #

NoPos (Pattern name) Source # 

Methods

noPos :: Pattern name -> Pattern name Source #

NoPos (Match name) Source # 

Methods

noPos :: Match name -> Match name Source #

NoPos (TypeInst name) Source # 

Methods

noPos :: TypeInst name -> TypeInst name Source #

NoPos (Expr name) Source # 

Methods

noPos :: Expr name -> Expr name Source #

NoPos a => NoPos (TopLevel a) Source # 

Methods

noPos :: TopLevel a -> TopLevel a Source #

NoPos (Newtype name) Source # 

Methods

noPos :: Newtype name -> Newtype name Source #

NoPos (Bind name) Source # 

Methods

noPos :: Bind name -> Bind name Source #

NoPos (TySyn name) Source # 

Methods

noPos :: TySyn name -> TySyn name Source #

NoPos (Decl name) Source # 

Methods

noPos :: Decl name -> Decl name Source #

NoPos (TopDecl name) Source # 

Methods

noPos :: TopDecl name -> TopDecl name Source #

NoPos (Module name) Source # 

Methods

noPos :: Module name -> Module name Source #

NoPos (Program name) Source # 

Methods

noPos :: Program name -> Program name Source #

Pretty-printing

cppKind :: Kind -> Doc Source #

Conversational printing of kinds (e.g., to use in error messages)

ppSelector :: Selector -> Doc Source #

Display the thing selected by the selector, nicely.