Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Aeson.Flow
Description
Derive Flow types using aeson Options
.
- class Typeable a => FlowTyped a where
- type FlowType = Fix FlowTypeF
- newtype Fix f :: (* -> *) -> * = Fix (f (Fix f))
- data FlowTypeF a
- data FlowModuleOptions = FlowModuleOptions {
- flowPragmas :: [Text]
- flowHeader :: [Text]
- defaultFlowModuleOptions :: FlowModuleOptions
- data Export where
- generateFlowModule :: FlowModuleOptions -> [Export] -> Text
- writeFlowModule :: FlowModuleOptions -> FilePath -> [Export] -> IO ()
- exportFlowTypeAs :: Text -> FlowType -> Text
- showFlowType :: FlowType -> Text
- dependencies :: FlowTyped a => Proxy a -> Set FlowName
- defaultFlowType :: (Generic a, GFlowTyped (Rep a)) => Options -> Proxy a -> FlowType
- defaultFlowTypeName :: (Generic a, Rep a ~ D1 (MetaData name mod pkg t) c, KnownSymbol name) => Proxy a -> Maybe Text
- data FlowName where
- data PrimType
- class GFlowTyped g
- type FlowTypeI = Fix (Info `Compose` FlowTypeF)
- data Info a
- data Var :: k -> Type where
- class Typeable k a
- typeRep :: Typeable k a => proxy a -> TypeRep
AST types
class Typeable a => FlowTyped a where Source #
Methods
flowType :: Proxy a -> FlowType Source #
flowTypeName :: Proxy a -> Maybe Text Source #
flowTypeVars :: Proxy a -> [TypeRep] Source #
flowOptions :: Proxy a -> Options Source #
isPrim :: Proxy a -> Bool Source #
flowType :: (Generic a, GFlowTyped (Rep a)) => Proxy a -> FlowType Source #
flowTypeName :: (Generic a, Rep a ~ D1 (MetaData name mod pkg t) c, KnownSymbol name) => Proxy a -> Maybe Text Source #
Instances
The main AST for flowtypes.
Code generation
Wholesale ES6/flow modules
data FlowModuleOptions Source #
Constructors
FlowModuleOptions | |
Fields
|
Instances
generateFlowModule :: FlowModuleOptions -> [Export] -> Text Source #
writeFlowModule :: FlowModuleOptions -> FilePath -> [Export] -> IO () Source #
Utility functions
showFlowType :: FlowType -> Text Source #
Pretty-print a flowtype in flowtype syntax
dependencies :: FlowTyped a => Proxy a -> Set FlowName Source #
Compute all the dependencies of a FlowTyped
thing, including itself.
Internals
defaultFlowType :: (Generic a, GFlowTyped (Rep a)) => Options -> Proxy a -> FlowType Source #
defaultFlowTypeName :: (Generic a, Rep a ~ D1 (MetaData name mod pkg t) c, KnownSymbol name) => Proxy a -> Maybe Text Source #
flowTypeName
using Generic
A name for a flowtyped data-type. These are returned by dependencies
.
A primitive flow/javascript type
class GFlowTyped g Source #
Minimal complete definition
gflowType
Instances
(KnownSymbol name, GFlowVal * * c) => GFlowTyped (D1 (MetaData name mod pkg t) c) Source # | |
The class Typeable
allows a concrete representation of a type to
be calculated.
Minimal complete definition