cryptol-3.0.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-Inferred
Language | Haskell2010

Cryptol.ModuleSystem.Renamer.Error

Description

Synopsis

- data RenamerError
  - = MultipleSyms (Located PName) [Name]
  - | UnboundName Namespace (Located PName)
  - | OverlappingSyms [Name]
  - | WrongNamespace Namespace Namespace (Located PName)
  - | FixityError (Located Name) Fixity (Located Name) Fixity
  - | OverlappingRecordUpdate (Located [Selector]) (Located [Selector])
  - | InvalidDependency [DepName]
  - | MultipleModParams Ident [Range]
  - | InvalidFunctorImport (ImpName Name)
  - | UnexpectedNest Range PName
  - | ModuleKindMismatch Range (ImpName Name) ModKind ModKind
- data DepName
  - = NamedThing Name
  - | ModPath ModPath
  - | ModParamName Range Ident
  - | ConstratintAt Range
- depNameLoc :: DepName -> Maybe Range
- data ModKind
  - = AFunctor
  - | ASignature
  - | AModule
- data RenamerWarning
  - = SymbolShadowed PName Name [Name]
  - | UnusedName Name
  - | PrefixAssocChanged PrefixOp (Expr Name) (Located Name) Fixity (Expr Name)

# Documentation

data RenamerError Source #

Constructors

MultipleSyms (Located PName) [Name] | Multiple imported symbols contain this name
UnboundName Namespace (Located PName) | Some name not bound to any definition
OverlappingSyms [Name] | An environment has produced multiple overlapping symbols
WrongNamespace Namespace Namespace (Located PName) | expected, actual. When a name is missing from the expected namespace, but exists in another
FixityError (Located Name) Fixity (Located Name) Fixity | When the fixity of two operators conflict
OverlappingRecordUpdate (Located [Selector]) (Located [Selector]) | When record updates overlap (e.g., `{ r | x = e1, x.y = e2 }`)
InvalidDependency [DepName] | Things that can't depend on each other
MultipleModParams Ident [Range] | Module parameters with the same name
InvalidFunctorImport (ImpName Name) | Can't import functors directly
UnexpectedNest Range PName | Nested modules were not supposed to appear here
ModuleKindMismatch Range (ImpName Name) ModKind ModKind | Exepcted one kind (first one) but found the other (second one)

#### Instances

Instances details

Generic RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Associated Types type Rep RenamerError :: Type -> Type Source # Methods from :: RenamerError -> Rep RenamerError x Source # to :: Rep RenamerError x -> RenamerError Source #
Show RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods showsPrec :: Int -> RenamerError -> ShowS Source # show :: RenamerError -> String Source # showList :: [RenamerError] -> ShowS Source #
PP RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> RenamerError -> Doc Source #
NFData RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods rnf :: RenamerError -> () Source #
Eq RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods (==) :: RenamerError -> RenamerError -> Bool Source # (/=) :: RenamerError -> RenamerError -> Bool Source #
Ord RenamerError Source # |

Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

Methods

compare :: RenamerError -> RenamerError -> Ordering Source #

(<) :: RenamerError -> RenamerError -> Bool Source #

(<=) :: RenamerError -> RenamerError -> Bool Source #

(>) :: RenamerError -> RenamerError -> Bool Source #

(>=) :: RenamerError -> RenamerError -> Bool Source #

max :: RenamerError -> RenamerError -> RenamerError Source #

min :: RenamerError -> RenamerError -> RenamerError Source #

type Rep RenamerError Source # |

Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

type Rep RenamerError = D1 ('MetaData "RenamerError" "Cryptol.ModuleSystem.Renamer.Error" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (((C1 ('MetaCons "MultipleSyms" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Name])) :+: C1 ('MetaCons "UnboundName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Namespace) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName)))) :+: (C1 ('MetaCons "OverlappingSyms" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Name])) :+: (C1 ('MetaCons "WrongNamespace" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Namespace) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Namespace) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located PName)))) :+: C1 ('MetaCons "FixityError" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Fixity)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Name)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Fixity)))))) :+: ((C1 ('MetaCons "OverlappingRecordUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located [Selector])) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located [Selector]))) :+: (C1 ('MetaCons "InvalidDependency" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [DepName])) :+: C1 ('MetaCons "MultipleModParams" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Range])))) :+: (C1 ('MetaCons "InvalidFunctorImport" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ImpName Name))) :+: (C1 ('MetaCons "UnexpectedNest" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PName)) :+: C1 ('MetaCons "ModuleKindMismatch" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ImpName Name))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModKind) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModKind)))))))

data DepName Source #

We use this to name dependencies. In addition to normal names we have a way to refer to module parameters and top-level module constraints, which have no explicit names

Constructors

NamedThing Name | Something with a name
ModPath ModPath | The module at this path
ModParamName Range Ident | Note that the range is important not just for error reporting but to distinguish module parameters with the same name (e.g., in nested functors)
ConstratintAt Range | Identifed by location in source

#### Instances

Instances details

Generic DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Associated Types type Rep DepName :: Type -> Type Source # Methods from :: DepName -> Rep DepName x Source # to :: Rep DepName x -> DepName Source #
Show DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods showsPrec :: Int -> DepName -> ShowS Source # show :: DepName -> String Source # showList :: [DepName] -> ShowS Source #
PP DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> DepName -> Doc Source #
NFData DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods rnf :: DepName -> () Source #
Eq DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods (==) :: DepName -> DepName -> Bool Source # (/=) :: DepName -> DepName -> Bool Source #
Ord DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods compare :: DepName -> DepName -> Ordering Source # (<) :: DepName -> DepName -> Bool Source # (<=) :: DepName -> DepName -> Bool Source # (>) :: DepName -> DepName -> Bool Source # (>=) :: DepName -> DepName -> Bool Source # max :: DepName -> DepName -> DepName Source # min :: DepName -> DepName -> DepName Source #
type Rep DepName Source # |

Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

type Rep DepName = D1 ('MetaData "DepName" "Cryptol.ModuleSystem.Renamer.Error" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) ((C1 ('MetaCons "NamedThing" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "ModPath" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModPath))) :+: (C1 ('MetaCons "ModParamName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: C1 ('MetaCons "ConstratintAt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range))))

depNameLoc :: DepName -> Maybe Range Source #

data ModKind Source #

Constructors

AFunctor |
ASignature |
AModule |

#### Instances

Instances details

Generic ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Associated Types type Rep ModKind :: Type -> Type Source # Methods from :: ModKind -> Rep ModKind x Source # to :: Rep ModKind x -> ModKind Source #
Show ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods showsPrec :: Int -> ModKind -> ShowS Source # show :: ModKind -> String Source # showList :: [ModKind] -> ShowS Source #
PP ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> ModKind -> Doc Source #
NFData ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods rnf :: ModKind -> () Source #
Eq ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods (==) :: ModKind -> ModKind -> Bool Source # (/=) :: ModKind -> ModKind -> Bool Source #
Ord ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods compare :: ModKind -> ModKind -> Ordering Source # (<) :: ModKind -> ModKind -> Bool Source # (<=) :: ModKind -> ModKind -> Bool Source # (>) :: ModKind -> ModKind -> Bool Source # (>=) :: ModKind -> ModKind -> Bool Source # max :: ModKind -> ModKind -> ModKind Source # min :: ModKind -> ModKind -> ModKind Source #
type Rep ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error type Rep ModKind = D1 ('MetaData "ModKind" "Cryptol.ModuleSystem.Renamer.Error" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "AFunctor" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ASignature" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AModule" 'PrefixI 'False) (U1 :: Type -> Type)))

data RenamerWarning Source #

Constructors

SymbolShadowed PName Name [Name] |
UnusedName Name |
PrefixAssocChanged PrefixOp (Expr Name) (Located Name) Fixity (Expr Name) |

#### Instances

Instances details

Generic RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Associated Types type Rep RenamerWarning :: Type -> Type Source # Methods from :: RenamerWarning -> Rep RenamerWarning x Source # to :: Rep RenamerWarning x -> RenamerWarning Source #
Show RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods showsPrec :: Int -> RenamerWarning -> ShowS Source # show :: RenamerWarning -> String Source # showList :: [RenamerWarning] -> ShowS Source #
PP RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> RenamerWarning -> Doc Source #
NFData RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods rnf :: RenamerWarning -> () Source #
Eq RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods (==) :: RenamerWarning -> RenamerWarning -> Bool Source # (/=) :: RenamerWarning -> RenamerWarning -> Bool Source #
Ord RenamerWarning Source # |

Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

Methods

compare :: RenamerWarning -> RenamerWarning -> Ordering Source #

(<) :: RenamerWarning -> RenamerWarning -> Bool Source #

(<=) :: RenamerWarning -> RenamerWarning -> Bool Source #

(>) :: RenamerWarning -> RenamerWarning -> Bool Source #

(>=) :: RenamerWarning -> RenamerWarning -> Bool Source #

max :: RenamerWarning -> RenamerWarning -> RenamerWarning Source #

min :: RenamerWarning -> RenamerWarning -> RenamerWarning Source #

type Rep RenamerWarning Source # |

Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

type Rep RenamerWarning = D1 ('MetaData "RenamerWarning" "Cryptol.ModuleSystem.Renamer.Error" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "SymbolShadowed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Name]))) :+: (C1 ('MetaCons "UnusedName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "PrefixAssocChanged" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrefixOp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr Name))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Located Name)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Fixity) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expr Name)))))))