Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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 #