cryptol-3.1.0: Cryptol: The Language of Cryptography
Safe HaskellSafe
LanguageHaskell2010

Cryptol.TypeCheck.Type

Description

This module contains types related to typechecking and the output of the typechecker. In particular, it should contain the types needed by interface files (see Interface), which are (kind of) the output of the typechker.

Synopsis

Documentation

data Type Source #

The internal representation of types. These are assumed to be kind correct.

Constructors

TCon !TCon ![Type]

Type constant with args

TVar TVar

Type variable (free or bound)

TUser !Name ![Type] !Type

This is just a type annotation, for a type that was written as a type synonym. It is useful so that we can use it to report nicer errors. Example: TUser T ts t is really just the type t that was written as T ts by the user.

TRec !(RecordMap Ident Type)

Record type

TNominal !NominalType ![Type]

A nominal types

Instances

Instances details
Generic Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep Type :: Type -> Type #

Methods

from :: Type -> Rep Type x #

to :: Rep Type x -> Type #

Show Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

FreeVars Type Source # 
Instance details

Defined in Cryptol.IR.FreeVars

Methods

freeVars :: Type -> Deps Source #

TraverseNames Type Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => Type -> f Type Source #

ModuleInstance Type Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

ShowParseable Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Parseable

TVars Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Subst

Methods

apSubst :: Subst -> Type -> Type Source #

HasKind Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

kindOf :: Type -> Kind Source #

FVS Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: Type -> Set TVar Source #

PP Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: Type -> () #

Eq Type Source #

Syntactic equality, ignoring type synonyms and record order.

Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

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

Ord Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

compare :: Type -> Type -> Ordering #

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

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

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

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

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

TrieMap TypeMap Type Source # 
Instance details

Defined in Cryptol.TypeCheck.TypeMap

Methods

emptyTM :: TypeMap a Source #

nullTM :: TypeMap a -> Bool Source #

lookupTM :: Type -> TypeMap a -> Maybe a Source #

alterTM :: Type -> (Maybe a -> Maybe a) -> TypeMap a -> TypeMap a Source #

unionTM :: (a -> a -> a) -> TypeMap a -> TypeMap a -> TypeMap a Source #

toListTM :: TypeMap a -> [(Type, a)] Source #

mapMaybeWithKeyTM :: (Type -> a -> Maybe b) -> TypeMap a -> TypeMap b Source #

PP (WithNames Type) Source #

The precedence levels used by this pretty-printing instance correspond with parser non-terminals as follows:

  • 0-1: type
  • 2: infix_type
  • 3: app_type
  • 4: dimensions atype
  • 5: atype
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

type Rep Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Prop = Type Source #

The type is supposed to be of kind KProp.

data TVar Source #

Type variables.

Constructors

TVFree !Int Kind (Set TParam) TVarInfo

Unique, kind, ids of bound type variables that are in scope. The last field gives us some info for nicer warnings/errors.

TVBound !TParam 

Instances

Instances details
Generic TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TVar :: Type -> Type #

Methods

from :: TVar -> Rep TVar x #

to :: Rep TVar x -> TVar #

Show TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

showsPrec :: Int -> TVar -> ShowS #

show :: TVar -> String #

showList :: [TVar] -> ShowS #

FreeVars TVar Source # 
Instance details

Defined in Cryptol.IR.FreeVars

Methods

freeVars :: TVar -> Deps Source #

TraverseNames TVar Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TVar -> f TVar Source #

HasKind TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

kindOf :: TVar -> Kind Source #

PP TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TVar -> () #

Eq TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

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

Ord TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

compare :: TVar -> TVar -> Ordering #

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

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

(>) :: TVar -> TVar -> Bool #

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

max :: TVar -> TVar -> TVar #

min :: TVar -> TVar -> TVar #

PP (WithNames TVar) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> WithNames TVar -> Doc Source #

type Rep TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

data ArgDescr Source #

Constructors

ArgDescr 

Instances

Instances details
Generic ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep ArgDescr :: Type -> Type #

Methods

from :: ArgDescr -> Rep ArgDescr x #

to :: Rep ArgDescr x -> ArgDescr #

Show ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames ArgDescr Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => ArgDescr -> f ArgDescr Source #

PP ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: ArgDescr -> () #

type Rep ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep ArgDescr = D1 ('MetaData "ArgDescr" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "ArgDescr" 'PrefixI 'True) (S1 ('MetaSel ('Just "argDescrFun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Name)) :*: S1 ('MetaSel ('Just "argDescrNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))))

data Schema Source #

The types of polymorphic values.

Constructors

Forall 

Fields

Instances

Instances details
Generic Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep Schema :: Type -> Type #

Methods

from :: Schema -> Rep Schema x #

to :: Rep Schema x -> Schema #

Show Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

FreeVars Schema Source # 
Instance details

Defined in Cryptol.IR.FreeVars

Methods

freeVars :: Schema -> Deps Source #

TraverseNames Schema Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => Schema -> f Schema Source #

ModuleInstance Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

TVars Schema Source #

This instance does not need to worry about bound variable capture, because we rely on the Subst datatype invariant to ensure that variable scopes will be properly preserved.

Instance details

Defined in Cryptol.TypeCheck.Subst

Methods

apSubst :: Subst -> Schema -> Schema Source #

FVS Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: Schema -> Set TVar Source #

PP Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: Schema -> () #

Eq Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

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

PP (WithNames Schema) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep Schema = D1 ('MetaData "Schema" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "Forall" 'PrefixI 'True) (S1 ('MetaSel ('Just "sVars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam]) :*: (S1 ('MetaSel ('Just "sProps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Prop]) :*: S1 ('MetaSel ('Just "sType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type))))

data TParam Source #

Type parameters.

Constructors

TParam 

Fields

Instances

Instances details
Generic TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TParam :: Type -> Type #

Methods

from :: TParam -> Rep TParam x #

to :: Rep TParam x -> TParam #

Show TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames TParam Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TParam -> f TParam Source #

ShowParseable TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Parseable

HasKind TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

kindOf :: TParam -> Kind Source #

PP TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TParam -> () #

Eq TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

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

Ord TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames TParam) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep TParam = D1 ('MetaData "TParam" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "TParam" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tpUnique") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "tpKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind)) :*: (S1 ('MetaSel ('Just "tpFlav") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TPFlavor) :*: S1 ('MetaSel ('Just "tpInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TVarInfo))))

data TySyn Source #

Type synonym.

Constructors

TySyn 

Fields

Instances

Instances details
Generic TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TySyn :: Type -> Type #

Methods

from :: TySyn -> Rep TySyn x #

to :: Rep TySyn x -> TySyn #

Show TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

showsPrec :: Int -> TySyn -> ShowS #

show :: TySyn -> String #

showList :: [TySyn] -> ShowS #

TraverseNames TySyn Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TySyn -> f TySyn Source #

ModuleInstance TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

TVars TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Subst

Methods

apSubst :: Subst -> TySyn -> TySyn Source #

HasKind TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

kindOf :: TySyn -> Kind Source #

PP TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TySyn -> () #

PP (WithNames TySyn) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

type Rep TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

data EnumCon Source #

Constructor for an enumeration

Constructors

EnumCon 

Fields

Instances

Instances details
Generic EnumCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep EnumCon :: Type -> Type #

Methods

from :: EnumCon -> Rep EnumCon x #

to :: Rep EnumCon x -> EnumCon #

Show EnumCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

FreeVars EnumCon Source # 
Instance details

Defined in Cryptol.IR.FreeVars

TraverseNames EnumCon Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => EnumCon -> f EnumCon Source #

ModuleInstance EnumCon Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

NFData EnumCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: EnumCon -> () #

type Rep EnumCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep EnumCon = D1 ('MetaData "EnumCon" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "EnumCon" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ecName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Just "ecNumber") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "ecFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type]) :*: (S1 ('MetaSel ('Just "ecPublic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "ecDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))))

data ModParam Source #

A module parameter. Corresponds to a "signature import". A single module parameter can bring multiple things in scope.

Constructors

ModParam 

Fields

  • mpName :: Ident

    The name of a functor parameter.

  • mpQual :: !(Maybe ModName)

    This is the qualifier for the parameter. We use it to derive parameter names when doing `_` imports.

  • mpIface :: ImpName Name

    The interface corresponding to this parameter. This is thing in `import interface`

  • mpParameters :: ModParamNames

    These are the actual parameters, not the ones in the interface For example if the same interface is used for multiple parameters the ifmpParameters would all be different.

Instances

Instances details
Generic ModParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep ModParam :: Type -> Type #

Methods

from :: ModParam -> Rep ModParam x #

to :: Rep ModParam x -> ModParam #

Show ModParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

ModuleInstance ModParam Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

NFData ModParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: ModParam -> () #

type Rep ModParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep ModParam = D1 ('MetaData "ModParam" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "ModParam" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Just "mpQual") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ModName))) :*: (S1 ('MetaSel ('Just "mpIface") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ImpName Name)) :*: S1 ('MetaSel ('Just "mpParameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModParamNames))))

data ModParamNames Source #

Information about the names brought in through an "interface import". This is also used to keep information about.

Constructors

ModParamNames 

Fields

Instances

Instances details
Generic ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep ModParamNames :: Type -> Type #

Show ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

ModuleInstance ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

PP ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

NFData ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: ModParamNames -> () #

type Rep ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep ModParamNames = D1 ('MetaData "ModParamNames" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "ModParamNames" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpnTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Name ModTParam)) :*: S1 ('MetaSel ('Just "mpnTySyn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Name TySyn))) :*: (S1 ('MetaSel ('Just "mpnConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Located Prop]) :*: (S1 ('MetaSel ('Just "mpnFuns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Name ModVParam)) :*: S1 ('MetaSel ('Just "mpnDoc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text))))))

class FVS t where Source #

Methods

fvs :: t -> Set TVar Source #

Instances

Instances details
FVS Error Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

Methods

fvs :: Error -> Set TVar Source #

FVS Warning Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

Methods

fvs :: Warning -> Set TVar Source #

FVS FFITypeError Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.Error

FVS FFITypeErrorReason Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.Error

FVS DelayedCt Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

Methods

fvs :: DelayedCt -> Set TVar Source #

FVS Goal Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

Methods

fvs :: Goal -> Set TVar Source #

FVS Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: Schema -> Set TVar Source #

FVS Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: Type -> Set TVar Source #

FVS a => FVS (Maybe a) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: Maybe a -> Set TVar Source #

FVS a => FVS [a] Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: [a] -> Set TVar Source #

(FVS a, FVS b) => FVS (a, b) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

fvs :: (a, b) -> Set TVar Source #

data ModTParam Source #

A type parameter of a module.

Constructors

ModTParam 

Fields

Instances

Instances details
Generic ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep ModTParam :: Type -> Type #

Show ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames ModTParam Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => ModTParam -> f ModTParam Source #

ModuleInstance ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

PP ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: ModTParam -> () #

type Rep ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep ModTParam = D1 ('MetaData "ModTParam" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "ModTParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "mtpName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: (S1 ('MetaSel ('Just "mtpKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Kind) :*: S1 ('MetaSel ('Just "mtpDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))

data ModVParam Source #

A value parameter of a module.

Constructors

ModVParam 

Instances

Instances details
Generic ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep ModVParam :: Type -> Type #

Show ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames ModVParam Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => ModVParam -> f ModVParam Source #

ModuleInstance ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

PP ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: ModVParam -> () #

type Rep ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep ModVParam = D1 ('MetaData "ModVParam" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "ModVParam" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mvpName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Just "mvpType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Schema)) :*: (S1 ('MetaSel ('Just "mvpDoc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "mvpFixity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Fixity)))))

data TVarInfo Source #

Constructors

TVarInfo 

Fields

Instances

Instances details
Generic TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TVarInfo :: Type -> Type #

Methods

from :: TVarInfo -> Rep TVarInfo x #

to :: Rep TVarInfo x -> TVarInfo #

Show TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames TVarInfo Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TVarInfo -> f TVarInfo Source #

PP TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TVarInfo -> () #

type Rep TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep TVarInfo = D1 ('MetaData "TVarInfo" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "TVarInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "tvarSource") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Range) :*: S1 ('MetaSel ('Just "tvarDesc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TypeSource)))

data TPFlavor Source #

Instances

Instances details
Generic TPFlavor Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TPFlavor :: Type -> Type #

Methods

from :: TPFlavor -> Rep TPFlavor x #

to :: Rep TPFlavor x -> TPFlavor #

Show TPFlavor Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames TPFlavor Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TPFlavor -> f TPFlavor Source #

NFData TPFlavor Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TPFlavor -> () #

type Rep TPFlavor Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

data NominalType Source #

Nominal types

Constructors

NominalType 

Instances

Instances details
Generic NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep NominalType :: Type -> Type #

Show NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

FreeVars NominalType Source # 
Instance details

Defined in Cryptol.IR.FreeVars

TraverseNames NominalType Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => NominalType -> f NominalType Source #

ModuleInstance NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

HasKind NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: NominalType -> () #

Eq NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Ord NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames NominalType) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

data TypeSource Source #

Explains how this type came to be, for better error messages.

Instances

Instances details
Generic TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep TypeSource :: Type -> Type #

Show TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

TraverseNames TypeSource Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => TypeSource -> f TypeSource Source #

PP TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

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

NFData TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: TypeSource -> () #

type Rep TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep TypeSource = D1 ('MetaData "TypeSource" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) ((((C1 ('MetaCons "TVFromModParam" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "TVFromSignature" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "TypeWildCard" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "TypeOfRecordField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: C1 ('MetaCons "TypeOfTupleField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) :+: ((C1 ('MetaCons "TypeOfSeqElement" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LenOfSeq" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TypeParamInstNamed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: (C1 ('MetaCons "TypeParamInstPos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DefinitionOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)))))) :+: (((C1 ('MetaCons "LenOfCompGen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeOfArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ArgDescr))) :+: (C1 ('MetaCons "TypeOfRes" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FunApp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeOfIfCondExpr" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "TypeFromUserAnnotation" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GeneratorOfListComp" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CasedExpression" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ConPat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TypeErrorPlaceHolder" 'PrefixI 'False) (U1 :: Type -> Type))))))

data TypeWithSource Source #

A type annotated with information on how it came about.

Constructors

WithSource 

data NominalTypeDef Source #

Definition of a nominal type

Instances

Instances details
Generic NominalTypeDef Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep NominalTypeDef :: Type -> Type #

Show NominalTypeDef Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

FreeVars NominalTypeDef Source # 
Instance details

Defined in Cryptol.IR.FreeVars

TraverseNames NominalTypeDef Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

ModuleInstance NominalTypeDef Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

NFData NominalTypeDef Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: NominalTypeDef -> () #

type Rep NominalTypeDef Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep NominalTypeDef = D1 ('MetaData "NominalTypeDef" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "Struct" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StructCon)) :+: (C1 ('MetaCons "Enum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [EnumCon])) :+: C1 ('MetaCons "Abstract" 'PrefixI 'False) (U1 :: Type -> Type)))

data StructCon Source #

Constructor for a struct (aka newtype)

Constructors

StructCon 

Instances

Instances details
Generic StructCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Associated Types

type Rep StructCon :: Type -> Type #

Show StructCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

FreeVars StructCon Source # 
Instance details

Defined in Cryptol.IR.FreeVars

TraverseNames StructCon Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => StructCon -> f StructCon Source #

ModuleInstance StructCon Source # 
Instance details

Defined in Cryptol.TypeCheck.ModuleInstance

NFData StructCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

rnf :: StructCon -> () #

type Rep StructCon Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

type Rep StructCon = D1 ('MetaData "StructCon" "Cryptol.TypeCheck.Type" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "StructCon" 'PrefixI 'True) (S1 ('MetaSel ('Just "ntConName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Name) :*: S1 ('MetaSel ('Just "ntFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RecordMap Ident Type))))

type SType = Type Source #

The type is "simple" (i.e., it contains no type functions).

(=#=) :: Type -> Type -> Prop infix 4 Source #

Equality for numeric types.

(>==) :: Type -> Type -> Prop infix 4 Source #

Make a greater-than-or-equal-to constraint.

tFun :: Type -> Type -> Type infixr 5 Source #

Make a function type.

allParamNames :: FunctorParams -> ModParamNames Source #

Compute the names from all functor parameters

mtpParam :: ModTParam -> TParam Source #

This is how module parameters appear in actual types.

tvSourceName :: TypeSource -> Maybe Name Source #

Get the names of something that is related to the tvar.

quickApply :: Kind -> [a] -> Kind Source #

superclassSet :: Prop -> Set Prop Source #

Compute the set of all Props that are implied by the given prop via superclass constraints.

tNoUser :: Type -> Type Source #

Eliminate outermost type synonyms.

tSplitFun :: TFun -> Type -> [Type] Source #

Split up repeated occurances of the given binary type-level function.

tNum :: Integral a => a -> Type Source #

tError :: Type -> Type Source #

Make an error value of the given type to replace the given malformed type (the argument to the error function)

tf2 :: TFun -> Type -> Type -> Type Source #

tf3 :: TFun -> Type -> Type -> Type -> Type Source #

pHas :: Selector -> Type -> Type -> Prop Source #

A Has constraint, used for tuple and record selection.

pNegNumeric :: Prop -> [Prop] Source #

pNegNumeric negates a simple (i.e., not And, not prime, etc) prop over numeric type vars. The result is a conjunction of properties.