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

Safe HaskellNone
LanguageHaskell2010

Futhark.Test.Values

Contents

Description

This module defines an efficient value representation as well as parsing and comparison functions. This is because the standard Futhark parser is not able to cope with large values (like arrays that are tens of megabytes in size). The representation defined here does not support tuples, so don't use those as input/output for your test programs.

Synopsis

Documentation

data Value Source #

An efficiently represented Futhark value. Use pretty to get a human-readable representation, and the instances of Get and Put to obtain binary representations

Instances
Show Value Source # 
Instance details

Defined in Futhark.Test.Values

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

Binary Value Source # 
Instance details

Defined in Futhark.Test.Values

Methods

put :: Value -> Put #

get :: Get Value #

putList :: [Value] -> Put #

Pretty Value Source # 
Instance details

Defined in Futhark.Test.Values

Methods

ppr :: Value -> Doc #

pprPrec :: Int -> Value -> Doc #

pprList :: [Value] -> Doc #

valueType :: Value -> String Source #

A textual description of the type of a value. Follows Futhark type notation, and contains the exact dimension sizes if an array.

Reading Values

readValues :: ByteString -> Maybe [Value] Source #

Parse Futhark values from the given bytestring.

Comparing Values

compareValues :: [Value] -> [Value] -> Maybe [Mismatch] Source #

Compare two sets of Futhark values for equality. Shapes and types must also match.

data Mismatch Source #

Two values differ in some way.

Instances
Show Mismatch Source # 
Instance details

Defined in Futhark.Test.Values

explainMismatch :: (Show i, Pretty a) => i -> String -> a -> a -> String Source #

A human-readable description of how two values are not the same.