futhark-0.11.0: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Representation.AST.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.

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 attr => [rt] -> [Param attr] -> [(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.

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

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