-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Generate PureScript data types from Haskell data types
--
-- Generate PureScript data types from Haskell data types
@package purescript-bridge
@version 0.1.0.0
module PureScript.Bridge.TypeInfo
type TypeBridge = TypeInfo -> Maybe TypeInfo
data TypeInfo
TypeInfo :: Text -> Text -> Text -> [TypeInfo] -> TypeInfo
-- | Hackage package
[typePackage] :: TypeInfo -> Text
-- | Full Module path
[typeModule] :: TypeInfo -> Text
[typeName] :: TypeInfo -> Text
[typeParameters] :: TypeInfo -> [TypeInfo]
mkTypeInfo :: Typeable t => Proxy t -> TypeInfo
mkTypeInfo' :: TypeRep -> TypeInfo
eqTypeName :: Text -> TypeInfo -> Bool
instance GHC.Show.Show PureScript.Bridge.TypeInfo.TypeInfo
instance GHC.Classes.Eq PureScript.Bridge.TypeInfo.TypeInfo
module PureScript.Bridge.Tuple
data TupleParserState
Start :: TupleParserState
OpenFound :: TupleParserState
ColonFound :: TupleParserState
Tuple :: TupleParserState
NoTuple :: TupleParserState
tupleBridge :: TypeBridge
step :: TupleParserState -> Char -> TupleParserState
isTuple :: Text -> Bool
instance GHC.Show.Show PureScript.Bridge.Tuple.TupleParserState
instance GHC.Classes.Eq PureScript.Bridge.Tuple.TupleParserState
module PureScript.Bridge.Primitives
intBridge :: TypeBridge
stringBridge :: TypeBridge
listBridge :: TypeBridge
maybeBridge :: TypeBridge
eitherBridge :: TypeBridge
module PureScript.Bridge.SumType
data SumType
SumType :: TypeInfo -> [DataConstructor] -> SumType
data DataConstructor
DataConstructor :: Text -> Either [TypeInfo] [RecordEntry] -> DataConstructor
[sigConstructor] :: DataConstructor -> Text
[sigValues] :: DataConstructor -> Either [TypeInfo] [RecordEntry]
data RecordEntry
RecordEntry :: Text -> TypeInfo -> RecordEntry
[recLabel] :: RecordEntry -> Text
[recValue] :: RecordEntry -> TypeInfo
toSumType :: (Generic t, Typeable t, GDataConstructor (Rep t)) => Proxy t -> SumType
class GDataConstructor f
gToConstructors :: GDataConstructor f => f a -> [DataConstructor]
class GRecordEntry f
gToRecordEntries :: GRecordEntry f => f a -> [RecordEntry]
getUsedTypes :: SumType -> [TypeInfo]
constructorToType :: DataConstructor -> [TypeInfo] -> [TypeInfo]
flattenTypeInfo :: TypeInfo -> [TypeInfo]
instance GHC.Show.Show PureScript.Bridge.SumType.SumType
instance GHC.Show.Show PureScript.Bridge.SumType.DataConstructor
instance GHC.Show.Show PureScript.Bridge.SumType.RecordEntry
instance (GHC.Generics.Datatype a, PureScript.Bridge.SumType.GDataConstructor c) => PureScript.Bridge.SumType.GDataConstructor (GHC.Generics.D1 a c)
instance (PureScript.Bridge.SumType.GDataConstructor a, PureScript.Bridge.SumType.GDataConstructor b) => PureScript.Bridge.SumType.GDataConstructor (a GHC.Generics.:+: b)
instance (GHC.Generics.Constructor a, PureScript.Bridge.SumType.GRecordEntry b) => PureScript.Bridge.SumType.GDataConstructor (GHC.Generics.C1 a b)
instance (PureScript.Bridge.SumType.GRecordEntry a, PureScript.Bridge.SumType.GRecordEntry b) => PureScript.Bridge.SumType.GRecordEntry (a GHC.Generics.:*: b)
instance PureScript.Bridge.SumType.GRecordEntry GHC.Generics.U1
instance (GHC.Generics.Selector a, Data.Typeable.Internal.Typeable t) => PureScript.Bridge.SumType.GRecordEntry (GHC.Generics.S1 a (GHC.Generics.K1 GHC.Generics.R t))
module PureScript.Bridge.Printer
data PSModule
PSModule :: Text -> Map Text ImportLine -> [SumType] -> PSModule
[psModuleName] :: PSModule -> Text
[psImportLines] :: PSModule -> Map Text ImportLine
[psTypes] :: PSModule -> [SumType]
data ImportLine
ImportLine :: Text -> Set Text -> ImportLine
[importModule] :: ImportLine -> Text
[importTypes] :: ImportLine -> Set Text
type Modules = Map Text PSModule
type ImportLines = Map Text ImportLine
printModule :: FilePath -> PSModule -> IO ()
moduleToText :: PSModule -> Text
importLineToText :: ImportLine -> Text
sumTypeToText :: SumType -> Text
constructorToText :: Int -> DataConstructor -> Text
recordEntryToText :: RecordEntry -> Text
typeInfoToText :: TypeInfo -> Text
sumTypesToModules :: Modules -> [SumType] -> Modules
sumTypeToModule :: SumType -> Modules -> Modules
typesToImportLines :: ImportLines -> [TypeInfo] -> ImportLines
typeToImportLines :: TypeInfo -> ImportLines -> ImportLines
instance GHC.Show.Show PureScript.Bridge.Printer.PSModule
instance GHC.Show.Show PureScript.Bridge.Printer.ImportLine
module PureScript.Bridge
bridgeSumType :: TypeBridge -> SumType -> SumType
-- | Default bridge for mapping primitive/common types: | You can append
-- your own bridges like this: | defaultBridge | myBridge1
-- | myBridge2
defaultBridge :: TypeBridge