Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Safe HaskellNone

Util.PrettyGeneric

Contents

Description

Functions to convert a G.Generic data type to a Value and pretty print a Value.

TODO Value could also be used for a generic diff.

Synopsis

Documentation

data Value Source #

Constructors

Prim !String 
Data !Constructor 

Instances

data Constructor Source #

Constructor name [field].

Constructors

Constructor !String ![Field] 

data Field Source #

Field name value. The name is "" for unnamed fields.

Constructors

Field 

Fields

Instances

functions on Value

makePretty Source #

Arguments

:: (Text -> Text)

applied to field labels, to strip prefixes

-> Value 
-> Doc 

Make a Pretty instance for a record type.

class Extract a where Source #

Methods

extract :: a -> Value Source #

extract :: (G.Generic a, ExtractData (G.Rep a)) => a -> Value Source #