generic-accessors-0.6.2.0: stringly-named getters for generic data

Safe HaskellNone
LanguageHaskell2010

Accessors

Synopsis

Documentation

class Lookup a where Source #

Things which you can make a tree of labeled getters for. You should derive this using GHC.Generics.

data GAData a Source #

Constructors

GAData String (GAConstructor a) 

Instances

Show (GAData a) Source # 

Methods

showsPrec :: Int -> GAData a -> ShowS #

show :: GAData a -> String #

showList :: [GAData a] -> ShowS #

data GASimpleEnum a Source #

Constructors

GASimpleEnum 

Fields

data GAField a Source #

Constructors

FieldDouble (Lens' a Double) 
FieldFloat (Lens' a Float) 
FieldInt (Lens' a Int) 
FieldString (Lens' a String) 
FieldSorry

a field which is not yet supported

describeGAField :: GAField a -> String Source #

Return the type of field, such as Bool, Double, String, etc.

sameFieldType :: GAField a -> GAField b -> Bool Source #

Returns True if the type of fields is the same.

showTree :: AccessorTree a -> (Double -> String) -> a -> String Source #

Show a tree of values

showFlat :: forall a. AccessorTree a -> Bool -> (Double -> String) -> a -> String Source #

Show a list of values . True --> align the colums, False --> total mayhem

class GLookup f where Source #

Minimal complete definition

gtoAccessorTree

Methods

gtoAccessorTree :: Lens' b (f a) -> AccessorTree b Source #

Instances

Lookup f => GLookup (Rec0 * f) Source # 
(Datatype Meta d, Constructor Meta c, GLookupS a) => GLookup (D1 * d (C1 * c a)) Source # 

Methods

gtoAccessorTree :: Lens' b (D1 * d (C1 * c a) a) -> AccessorTree b Source #

(Datatype Meta d, GEnum ((:+:) * c1 c2)) => GLookup (D1 * d ((:+:) * c1 c2)) Source # 

Methods

gtoAccessorTree :: Lens' b (D1 * d ((* :+: c1) c2) a) -> AccessorTree b Source #