Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Lookup a where
- toAccessorTree :: Lens' b a -> AccessorTree b
- type AccessorTree a = Either (GAField a) (GAData a)
- data GAData a = GAData String (GAConstructor a)
- data GAConstructor a
- = GAConstructor String [(Maybe String, AccessorTree a)]
- | GASum (GASimpleEnum a)
- data GASimpleEnum a = GASimpleEnum {
- eConstructors :: [String]
- eToString :: a -> String
- eToIndex :: a -> Int
- eFromString :: a -> String -> Either String a
- eFromIndex :: a -> Int -> Either String a
- data GAField a
- = FieldDouble (Lens' a Double)
- | FieldFloat (Lens' a Float)
- | FieldInt8 (Lens' a Int8)
- | FieldInt16 (Lens' a Int16)
- | FieldInt32 (Lens' a Int32)
- | FieldInt64 (Lens' a Int64)
- | FieldWord8 (Lens' a Word8)
- | FieldWord16 (Lens' a Word16)
- | FieldWord32 (Lens' a Word32)
- | FieldWord64 (Lens' a Word64)
- | FieldString (Lens' a String)
- | FieldUnit
- | FieldSorry
- data GATip a
- = GATipSimpleEnum (GASimpleEnum a)
- | GATipField (GAField a)
- accessors :: Lookup a => AccessorTree a
- describeGAField :: GAField a -> String
- sameFieldType :: GAField a -> GAField b -> Bool
- flatten :: AccessorTree a -> [(String, GATip a)]
- flatten' :: AccessorTree a -> [([Maybe String], GATip a)]
- showTree :: AccessorTree a -> (Double -> String) -> a -> String
- showFlat :: forall a. AccessorTree a -> Bool -> (Double -> String) -> a -> String
- class GLookup f where
- gtoAccessorTree :: Lens' b (f a) -> AccessorTree b
Documentation
Things which you can make a tree of labeled getters for. You should derive this using GHC.Generics.
Nothing
toAccessorTree :: Lens' b a -> AccessorTree b Source #
default toAccessorTree :: (Generic a, GLookup (Rep a)) => Lens' b a -> AccessorTree b Source #
Instances
data GAConstructor a Source #
GAConstructor String [(Maybe String, AccessorTree a)] | |
GASum (GASimpleEnum a) |
data GASimpleEnum a Source #
GASimpleEnum | |
|
FieldDouble (Lens' a Double) | |
FieldFloat (Lens' a Float) | |
FieldInt8 (Lens' a Int8) | |
FieldInt16 (Lens' a Int16) | |
FieldInt32 (Lens' a Int32) | |
FieldInt64 (Lens' a Int64) | |
FieldWord8 (Lens' a Word8) | |
FieldWord16 (Lens' a Word16) | |
FieldWord32 (Lens' a Word32) | |
FieldWord64 (Lens' a Word64) | |
FieldString (Lens' a String) | |
FieldUnit | |
FieldSorry | a field which is not yet supported |
GATipSimpleEnum (GASimpleEnum a) | |
GATipField (GAField a) |
accessors :: Lookup a => AccessorTree a Source #
describeGAField :: GAField a -> String Source #
sameFieldType :: GAField a -> GAField b -> Bool Source #
Returns True if the type of fields is the same.
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 #
gtoAccessorTree :: Lens' b (f a) -> AccessorTree b Source #
Instances
Lookup f => GLookup (Rec0 f) Source # | |
Defined in Accessors.Accessors gtoAccessorTree :: Lens' b (Rec0 f a) -> AccessorTree b Source # | |
(Datatype d, Constructor c, GLookupS a) => GLookup (D1 d (C1 c a)) Source # | |
Defined in Accessors.Accessors gtoAccessorTree :: Lens' b (D1 d (C1 c a) a0) -> AccessorTree b Source # | |
(Datatype d, GEnum (c1 :+: c2)) => GLookup (D1 d (c1 :+: c2)) Source # | |
Defined in Accessors.Accessors gtoAccessorTree :: Lens' b (D1 d (c1 :+: c2) a) -> AccessorTree b Source # |