Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports a type class covering representations of function return types.
Synopsis
- class (Show rt, Eq rt, Ord rt, ExtTyped rt) => IsBodyType rt where
- primBodyType :: PrimType -> rt
- class (Show rt, Eq rt, Ord rt, DeclExtTyped rt) => IsRetType rt where
- primRetType :: PrimType -> rt
- applyRetType :: Typed dec => [rt] -> [Param dec] -> [(SubExp, Type)] -> Maybe [rt]
- expectedTypes :: Typed t => [VName] -> [t] -> [SubExp] -> [Type]
Documentation
class (Show rt, Eq rt, Ord rt, ExtTyped rt) => IsBodyType rt where Source #
A type representing the return type of a body. It should contain
at least the information contained in a list of ExtType
s, but may
have more, notably an existential context.
primBodyType :: PrimType -> rt Source #
Construct a body type from a primitive type.
Instances
IsBodyType ExtType Source # | |
Defined in Futhark.IR.RetType primBodyType :: PrimType -> ExtType Source # | |
IsBodyType BodyReturns Source # | |
Defined in Futhark.IR.Mem primBodyType :: PrimType -> BodyReturns Source # |
class (Show rt, Eq rt, Ord rt, DeclExtTyped rt) => IsRetType rt where Source #
A type representing the return type of a function. In practice,
a list of these will be used. It should contain at least the
information contained in an ExtType
, but may have more, notably
an existential context.
primRetType :: PrimType -> rt Source #
Contruct a return type from a primitive type.
applyRetType :: Typed dec => [rt] -> [Param dec] -> [(SubExp, Type)] -> Maybe [rt] Source #
Given a function return type, the parameters of the function, and the arguments for a concrete call, return the instantiated return type for the concrete call, if valid.
Instances
IsRetType DeclExtType Source # | |
Defined in Futhark.IR.RetType primRetType :: PrimType -> DeclExtType Source # applyRetType :: Typed dec => [DeclExtType] -> [Param dec] -> [(SubExp, Type)] -> Maybe [DeclExtType] Source # | |
IsRetType FunReturns Source # | |
Defined in Futhark.IR.Mem primRetType :: PrimType -> FunReturns Source # applyRetType :: Typed dec => [FunReturns] -> [Param dec] -> [(SubExp, Type)] -> Maybe [FunReturns] Source # |