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

Safe HaskellNone
LanguageHaskell2010

Futhark.Representation.AST.Attributes.Constants

Description

Possibly convenient facilities for constructing constants.

Synopsis

Documentation

class IsValue a where Source #

If a Haskell type is an instance of IsValue, it means that a value of that type can be converted to a Futhark PrimValue. This is intended to cut down on boilerplate when writing compiler code - for example, you'll quickly grow tired of writing Constant (LogVal True) loc.

Methods

value :: a -> PrimValue Source #

Instances
IsValue Bool Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

Methods

value :: Bool -> PrimValue Source #

IsValue Double Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Float Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Int Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

Methods

value :: Int -> PrimValue Source #

IsValue Int8 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

Methods

value :: Int8 -> PrimValue Source #

IsValue Int16 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Int32 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Int64 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Word8 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Word16 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Word32 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue Word64 Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue PrimValue Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue FloatValue Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

IsValue IntValue Source # 
Instance details

Defined in Futhark.Representation.AST.Attributes.Constants

constant :: IsValue v => v -> SubExp Source #

Create a Constant SubExp containing the given value.

intConst :: IntType -> Integer -> SubExp Source #

Utility definition for reasons of type ambiguity.

floatConst :: FloatType -> Double -> SubExp Source #

Utility definition for reasons of type ambiguity.