Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module provides an efficient value representation as well as parsing and comparison functions.
Synopsis
- module Futhark.Data
- module Futhark.Data.Compare
- module Futhark.Data.Reader
- data Compound v
- = ValueRecord (Map Text (Compound v))
- | ValueTuple [Compound v]
- | ValueAtom v
- type CompoundValue = Compound Value
- mkCompound :: [Compound v] -> Compound v
- unCompound :: Compound v -> [Compound v]
Documentation
module Futhark.Data
module Futhark.Data.Compare
module Futhark.Data.Reader
The structure of a compound value, parameterised over the actual
values. For most cases you probably want CompoundValue
.
ValueRecord (Map Text (Compound v)) | |
ValueTuple [Compound v] | Must not be single value. |
ValueAtom v |
Instances
Foldable Compound Source # | |
Defined in Futhark.Test.Values 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 # elem :: Eq a => a -> Compound a -> Bool # maximum :: Ord a => Compound a -> a # minimum :: Ord a => Compound a -> a # | |
Traversable Compound Source # | |
Functor Compound Source # | |
Show v => Show (Compound v) Source # | |
Eq v => Eq (Compound v) Source # | |
Ord v => Ord (Compound v) Source # | |
Pretty v => Pretty (Compound v) Source # | |
Defined in Futhark.Test.Values |
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.