| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
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
- data FFIFunType t = FFIFunType {
- ffiTParams :: [TParam]
- ffiArgTypes :: [t]
- ffiRetType :: t
- data FFIType
- data FFIBasicType
- data FFIBasicValType
- data FFIWordSize
- data FFIFloatSize
- data FFIBasicRefType
- = FFIInteger (Maybe Type)
- | FFIRational
Documentation
data FFIFunType t Source #
Type of a foreign function.
Constructors
| FFIFunType | |
Fields
| |
Instances
Type of a value that can be passed to or returned from a foreign function.
Constructors
| FFIBool | |
| FFIBasic FFIBasicType | |
| FFIArray [Type] FFIBasicType |
|
| FFITuple [FFIType] | |
| FFIRecord (RecordMap Ident FFIType) |
Instances
| Generic FFIType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
| |||||
| Show FFIType Source # | |||||
| TraverseNames FFIType Source # | |||||
Defined in Cryptol.IR.TraverseNames Methods traverseNamesIP :: (Applicative f, ?name :: Name -> f Name) => FFIType -> f FFIType Source # | |||||
| NFData FFIType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType | |||||
| type Rep FFIType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType type Rep FFIType = D1 ('MetaData "FFIType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) ((C1 ('MetaCons "FFIBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FFIBasic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIBasicType))) :+: (C1 ('MetaCons "FFIArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Type]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIBasicType)) :+: (C1 ('MetaCons "FFITuple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FFIType])) :+: C1 ('MetaCons "FFIRecord" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RecordMap Ident FFIType)))))) | |||||
data FFIBasicType Source #
Types which can be elements of FFI arrays.
Constructors
| FFIBasicVal FFIBasicValType | |
| FFIBasicRef FFIBasicRefType |
Instances
| Generic FFIBasicType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
| |||||
| Show FFIBasicType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods showsPrec :: Int -> FFIBasicType -> ShowS # show :: FFIBasicType -> String # showList :: [FFIBasicType] -> ShowS # | |||||
| NFData FFIBasicType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods rnf :: FFIBasicType -> () # | |||||
| type Rep FFIBasicType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType type Rep FFIBasicType = D1 ('MetaData "FFIBasicType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" '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
| |
| FFIFloat | |
Fields
| |
Instances
| Generic FFIBasicValType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
Methods from :: FFIBasicValType -> Rep FFIBasicValType x # to :: Rep FFIBasicValType x -> FFIBasicValType # | |||||
| Show FFIBasicValType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods showsPrec :: Int -> FFIBasicValType -> ShowS # show :: FFIBasicValType -> String # showList :: [FFIBasicValType] -> ShowS # | |||||
| NFData FFIBasicValType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods rnf :: FFIBasicValType -> () # | |||||
| type Rep FFIBasicValType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType type Rep FFIBasicValType = D1 ('MetaData "FFIBasicValType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "FFIWord" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIWordSize)) :+: C1 ('MetaCons "FFIFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FFIFloatSize)))) | |||||
data FFIWordSize Source #
Instances
| Generic FFIWordSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
| |||||
| Show FFIWordSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods showsPrec :: Int -> FFIWordSize -> ShowS # show :: FFIWordSize -> String # showList :: [FFIWordSize] -> ShowS # | |||||
| NFData FFIWordSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods rnf :: FFIWordSize -> () # | |||||
| type Rep FFIWordSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType type Rep FFIWordSize = D1 ('MetaData "FFIWordSize" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" '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
| Generic FFIFloatSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
| |||||
| Show FFIFloatSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods showsPrec :: Int -> FFIFloatSize -> ShowS # show :: FFIFloatSize -> String # showList :: [FFIFloatSize] -> ShowS # | |||||
| NFData FFIFloatSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods rnf :: FFIFloatSize -> () # | |||||
| type Rep FFIFloatSize Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType | |||||
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
| Generic FFIBasicRefType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Associated Types
Methods from :: FFIBasicRefType -> Rep FFIBasicRefType x # to :: Rep FFIBasicRefType x -> FFIBasicRefType # | |||||
| Show FFIBasicRefType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods showsPrec :: Int -> FFIBasicRefType -> ShowS # show :: FFIBasicRefType -> String # showList :: [FFIBasicRefType] -> ShowS # | |||||
| NFData FFIBasicRefType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType Methods rnf :: FFIBasicRefType -> () # | |||||
| type Rep FFIBasicRefType Source # | |||||
Defined in Cryptol.TypeCheck.FFI.FFIType type Rep FFIBasicRefType = D1 ('MetaData "FFIBasicRefType" "Cryptol.TypeCheck.FFI.FFIType" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" '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)) | |||||