sifflet-lib-1.0: Library of modules shared by sifflet and its tests and its exporters.Source codeContentsIndex
Sifflet.Text.Repr
Synopsis
class Repr a where
repr :: a -> String
reprl :: a -> [String]
reprs :: a -> String
reprList :: String -> String -> String -> [a] -> String
data Name = Name String
Documentation
class Repr a whereSource

class Repr: representable by a String or a list of Strings

repr x is a String representation of x. reprl x is a [String] representation of x, where the first element should be the same as repr x, and the rest provide auxiliary information that you want to be shown with x. reprs x is a reduction of reprl x to a single String. reprList prefix infix postfix xs is the representation of a list of xs

Minimal complete implementation: define repr, or define reprl. The normal way is to define repr. Define reprl instead, if for some reason you want to include additional information such as the value of an expression in an expression node.

Examples: - (3 :: Int) has repr => 3, reprl => [3], reprs => 3 - In Sifflet.Language.Expr, (ENode (NSymbol x) (EvalOk (3 :: Int) has reprl => [x, 3], reprs => x 3, and repr => x. - reprList ( ) [3 :: Int, 4, 5] => (3 4 5)

Methods
repr :: a -> StringSource
reprl :: a -> [String]Source
reprs :: a -> StringSource
reprList :: String -> String -> String -> [a] -> StringSource
show/hide Instances
data Name Source
Constructors
Name String
show/hide Instances
Produced by Haddock version 2.6.1