Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type DTree = Either DField DData
- data DData = DData String DConstructor
- data DConstructor
- = DConstructor String [(Maybe String, DTree)]
- | DSum DSimpleEnum
- data DSimpleEnum = DSimpleEnum [String] Int
- data DField
- toDData :: forall a. Lookup a => a -> DTree
- updateLookupable :: Lookup a => a -> DTree -> Either String a
- describeDField :: DField -> String
- sameDFieldType :: DField -> DField -> Bool
- denumToString :: DSimpleEnum -> Either String String
- denumToStringOrMsg :: DSimpleEnum -> String
- denumSetString :: DSimpleEnum -> String -> Either String DSimpleEnum
- denumSetIndex :: DSimpleEnum -> Int -> Either String DSimpleEnum
Documentation
data DConstructor Source #
data DSimpleEnum Source #
a dynamic field
updateLookupable :: Lookup a => a -> DTree -> Either String a Source #
Update something using a dynamic representation
describeDField :: DField -> String Source #
some utility functions for working with DSimpleEnums
denumToString :: DSimpleEnum -> Either String String Source #
Get the constructor string or an error message.
denumToStringOrMsg :: DSimpleEnum -> String Source #
Get the constructor string or an error message without telling which is which.
denumSetString :: DSimpleEnum -> String -> Either String DSimpleEnum Source #
Try to update an enum with its constructor. Fail if not a valid constructor.
denumSetIndex :: DSimpleEnum -> Int -> Either String DSimpleEnum Source #
Try to update an enum with its index. Fail if out of bounds.