provenience-0.1.2.2: Computations that automatically track data dependencies
Copyright(c) Olaf Klinke
LicenseGPL-3
Maintainerolaf.klinke@phymetric.de
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Representation

Description

Haskell has no dependent types, whence we can store only one type of value at each node of the data dependency graph. If in addition to Pandoc you want to extract the data in a machine-readable format, then set the alt type parameter of your Provenience actions accordingly and provide Representation instances for all your variable values. Each call to render or renderWith automatically invokes a call to representation.

In order to keep the dependency list of this package small beyond the dependencies of pandoc, we have omitted many useful instances. Add your own instances as you see fit, for example

instance Serializable a => Representation a ByteString where
    representation = toByteString

For spreadsheet-like representations,

  • basic values become single cells in a single row,
  • foldable structures of basic values become single columns,
  • doubly-nested structures of basic values become proper tables.
Synopsis

Documentation

class Representation a b where Source #

A representation of type a as type b, not necessarily invertible.

Methods

representation :: a -> b Source #

Instances

Instances details
Representation a () Source #

Dummy instance when no alternative representation is required. representation = const ()

Instance details

Defined in Data.Representation

Methods

representation :: a -> () Source #

ToMarkup a => Representation a Markup Source #

Representation via blaze

Instance details

Defined in Data.Representation

Methods

representation :: a -> Markup Source #

ToJSON a => Representation a Value Source #

Representation as JSON Values

Instance details

Defined in Data.Representation

Methods

representation :: a -> Value Source #

Show a => Representation a String Source #

The Prelude provides a String representation

Instance details

Defined in Data.Representation

Methods

representation :: a -> String Source #

ToRow StaticCellValue row => Representation Bool (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: Bool -> Seq row Source #

(ToRow StaticCellValue row, Real a) => Representation a (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: a -> Seq row Source #

ToRow StaticCellValue row => Representation String (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: String -> Seq row Source #

ToRow StaticCellValue row => Representation ZonedTime (Seq row) Source # 
Instance details

Defined in Data.Representation

ToRow StaticCellValue row => Representation (Ratio Integer) (Seq row) Source # 
Instance details

Defined in Data.Representation

(Foldable r, ToRow StaticCellValue row, Traversable c) => Representation (r (c ZonedTime)) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: r (c ZonedTime) -> Seq row Source #

(Foldable r, ToRow StaticCellValue row, Traversable c) => Representation (r (c Bool)) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: r (c Bool) -> Seq row Source #

(Foldable r, ToRow StaticCellValue row, Traversable c) => Representation (r (c String)) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: r (c String) -> Seq row Source #

(Foldable r, ToRow StaticCellValue row, Traversable c, Real a) => Representation (r (c a)) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: r (c a) -> Seq row Source #

(Foldable f, ToRow StaticCellValue row) => Representation (f ZonedTime) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: f ZonedTime -> Seq row Source #

(Foldable f, ToRow StaticCellValue row) => Representation (f Bool) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: f Bool -> Seq row Source #

(Foldable f, ToRow StaticCellValue row) => Representation (f String) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: f String -> Seq row Source #

(Foldable f, ToRow StaticCellValue row, Real a) => Representation (f a) (Seq row) Source # 
Instance details

Defined in Data.Representation

Methods

representation :: f a -> Seq row Source #