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

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 BodyReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsBodyType ExtType Source # 
Instance details

Defined in Futhark.IR.RetType

class (Show rt, Eq rt, Ord rt, ExtTyped 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 FunReturns Source # 
Instance details

Defined in Futhark.IR.Mem

IsRetType DeclExtType Source # 
Instance details

Defined in Futhark.IR.RetType

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

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