| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.PureScript.Bridge.Printer
Synopsis
- data Module (lang :: Language) = PSModule {
- psModuleName :: !Text
- psImportLines :: !(Map Text ImportLine)
- psTypes :: ![SumType lang]
- type PSModule = Module PureScript
- data ImportLine = ImportLine {
- importModule :: !Text
- importTypes :: !(Set Text)
- type Modules = Map Text PSModule
- type ImportLines = Map Text ImportLine
- printModule :: Settings -> FilePath -> PSModule -> IO ()
- sumTypesToNeededPackages :: [SumType lang] -> Set Text
- sumTypeToNeededPackages :: SumType lang -> Set Text
- moduleToText :: Settings -> Module PureScript -> Text
- _lensImports :: [ImportLine]
- _noLensImports :: [ImportLine]
- importLineToText :: ImportLine -> Text
- sumTypeToText :: Settings -> SumType PureScript -> Text
- sumTypeToTypeDecls :: SumType PureScript -> Text
- instances :: SumType PureScript -> [Text]
- sumTypeToOptics :: SumType PureScript -> Text
- constructorOptics :: SumType PureScript -> Text
- recordOptics :: SumType PureScript -> Text
- constructorToText :: Int -> DataConstructor PureScript -> Text
- spaces :: Int -> Text
- typeNameAndForall :: TypeInfo PureScript -> (Text, Text)
- fromEntries :: (RecordEntry a -> Text) -> [RecordEntry a] -> Text
- mkFnArgs :: [RecordEntry PureScript] -> Text
- mkTypeSig :: [RecordEntry PureScript] -> Text
- constructorToOptic :: Bool -> TypeInfo PureScript -> DataConstructor PureScript -> Text
- recordEntryToLens :: SumType PureScript -> RecordEntry PureScript -> Text
- recordEntryToText :: RecordEntry PureScript -> Text
- typeInfoToText :: Bool -> PSType -> Text
- sumTypesToModules :: Modules -> [SumType PureScript] -> Modules
- sumTypeToModule :: SumType PureScript -> Modules -> Modules
- typesToImportLines :: ImportLines -> Set PSType -> ImportLines
- typeToImportLines :: PSType -> ImportLines -> ImportLines
- importsFromList :: [ImportLine] -> Map Text ImportLine
- mergeImportLines :: ImportLines -> ImportLines -> ImportLines
- unlessM :: Monad m => m Bool -> m () -> m ()
Documentation
data Module (lang :: Language) #
Constructors
| PSModule | |
Fields
| |
type PSModule = Module PureScript #
data ImportLine #
Constructors
| ImportLine | |
Fields
| |
Instances
| Show ImportLine # | |
Defined in Language.PureScript.Bridge.Printer Methods showsPrec :: Int -> ImportLine -> ShowS # show :: ImportLine -> String # showList :: [ImportLine] -> ShowS # | |
type ImportLines = Map Text ImportLine #
sumTypesToNeededPackages :: [SumType lang] -> Set Text #
sumTypeToNeededPackages :: SumType lang -> Set Text #
moduleToText :: Settings -> Module PureScript -> Text #
_lensImports :: [ImportLine] #
_noLensImports :: [ImportLine] #
importLineToText :: ImportLine -> Text #
sumTypeToText :: Settings -> SumType PureScript -> Text #
sumTypeToTypeDecls :: SumType PureScript -> Text #
instances :: SumType PureScript -> [Text] #
Given a Purescript type, generate `derive instance` lines for typeclass instances it claims to have.
sumTypeToOptics :: SumType PureScript -> Text #
constructorOptics :: SumType PureScript -> Text #
recordOptics :: SumType PureScript -> Text #
constructorToText :: Int -> DataConstructor PureScript -> Text #
typeNameAndForall :: TypeInfo PureScript -> (Text, Text) #
fromEntries :: (RecordEntry a -> Text) -> [RecordEntry a] -> Text #
mkFnArgs :: [RecordEntry PureScript] -> Text #
mkTypeSig :: [RecordEntry PureScript] -> Text #
constructorToOptic :: Bool -> TypeInfo PureScript -> DataConstructor PureScript -> Text #
recordEntryToLens :: SumType PureScript -> RecordEntry PureScript -> Text #
typeInfoToText :: Bool -> PSType -> Text #
sumTypesToModules :: Modules -> [SumType PureScript] -> Modules #
sumTypeToModule :: SumType PureScript -> Modules -> Modules #
typesToImportLines :: ImportLines -> Set PSType -> ImportLines #
typeToImportLines :: PSType -> ImportLines -> ImportLines #
importsFromList :: [ImportLine] -> Map Text ImportLine #
mergeImportLines :: ImportLines -> ImportLines -> ImportLines #