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

Cryptol.TypeCheck.FFI.FFIType

Description

This module defines a nicer intermediate representation of Cryptol types allowed for the FFI, which the typechecker generates then stores in the AST. This way the FFI evaluation code does not have to examine the raw type signatures again.

Synopsis

Documentation

data FFIFunType Source #

Type of a foreign function.

Constructors

FFIFunType 

Fields

Instances

Instances details
Generic FFIFunType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIFunType :: Type -> Type #

Show FFIFunType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

TraverseNames FFIFunType Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

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

NFData FFIFunType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIFunType -> () #

type Rep FFIFunType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

type Rep FFIFunType = D1 ('MetaData "FFIFunType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "FFIFunType" 'PrefixI 'True) (S1 ('MetaSel ('Just "ffiTParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TParam]) :*: (S1 ('MetaSel ('Just "ffiArgTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FFIType]) :*: S1 ('MetaSel ('Just "ffiRetType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIType))))

data FFIType Source #

Type of a value that can be passed to or returned from a foreign function.

Constructors

FFIBool 
FFIBasic FFIBasicType 
FFIArray [Type] FFIBasicType
n
[m][p]T --> FFIArray [n, m, p] T
FFITuple [FFIType] 
FFIRecord (RecordMap Ident FFIType) 

Instances

Instances details
Generic FFIType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIType :: Type -> Type #

Methods

from :: FFIType -> Rep FFIType x #

to :: Rep FFIType x -> FFIType #

Show FFIType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

TraverseNames FFIType Source # 
Instance details

Defined in Cryptol.IR.TraverseNames

Methods

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

NFData FFIType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIType -> () #

type Rep FFIType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

data FFIBasicType Source #

Types which can be elements of FFI arrays.

Instances

Instances details
Generic FFIBasicType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIBasicType :: Type -> Type #

Show FFIBasicType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

NFData FFIBasicType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIBasicType -> () #

type Rep FFIBasicType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

type Rep FFIBasicType = D1 ('MetaData "FFIBasicType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "FFIBasicVal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIBasicValType)) :+: C1 ('MetaCons "FFIBasicRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIBasicRefType)))

data FFIBasicValType Source #

Basic type which is passed and returned directly by value.

Constructors

FFIWord 

Fields

  • Integer

    The size of the Cryptol type

  • FFIWordSize

    The machine word size that it corresponds to

FFIFloat 

Fields

Instances

Instances details
Generic FFIBasicValType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIBasicValType :: Type -> Type #

Show FFIBasicValType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

NFData FFIBasicValType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIBasicValType -> () #

type Rep FFIBasicValType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

data FFIWordSize Source #

Instances

Instances details
Generic FFIWordSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIWordSize :: Type -> Type #

Show FFIWordSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

NFData FFIWordSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIWordSize -> () #

type Rep FFIWordSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

type Rep FFIWordSize = D1 ('MetaData "FFIWordSize" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) ((C1 ('MetaCons "FFIWord8" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FFIWord16" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FFIWord32" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FFIWord64" 'PrefixI 'False) (U1 :: Type -> Type)))

data FFIFloatSize Source #

Constructors

FFIFloat32 
FFIFloat64 

Instances

Instances details
Generic FFIFloatSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIFloatSize :: Type -> Type #

Show FFIFloatSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

NFData FFIFloatSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIFloatSize -> () #

type Rep FFIFloatSize Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

type Rep FFIFloatSize = D1 ('MetaData "FFIFloatSize" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "FFIFloat32" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FFIFloat64" 'PrefixI 'False) (U1 :: Type -> Type))

data FFIBasicRefType Source #

Basic type which is passed and returned by reference through a parameter.

Constructors

FFIInteger (Maybe Type)

Modulus (Just for Z, Nothing for Integer)

FFIRational 

Instances

Instances details
Generic FFIBasicRefType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Associated Types

type Rep FFIBasicRefType :: Type -> Type #

Show FFIBasicRefType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

NFData FFIBasicRefType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

Methods

rnf :: FFIBasicRefType -> () #

type Rep FFIBasicRefType Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.FFIType

type Rep FFIBasicRefType = D1 ('MetaData "FFIBasicRefType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) (C1 ('MetaCons "FFIInteger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Type))) :+: C1 ('MetaCons "FFIRational" 'PrefixI 'False) (U1 :: Type -> Type))