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

Futhark.Test.Values

Description

This module provides an efficient value representation as well as parsing and comparison functions.

Synopsis

Documentation

data Compound v Source #

The structure of a compound value, parameterised over the actual values. For most cases you probably want CompoundValue.

Constructors

ValueRecord (Map Text (Compound v)) 
ValueTuple [Compound v]

Must not be single value.

ValueAtom v 

Instances

Instances details
Foldable Compound Source # 
Instance details

Defined in Futhark.Test.Values

Methods

fold :: Monoid m => Compound m -> m #

foldMap :: Monoid m => (a -> m) -> Compound a -> m #

foldMap' :: Monoid m => (a -> m) -> Compound a -> m #

foldr :: (a -> b -> b) -> b -> Compound a -> b #

foldr' :: (a -> b -> b) -> b -> Compound a -> b #

foldl :: (b -> a -> b) -> b -> Compound a -> b #

foldl' :: (b -> a -> b) -> b -> Compound a -> b #

foldr1 :: (a -> a -> a) -> Compound a -> a #

foldl1 :: (a -> a -> a) -> Compound a -> a #

toList :: Compound a -> [a] #

null :: Compound a -> Bool #

length :: Compound a -> Int #

elem :: Eq a => a -> Compound a -> Bool #

maximum :: Ord a => Compound a -> a #

minimum :: Ord a => Compound a -> a #

sum :: Num a => Compound a -> a #

product :: Num a => Compound a -> a #

Traversable Compound Source # 
Instance details

Defined in Futhark.Test.Values

Methods

traverse :: Applicative f => (a -> f b) -> Compound a -> f (Compound b) #

sequenceA :: Applicative f => Compound (f a) -> f (Compound a) #

mapM :: Monad m => (a -> m b) -> Compound a -> m (Compound b) #

sequence :: Monad m => Compound (m a) -> m (Compound a) #

Functor Compound Source # 
Instance details

Defined in Futhark.Test.Values

Methods

fmap :: (a -> b) -> Compound a -> Compound b #

(<$) :: a -> Compound b -> Compound a #

Show v => Show (Compound v) Source # 
Instance details

Defined in Futhark.Test.Values

Methods

showsPrec :: Int -> Compound v -> ShowS #

show :: Compound v -> String #

showList :: [Compound v] -> ShowS #

Eq v => Eq (Compound v) Source # 
Instance details

Defined in Futhark.Test.Values

Methods

(==) :: Compound v -> Compound v -> Bool #

(/=) :: Compound v -> Compound v -> Bool #

Ord v => Ord (Compound v) Source # 
Instance details

Defined in Futhark.Test.Values

Methods

compare :: Compound v -> Compound v -> Ordering #

(<) :: Compound v -> Compound v -> Bool #

(<=) :: Compound v -> Compound v -> Bool #

(>) :: Compound v -> Compound v -> Bool #

(>=) :: Compound v -> Compound v -> Bool #

max :: Compound v -> Compound v -> Compound v #

min :: Compound v -> Compound v -> Compound v #

Pretty v => Pretty (Compound v) Source # 
Instance details

Defined in Futhark.Test.Values

Methods

pretty :: Compound v -> Doc ann #

prettyList :: [Compound v] -> Doc ann #

type CompoundValue = Compound Value Source #

Like a Value, but also grouped in compound ways that are not supported by raw values. You cannot parse or read these in standard ways, and they cannot be elements of arrays.

mkCompound :: [Compound v] -> Compound v Source #

Create a tuple for a non-unit list, and otherwise a ValueAtom

unCompound :: Compound v -> [Compound v] Source #

If the value is a tuple, extract the components, otherwise return a singleton list of the value.

Orphan instances

Pretty Value Source # 
Instance details

Methods

pretty :: Value -> Doc ann #

prettyList :: [Value] -> Doc ann #

Pretty ValueType Source # 
Instance details

Methods

pretty :: ValueType -> Doc ann #

prettyList :: [ValueType] -> Doc ann #