cryptol-2.4.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.Parser.AST

Contents

- Names
- Types
- Declarations
- Interactive
- Expressions
- Positions
- Pretty-printing

Description

Synopsis

- data Ident
- mkIdent :: Text -> Ident
- mkInfix :: Text -> Ident
- isInfixIdent :: Ident -> Bool
- nullIdent :: Ident -> Bool
- identText :: Ident -> Text
- type ModName = Text
- modRange :: Module name -> Range
- data PName
  - = UnQual !Ident
  - | Qual !ModName !Ident
  - | NewName !Pass !Int
- getModName :: PName -> Maybe ModName
- getIdent :: PName -> Ident
- mkUnqual :: Ident -> PName
- mkQual :: ModName -> Ident -> PName
- data Named a = Named {
  - name :: Located Ident
  - value :: a
  }
- data Pass
  - = NoPat
  - | MonoValues
- data Assoc
  - = LeftAssoc
  - | RightAssoc
  - | NonAssoc
- data Schema n = Forall [TParam n] [Prop n] (Type n) (Maybe Range)
- data TParam n = TParam {
  - tpName :: n
  - tpKind :: Maybe Kind
  - tpRange :: Maybe Range
  }
- data Kind
  - = KNum
  - | KType
- data Type n
  - = TFun (Type n) (Type n)
  - | TSeq (Type n) (Type n)
  - | TBit
  - | TNum Integer
  - | TChar Char
  - | TInf
  - | TUser n [Type n]
  - | TApp TFun [Type n]
  - | TRecord [Named (Type n)]
  - | TTuple [Type n]
  - | TWild
  - | TLocated (Type n) Range
  - | TParens (Type n)
  - | TInfix (Type n) (Located n) Fixity (Type n)
- tconNames :: Map PName (Type PName)
- data Prop n
  - = CFin (Type n)
  - | CEqual (Type n) (Type n)
  - | CGeq (Type n) (Type n)
  - | CArith (Type n)
  - | CCmp (Type n)
  - | CLocated (Prop n) Range
  - | CType (Type n)
- data Module name = Module {
  - mName :: Located ModName
  - mImports :: [Located Import]
  - mDecls :: [TopDecl name]
  }
- newtype Program name = Program [TopDecl name]
- data TopDecl name
  - = Decl (TopLevel (Decl name))
  - | TDNewtype (TopLevel (Newtype name))
  - | Include (Located FilePath)
- data Decl name
  - = 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
- data Fixity = Fixity {
  - fAssoc :: !Assoc
  - fLevel :: !Int
  }
- defaultFixity :: Fixity
- data FixityCmp
  - = FCError
  - | FCLeft
  - | FCRight
- compareFixity :: Fixity -> Fixity -> FixityCmp
- data TySyn n = TySyn (Located n) [TParam n] (Type n)
- data Bind name = Bind {
  - bName :: Located name
  - bParams :: [Pattern name]
  - bDef :: Located (BindDef name)
  - bSignature :: Maybe (Schema name)
  - bInfix :: Bool
  - bFixity :: Maybe Fixity
  - bPragmas :: [Pragma]
  - bMono :: Bool
  - bDoc :: Maybe String
  }
- data BindDef name
  - = DPrim
  - | DExpr (Expr name)
- type LBindDef = Located (BindDef PName)
- data Pragma
  - = PragmaNote String
  - | PragmaProperty
- data ExportType
  - = Public
  - | Private
- data ExportSpec name = ExportSpec {
  - eTypes :: Set name
  - eBinds :: Set name
  }
- exportBind :: Ord name => TopLevel name -> ExportSpec name
- exportType :: Ord name => TopLevel name -> ExportSpec name
- isExportedBind :: Ord name => name -> ExportSpec name -> Bool
- isExportedType :: Ord name => name -> ExportSpec name -> Bool
- data TopLevel a = TopLevel {
  - tlExport :: ExportType
  - tlDoc :: Maybe (Located String)
  - tlValue :: a
  }
- data Import = Import {
  - iModule :: !ModName
  - iAs :: Maybe ModName
  - iSpec :: Maybe ImportSpec
  }
- data ImportSpec
  - = Hiding [Ident]
  - | Only [Ident]
- data Newtype name = Newtype {
  - nName :: Located name
  - nParams :: [TParam name]
  - nBody :: [Named (Type name)]
  }
- data ReplInput name
  - = ExprInput (Expr name)
  - | LetInput (Decl name)
- data Expr n
  - = EVar n
  - | ELit Literal
  - | ETuple [Expr n]
  - | ERecord [Named (Expr n)]
  - | ESel (Expr n) Selector
  - | EList [Expr n]
  - | EFromTo (Type n) (Maybe (Type n)) (Maybe (Type n))
  - | EInfFrom (Expr n) (Maybe (Expr n))
  - | EComp (Expr n) [[Match n]]
  - | EApp (Expr n) (Expr n)
  - | EAppT (Expr n) [TypeInst n]
  - | EIf (Expr n) (Expr n) (Expr n)
  - | EWhere (Expr n) [Decl n]
  - | ETyped (Expr n) (Type n)
  - | ETypeVal (Type n)
  - | EFun [Pattern n] (Expr n)
  - | ELocated (Expr n) Range
  - | EParens (Expr n)
  - | EInfix (Expr n) (Located n) Fixity (Expr n)
- data Literal
  - = ECNum Integer NumInfo
  - | ECString String
- data NumInfo
  - = BinLit Int
  - | OctLit Int
  - | DecLit
  - | HexLit Int
  - | CharLit
  - | PolyLit Int
- data Match name
  - = Match (Pattern name) (Expr name)
  - | MatchLet (Bind name)
- data Pattern n
  - = PVar (Located n)
  - | PWild
  - | PTuple [Pattern n]
  - | PRecord [Named (Pattern n)]
  - | PList [Pattern n]
  - | PTyped (Pattern n) (Type n)
  - | PSplit (Pattern n) (Pattern n)
  - | PLocated (Pattern n) Range
- data Selector
  - = TupleSel Int (Maybe Int)
  - | RecordSel Ident (Maybe [Ident])
  - | ListSel Int (Maybe Int)
- data TypeInst name
  - = NamedInst (Named (Type name))
  - | PosInst (Type name)
- data Located a = Located {
  - srcRange :: !Range
  - thing :: a
  }
- type LPName = Located PName
- type LString = Located String
- type LIdent = Located Ident
- class NoPos t where
- cppKind :: Kind -> Doc
- ppSelector :: Selector -> Doc

# 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 Rep Ident = D1 (MetaData "Ident" "Cryptol.Utils.Ident" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Ident" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))))

mkIdent :: Text -> Ident Source #

mkInfix :: Text -> Ident Source #

isInfixIdent :: Ident -> Bool Source #

nullIdent :: Ident -> Bool Source #

identText :: Ident -> Text Source #

type ModName = Text Source #

Module names are just text.

modRange :: Module name -> Range Source #

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 # |
Methods ppNameFixity :: PName -> Maybe (Assoc, Int) Source # ppPrefixName :: PName -> Doc Source # ppInfixName :: PName -> Doc Source #
PP PName Source # |
Methods ppPrec :: Int -> PName -> Doc Source #
RemovePatterns [Decl PName] Source # |
Methods removePatterns :: [Decl PName] -> ([Decl PName], [Error]) Source #
RemovePatterns (Expr PName) Source # |
Methods removePatterns :: Expr PName -> (Expr PName, [Error]) Source #
RemovePatterns (Module PName) Source # |
Methods removePatterns :: Module PName -> (Module PName, [Error]) Source #
RemovePatterns (Program PName) Source # |
Methods removePatterns :: Program PName -> (Program PName, [Error]) Source #
BindsNames (TParam PName) Source # | Generate the naming environment for a type parameter.
Methods namingEnv :: TParam PName -> BuildNamingEnv Source #
BindsNames (Schema PName) Source # | Generate a type renaming environment from the parameters that are bound by this schema.
Methods namingEnv :: Schema PName -> BuildNamingEnv 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.
Methods namingEnv :: Module PName -> BuildNamingEnv Source #
BindsNames (InModule (Newtype PName)) Source # |
Methods namingEnv :: InModule (Newtype PName) -> BuildNamingEnv Source #
BindsNames (InModule (Bind PName)) Source # | Introduce the name
Methods namingEnv :: InModule (Bind PName) -> BuildNamingEnv Source #
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration.
Methods namingEnv :: InModule (Decl PName) -> BuildNamingEnv Source #
BindsNames (InModule (TopDecl PName)) Source # |
Methods namingEnv :: InModule (TopDecl PName) -> BuildNamingEnv Source #
type Rep PName Source # |

type Rep PName = D1 (MetaData "PName" "Cryptol.Parser.Name" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "UnQual" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Ident))) ((:+:) (C1 (MetaCons "Qual" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ModName)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Ident)))) (C1 (MetaCons "NewName" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Pass)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))))

getModName :: PName -> Maybe ModName Source #

getIdent :: PName -> Ident Source #

mkUnqual :: Ident -> PName Source #

mkQual :: ModName -> Ident -> PName Source #

data Named a Source #

Constructors

Named |

Fields

- name :: Located Ident
- value :: a

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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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.
Methods rename :: Schema PName -> RenameM (Schema Name) Source #
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.
Methods namingEnv :: Schema PName -> BuildNamingEnv Source #
type Rep (Schema n) Source # |

type Rep (Schema n) = D1 (MetaData "Schema" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Forall" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TParam n])) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Prop n]))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Range))))))

data TParam n Source #

Constructors

TParam |

Fields

- tpName :: n
- tpKind :: Maybe Kind
- tpRange :: Maybe Range

Instances

Rename TParam Source # |
Methods rename :: TParam PName -> RenameM (TParam Name) 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.
Methods namingEnv :: TParam PName -> BuildNamingEnv Source #
type Rep (TParam n) Source # |

type Rep (TParam n) = D1 (MetaData "TParam" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" 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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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.
Methods rename :: Type PName -> RenameM (Type Name) Source #
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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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))))))))))

tconNames :: Map PName (Type PName) Source #

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 # |
Methods rename :: Prop PName -> RenameM (Prop Name) 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 # |

type Rep (Prop n) = D1 (MetaData "Prop" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) ((:+:) (C1 (MetaCons "CFin" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))) ((:+:) (C1 (MetaCons "CEqual" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))) (C1 (MetaCons "CGeq" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))))) ((:+:) ((:+:) (C1 (MetaCons "CArith" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))) (C1 (MetaCons "CCmp" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))) ((:+:) (C1 (MetaCons "CLocated" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Prop n))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Range)))) (C1 (MetaCons "CType" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n)))))))

# Declarations

data Module name Source #

Constructors

Module |

Fields

- mName :: Located ModName
- mImports :: [Located Import]
- mDecls :: [TopDecl name]

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 # |
Methods removePatterns :: Module PName -> (Module PName, [Error]) 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.
Methods namingEnv :: Module PName -> BuildNamingEnv Source #
type Rep (Module name) Source # |

type Rep (Module name) = D1 (MetaData "Module" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Module" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "mName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located ModName))) ((:*:) (S1 (MetaSel (Just Symbol "mImports") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Located Import])) (S1 (MetaSel (Just Symbol "mDecls") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TopDecl name])))))

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 # |
Methods removePatterns :: Program PName -> (Program PName, [Error]) Source #

data TopDecl name Source #

Constructors

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

Instances

Rename TopDecl Source # |
Methods rename :: TopDecl PName -> RenameM (TopDecl Name) 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 # |
Methods toBind :: TopDecl Name -> Maybe (Bind Name) Source # toTyDecl :: TopDecl Name -> Maybe TyDecl Source # isTopDecl :: TopDecl Name -> Bool Source #
BindsNames (InModule (TopDecl PName)) Source # |
Methods namingEnv :: InModule (TopDecl PName) -> BuildNamingEnv Source #
type Rep (TopDecl name) Source # |

type Rep (TopDecl name) = D1 (MetaData "TopDecl" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "Decl" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (TopLevel (Decl name))))) ((:+:) (C1 (MetaCons "TDNewtype" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (TopLevel (Newtype name))))) (C1 (MetaCons "Include" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located FilePath))))))

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 # |
Methods rename :: Decl PName -> RenameM (Decl Name) 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 # |
Methods removePatterns :: [Decl PName] -> ([Decl PName], [Error]) Source #
FromDecl (Decl Name) Source # |
Methods toBind :: Decl Name -> Maybe (Bind Name) Source # toTyDecl :: Decl Name -> Maybe TyDecl Source # isTopDecl :: Decl Name -> Bool Source #
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration.
Methods namingEnv :: InModule (Decl PName) -> BuildNamingEnv Source #
type Rep (Decl name) Source # |

type Rep (Decl name) = D1 (MetaData "Decl" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" 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

- fAssoc :: !Assoc
- fLevel :: !Int

Instances

Eq Fixity Source # |
Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #
Show Fixity Source # |
Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #
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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 FixityCmp Source #

Constructors

FCError |
FCLeft |
FCRight |

Instances

Eq FixityCmp Source # |
Methods (==) :: FixityCmp -> FixityCmp -> Bool # (/=) :: FixityCmp -> FixityCmp -> Bool #
Show FixityCmp Source # |
Methods showsPrec :: Int -> FixityCmp -> ShowS # show :: FixityCmp -> String # showList :: [FixityCmp] -> ShowS #

compareFixity :: Fixity -> Fixity -> FixityCmp Source #

data TySyn n Source #

Constructors

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

Instances

Rename TySyn Source # |
Methods rename :: TySyn PName -> RenameM (TySyn Name) 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 # |

type Rep (TySyn n) = D1 (MetaData "TySyn" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "TySyn" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located n))) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [TParam n])) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Type n))))))

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

- bName :: Located name

  Defined thing

- bParams :: [Pattern name]

  Parameters

- bDef :: Located (BindDef name)

  Definition

- bSignature :: Maybe (Schema name)

  Optional type sig

- bInfix :: Bool

  Infix operator?

- bFixity :: Maybe Fixity

  Optional fixity info

- bPragmas :: [Pragma]

  Optional pragmas

- bMono :: Bool

  Is this a monomorphic binding

- bDoc :: Maybe String

  Optional doc string

Instances

Rename Bind Source # | Rename a binding.
Methods rename :: Bind PName -> RenameM (Bind Name) Source #
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
Methods namingEnv :: InModule (Bind PName) -> BuildNamingEnv Source #
type Rep (Bind name) Source # |

type Rep (Bind name) = D1 (MetaData "Bind" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Bind" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "bName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located name))) (S1 (MetaSel (Just Symbol "bParams") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pattern name]))) ((:*:) (S1 (MetaSel (Just Symbol "bDef") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Located (BindDef name)))) (S1 (MetaSel (Just Symbol "bSignature") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Schema name)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "bInfix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "bFixity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Fixity)))) ((:*:) (S1 (MetaSel (Just Symbol "bPragmas") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pragma])) ((:*:) (S1 (MetaSel (Just Symbol "bMono") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "bDoc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))))))

data BindDef name Source #

Constructors

DPrim |
DExpr (Expr name) |

Instances

Rename BindDef Source # |
Methods rename :: BindDef PName -> RenameM (BindDef Name) 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.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "DPrim" PrefixI False) U1) (C1 (MetaCons "DExpr" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr name)))))

type LBindDef = Located (BindDef PName) Source #

data Pragma Source #

Constructors

PragmaNote String |
PragmaProperty |

Instances

Eq Pragma Source # |
Methods (==) :: Pragma -> Pragma -> Bool # (/=) :: Pragma -> Pragma -> Bool #
Show Pragma Source # |
Methods showsPrec :: Int -> Pragma -> ShowS # show :: Pragma -> String # showList :: [Pragma] -> ShowS #
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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 |

Instances

Eq ExportType Source # |
Methods (==) :: ExportType -> ExportType -> Bool # (/=) :: ExportType -> ExportType -> Bool #
Ord ExportType Source # |
Methods compare :: ExportType -> ExportType -> Ordering # (<) :: ExportType -> ExportType -> Bool # (<=) :: ExportType -> ExportType -> Bool # (>) :: ExportType -> ExportType -> Bool # (>=) :: ExportType -> ExportType -> Bool # max :: ExportType -> ExportType -> ExportType # min :: ExportType -> ExportType -> ExportType #
Show ExportType Source # |
Methods showsPrec :: Int -> ExportType -> ShowS # show :: ExportType -> String # showList :: [ExportType] -> ShowS #
Generic ExportType Source # |
Associated Types type Rep ExportType :: * -> * # Methods from :: ExportType -> Rep ExportType x # to :: Rep ExportType x -> ExportType #
NFData ExportType Source # |
Methods rnf :: ExportType -> () #
type Rep ExportType Source # |
type Rep ExportType = D1 (MetaData "ExportType" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "Public" PrefixI False) U1) (C1 (MetaCons "Private" PrefixI False) U1))

data ExportSpec name Source #

Constructors

ExportSpec |

Fields

- eTypes :: Set name
- eBinds :: Set name

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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 |

Fields

- tlExport :: ExportType
- tlDoc :: Maybe (Located String)
- tlValue :: a

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 # |
Methods getLoc :: TopLevel a -> Maybe Range Source #
NoPos a => NoPos (TopLevel a) Source # |
Methods noPos :: TopLevel a -> TopLevel a Source #
type Rep (TopLevel a) Source # |

type Rep (TopLevel a) = D1 (MetaData "TopLevel" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "TopLevel" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "tlExport") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ExportType)) ((:*:) (S1 (MetaSel (Just Symbol "tlDoc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Located String)))) (S1 (MetaSel (Just Symbol "tlValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))))

data Import Source #

An import declaration.

Constructors

Import |

Fields

- iModule :: !ModName
- iAs :: Maybe ModName
- iSpec :: Maybe ImportSpec

Instances

Eq Import Source # |
Methods (==) :: Import -> Import -> Bool # (/=) :: Import -> Import -> Bool #
Show Import Source # |
Methods showsPrec :: Int -> Import -> ShowS # show :: Import -> String # showList :: [Import] -> ShowS #
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 # |

type Rep Import = D1 (MetaData "Import" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Import" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "iModule") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ModName)) ((:*:) (S1 (MetaSel (Just Symbol "iAs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ModName))) (S1 (MetaSel (Just Symbol "iSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ImportSpec))))))

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

Instances

Eq ImportSpec Source # |
Methods (==) :: ImportSpec -> ImportSpec -> Bool # (/=) :: ImportSpec -> ImportSpec -> Bool #
Show ImportSpec Source # |
Methods showsPrec :: Int -> ImportSpec -> ShowS # show :: ImportSpec -> String # showList :: [ImportSpec] -> ShowS #
Generic ImportSpec Source # |
Associated Types type Rep ImportSpec :: * -> * # Methods from :: ImportSpec -> Rep ImportSpec x # to :: Rep ImportSpec x -> ImportSpec #
NFData ImportSpec Source # |
Methods rnf :: ImportSpec -> () #
PP ImportSpec Source # |
Methods ppPrec :: Int -> ImportSpec -> Doc Source #
type Rep ImportSpec Source # |
type Rep ImportSpec = D1 (MetaData "ImportSpec" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "Hiding" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Ident]))) (C1 (MetaCons "Only" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Ident]))))

data Newtype name Source #

Constructors

Newtype |

Fields

- nName :: Located name

  Type name

- nParams :: [TParam name]

  Type params

- nBody :: [Named (Type name)]

  Constructor

Instances

Rename Newtype Source # |
Methods rename :: Newtype PName -> RenameM (Newtype Name) 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 # |
Methods namingEnv :: InModule (Newtype PName) -> BuildNamingEnv Source #
type Rep (Newtype name) Source # |

type Rep (Newtype name) = D1 (MetaData "Newtype" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 # |
Methods rename :: Expr PName -> RenameM (Expr Name) 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 # |
Methods removePatterns :: Expr PName -> (Expr PName, [Error]) Source #
type Rep (Expr n) Source # |

type Rep (Expr n) = D1 (MetaData "Expr" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 Literal Source #

Literals.

Constructors

ECNum Integer NumInfo | `0x10` (HexLit 2)

ECString String

    "hello"

Instances

Eq Literal Source # |
Methods (==) :: Literal -> Literal -> Bool # (/=) :: Literal -> Literal -> Bool #
Show Literal Source # |
Methods showsPrec :: Int -> Literal -> ShowS # show :: Literal -> String # showList :: [Literal] -> ShowS #
Generic Literal Source # |
Associated Types type Rep Literal :: * -> * # Methods from :: Literal -> Rep Literal x # to :: Rep Literal x -> Literal #
NFData Literal Source # |
Methods rnf :: Literal -> () #
PP Literal Source # |
Methods ppPrec :: Int -> Literal -> Doc Source #
type Rep Literal Source # |

type Rep Literal = D1 (MetaData "Literal" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "ECNum" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NumInfo)))) (C1 (MetaCons "ECString" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

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

Instances

Eq NumInfo Source # |
Methods (==) :: NumInfo -> NumInfo -> Bool # (/=) :: NumInfo -> NumInfo -> Bool #
Show NumInfo Source # |
Methods showsPrec :: Int -> NumInfo -> ShowS # show :: NumInfo -> String # showList :: [NumInfo] -> ShowS #
Generic NumInfo Source # |
Associated Types type Rep NumInfo :: * -> * # Methods from :: NumInfo -> Rep NumInfo x # to :: Rep NumInfo x -> NumInfo #
NFData NumInfo Source # |
Methods rnf :: NumInfo -> () #
type Rep NumInfo Source # |

type Rep NumInfo = D1 (MetaData "NumInfo" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) ((:+:) (C1 (MetaCons "BinLit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) ((:+:) (C1 (MetaCons "OctLit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) (C1 (MetaCons "DecLit" PrefixI False) U1))) ((:+:) (C1 (MetaCons "HexLit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) ((:+:) (C1 (MetaCons "CharLit" PrefixI False) U1) (C1 (MetaCons "PolyLit" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))))))

data Match name Source #

Constructors

Match (Pattern name) (Expr name) | p <- e
MatchLet (Bind name) |

Instances

Rename Match Source # |
Methods rename :: Match PName -> RenameM (Match Name) 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 # |

type Rep (Match name) = D1 (MetaData "Match" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "Match" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Pattern name))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Expr name))))) (C1 (MetaCons "MatchLet" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Bind name)))))

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 # |
Methods rename :: Pattern PName -> RenameM (Pattern Name) 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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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 # |
Methods (==) :: Selector -> Selector -> Bool # (/=) :: Selector -> Selector -> Bool #
Ord Selector Source # |
Methods compare :: Selector -> Selector -> Ordering # (<) :: Selector -> Selector -> Bool # (<=) :: Selector -> Selector -> Bool # (>) :: Selector -> Selector -> Bool # (>=) :: Selector -> Selector -> Bool # max :: Selector -> Selector -> Selector # min :: Selector -> Selector -> Selector #
Show Selector Source # |
Methods showsPrec :: Int -> Selector -> ShowS # show :: Selector -> String # showList :: [Selector] -> ShowS #
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 # |

type Rep Selector = D1 (MetaData "Selector" "Cryptol.Parser.AST" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) ((:+:) (C1 (MetaCons "TupleSel" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int))))) ((:+:) (C1 (MetaCons "RecordSel" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ident)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe [Ident]))))) (C1 (MetaCons "ListSel" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int)))))))

data TypeInst name Source #

Constructors

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

Instances

Rename TypeInst Source # |
Methods rename :: TypeInst PName -> RenameM (TypeInst Name) 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.4.0-CN28BMG3PUFD1lr9WvB1U9" 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

- srcRange :: !Range
- thing :: a

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 # |
Methods ppNameFixity :: Located a -> Maybe (Assoc, Int) Source # ppPrefixName :: Located a -> Doc Source # ppInfixName :: Located a -> Doc Source #
PP a => PP (Located a) Source # |
Methods ppPrec :: Int -> Located a -> Doc Source #
AddLoc (Located a) Source # |
Methods addLoc :: Located a -> Range -> Located a Source # dropLoc :: Located a -> 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.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Located" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "srcRange") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Range)) (S1 (MetaSel (Just Symbol "thing") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (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.