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

Futhark.IR.Prop.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

Instances details
IsValue Bool Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

Methods

value :: Bool -> PrimValue Source #

IsValue Double Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Float Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Int8 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

Methods

value :: Int8 -> PrimValue Source #

IsValue Int16 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Int32 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Int64 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Word8 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Word16 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Word32 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue Word64 Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue PrimValue Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue FloatValue Source # 
Instance details

Defined in Futhark.IR.Prop.Constants

IsValue IntValue Source # 
Instance details

Defined in Futhark.IR.Prop.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.