recalc-engine
Safe HaskellSafe-Inferred
LanguageGHC2021

Recalc.EngineSpec

Description

Implements a simple calculator language and uses it instantiate the Recalc interface. Use this language to validate the spreadsheet engine.

Synopsis

Documentation

run :: [[(CellAddr, Maybe String)]] -> (ResultsOf Term, EngineStateOf Term) Source #

evalSheet all inputs in sequence

evalSheet :: [[(CellAddr, Maybe String)]] -> [(CellAddr, Int)] Source #

evalSheet inputs in sequence and prepare Results for hspec

spec :: Spec Source #

the specification checks a few (single-document, single-sheet) examples to make sure results are expected (incl. making sure dependencies are resolved)

data SheetRef Source #

when referencing a cell, the uri and sheetName can be omited (defaults to "current" sheet)

Constructors

Explicit 

Fields

Implicit 

Fields

Instances

Instances details
Show SheetRef Source # 
Instance details

Defined in Recalc.EngineSpec

Pretty SheetRef Source # 
Instance details

Defined in Recalc.EngineSpec

Methods

pretty :: SheetRef -> Doc ann #

prettyList :: [SheetRef] -> Doc ann #

data Term Source #

a simple term language

Instances

Instances details
Show Term Source # 
Instance details

Defined in Recalc.EngineSpec

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

Pretty Term Source # 
Instance details

Defined in Recalc.EngineSpec

Methods

pretty :: Term -> Doc ann #

prettyList :: [Term] -> Doc ann #

Recalc Term Source # 
Instance details

Defined in Recalc.EngineSpec

Associated Types

type EnvOf Term #

type ErrorOf Term #

type ElaborationOf Term #

type TypeOf Term #

type ValueOf Term #

type ElaborationOf Term Source # 
Instance details

Defined in Recalc.EngineSpec

type EnvOf Term Source # 
Instance details

Defined in Recalc.EngineSpec

type EnvOf Term = ()
type ErrorOf Term Source # 
Instance details

Defined in Recalc.EngineSpec

type ErrorOf Term = ()
type TypeOf Term Source # 
Instance details

Defined in Recalc.EngineSpec

type TypeOf Term = ()
type ValueOf Term Source # 
Instance details

Defined in Recalc.EngineSpec

formulaP :: Parser Term Source #

simple parser, does not deal with lexing (whitespaces might break things)

Orphan instances

IsString (Maybe String) Source #

use "" for cell deletion and others for new input

Instance details