futhark-0.19.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.IR.RetType

Description

This module exports a type class covering representations of function return types.

Synopsis

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 ExtTypes, but may have more, notably an existential context.

Methods

primBodyType :: PrimType -> rt Source #

Construct a body type from a primitive type.

Instances

Instances details
IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsBodyType BodyReturns Source # 
Instance details

Defined in Futhark.IR.Mem

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.

Methods

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

Instances details
IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

IsRetType FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

expectedTypes :: Typed t => [VName] -> [t] -> [SubExp] -> [Type] Source #

Given shape parameter names and value parameter types, produce the types of arguments accepted.