h&:)3      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                         Safe-Inferred purescript-bridgeyou can ( switches to control the code generationpurescript-bridge$General settings for code generationpurescript-bridge6use purescript-profunctor-lens for generated PS-types? purescript-bridgegenerate generics using purescript-generics-rep instead of purescript-generics purescript-bridgegenerate Data.Argonaut.Decode.Class EncodeJson and DecodeJson instances purescript-bridge4generate Foreign.Generic Encode and Decode instances purescript-bridgeSettings to generate Lenses purescript-bridge Translate switches into settingspurescript-bridge3Default switches include code generation for lensespurescript-bridge0Switch off the generatation of profunctor-lensespurescript-bridge.Switch off the generatation of argonaut-codecspurescript-bridge/Switch on the generatation of profunctor-lensespurescript-bridge/Generate generics using purescript-generics-reppurescript-bridge+Generate generics using purescript-generics     Safe-Inferred"1 Cpurescript-bridgeBasic info about a data type:purescript-bridgeHackage packagepurescript-bridgeFull Module path'purescript-bridge:Types that have a lens for accessing a 'TypeInfo Haskell'.)purescript-bridgeFor convenience:*purescript-bridgeFor convenience:1purescript-bridge1Put the TypeInfo in a list together with all its   (recursively)2purescript-bridgeSimple  instance: Get the  itself. !"#'()*+,-./01 *)/0!"#-+,.'(1 Safe-Inferred "1 5purescript-bridgee.g. runState for State9purescript-bridgee.g. / for ;purescript-bridgePurescript typeclass instances that can be generated for your Haskell types.Dpurescript-bridge-Generic representation of your Haskell types.Fpurescript-bridgeTypInfo lens for D.Gpurescript-bridgeDataConstructor lens for D.Hpurescript-bridgeCreate a representation of your sum (and product) types, for doing type translations and writing it out to your PureScript modules. In order to get the type information we use a dummy variable of type  (YourType).Ipurescript-bridgeThe Purescript typeclass A might be derivable if the original Haskell type was a simple type wrapper.Jpurescript-bridgeEnsure that an ;% instance is generated for your type.Kpurescript-bridgeEnsure that both ; and ;' instances are generated for your type.Lpurescript-bridge!Get all used types in a sum type.This includes all types found at the right hand side of a sum type definition, not the type parameters of the sum type itself345678:9;@BCA<>=?DEFGHIJKLM\]^_DEHJK78:93456;@BCA<>=?ILM\]FG^_ Safe-Inferred"%&1ypurescript-bridgeGiven a Purescript type, generate instances for typeclass instances it claims to have.6`abfedcghlkjimnopqrstuvwxyz{|}~6hlkjigbfedca`mnopqrstuvwxyz{|}~ Safe-Inferred "1 >purescript-bridgeThe Haskell type to translate.purescript-bridgeReference to the bridge itself, needed for translation of type constructors.purescript-bridgeBridges to use when a  returns  (See ).It is similar to BridgeBuilder but does not offer choice or failure. It is used for constructing fallbacks if a  evaluates to .6For type definitions you should use the more generic ( 8 m) constraint. This way your code will work in both  and : {-# LANGUAGE FlexibleContexts #-} import Control.Monad.Reader.Class import Language.PureScript.Bridge.TypeInfopurescript-bridgeLens for access to the complete bridge from within our Reader monad.*This is used for example for implementing .purescript-bridge0Bridge to PureScript by simply clearing out the - field. This bridge is used by default as  by : :buildBridge = buildBridgeWithCustomFixUp clearPackageFixUpThus, if no bridge matches a type, it gets optimistically translated to a PureScript type which is idential to the Haskell type. Only the  field gets cleared, as it is very unlikely that the PureScript package is called the same as the Haskell package.Alternatively, if you are not that optimistic, you can use errorFixUp - which simply calls  when used. 0buildBridgeWithCustomFixUp errorFixUp yourBridge&Of course you can also write your own . It works the same as for , but you can not have choice () or failure ().purescript-bridgeA  which calles  when used. Usage: 0buildBridgeWithCustomFixUp errorFixUp yourBridgepurescript-bridgeBuild a bridge."This is a convenience wrapper for # and should normally be sufficient. Definition: ,buildBridgeWithCustomFixUp clearPackageFixUppurescript-bridge>Takes a constructed BridgePart and makes it a total function () by using the supplied  when  returns .purescript-bridge0Translate types that come from any module named Something.TypeParameters to lower case:Also drop the 1 at the end if present. This method gets called by  and buildBridgeWithCustomFixUp for you - you should not need to call it.It enables you to even bridge type constructor definitions, see )Language.PureScript.Bridge.TypeParameters for more details.purescript-bridgeDo some check on properties of (.purescript-bridgeCheck parts of ( for equality: textBridge :: BridgePart textBridge = do typeName ^== "Text" typeModule ^== "Data.Text.Internal" <|> typeModule ^== "Data.Text.Internal.Lazy" return psStringpurescript-bridgeBridge ( . over to PureScript types.*To be used for bridging type constructors.purescript-bridgeBy implementing the ( lens in the HasHaskType class, we are able to use it for both  and a plain )#, therefore you can use it with  and  for checks on the complete ) value.Example: stringBridge :: BridgePart stringBridge = do -- Note: we are using the HaskellType instance here: haskType ^== mkTypeInfo (Proxy :: Proxy String) return psStringpurescript-bridgeAlternative instance for BridgeBuilder so you can construct bridges with ", which behaves like a logical  (). If the left-hand side results in Nothing the right-hand side is used, otherwise the left-hand side. For usage examples see %Language.PureScript.Bridge.Primitives.4 Safe-Inferred"1!purescript-bridgeUses type parameters from ( (bridged).purescript-bridgeUses type parameters from ( (bridged).purescript-bridgeUses type parameters from ( (bridged).purescript-bridgeUses type parameters from ( (bridged). Safe-Inferred"1")   Safe-Inferred"1"purescript-bridge)Dummy bridge, translates every type with   Safe-Inferred"11&purescript-bridgeYour entry point to this library and quite likely all you will need. Make sure all your types derive @ and Typeable-. Typeable is not needed from ghc-7.10 on.Then list all your types you want to use in PureScript and call : data Foo = Foo { ... } deriving (Eq, Generic) data Bar = A | B | C deriving (Eq, Ord, Generic) data Baz = ... deriving (Generic) -- | All types will have a `Generic` instance produced in Purescript. myTypes :: [SumType 'Haskell] myTypes = [ let p = (Proxy :: Proxy Foo) in equal p (mkSumType p) -- Also produce a `Eq` instance. , let p = (Proxy :: Proxy Bar) in order p (mkSumType p) -- Produce both `Eq` and `Ord`. , mkSumType (Proxy :: Proxy Baz) -- Just produce a `Generic` instance. ] writePSTypes "path/to/your/purescript/project" (buildBridge defaultBridge) myTypes.You can define your own type bridges based on : 1 myBridge = defaultBridge <|> mySpecialTypeBridgeand use it with :  writePSTypes "path/to/your/purescript/project" (buildBridge myBridge) myTypes4Find examples for implementing your own bridges in: %Language.PureScript.Bridge.Primitives.Result: will write out PureScript modules to the given path, mirroring the hierarchy of the Haskell modules the types came from. In addition a list of needed PS packages is printed to the console.:The list of needed packages is retrieved from the bridged  data, so make sure you set  correctly in your own bridges, in order for this feature to be useful.Real world usage example (at time of this writing outdated, at time of reading hopefully fixed):3A real world use case of this library can be found  https://github.com/gonimo/gonimo-back/blob/master/app/PSGenerator.hshere.With custom bridges defined  https://github.com/gonimo/gonimo-back/blob/master/src/Gonimo/CodeGen/TypeBridges.hshere and custom PS types defined  https://github.com/gonimo/gonimo-back/blob/master/src/Gonimo/CodeGen/PSTypes.hshere.+Parts of the generated output can be found  https://github.com/gonimo/gonimo-front/blob/master/src/Gonimo/Types.purshere. Note how Secret and Key get translated according to our custom rules, with correct imports and everything. Also the formatting is quite nice, would you have guessed that this code was generated?WARNING:This function overwrites files - make backups or use version control!purescript-bridge Works like  but you can add additional switches to control the generation of your PureScript codeSwitches/Settings: and  to control if the `purescript-profunctor-lenses` are generated for your typesWARNING:This function overwrites files - make backups or use version control!purescript-bridgeTranslate all  values in a D to PureScript types."Example usage, with defaultBridge: data Foo = Foo | Bar Int | FooBar Int Text deriving (Generic, Typeable, Show) bridgeSumType (buildBridge defaultBridge) (mkSumType (Proxy :: Proxy Foo))purescript-bridgeDefault bridge for mapping primitive/common types: You can append your own bridges like this: * defaultBridge <|> myBridge1 <|> myBridge2(Find examples for bridge definitions in %Language.PureScript.Bridge.Primitives and  Language.PureScript.Bridge.Tuple.purescript-bridge!Translate types in a constructor.purescript-bridge"Translate types in a record entry. !"#'()*+,-./013645798:;?=>?@@ABCDEFGHIJKLLMNOPQRSTUVWXYZ[\]^_`abcdefghiijklmnmopqrstuvwxyz{|}~                                                                    1purescript-bridge-0.15.0.0-4Gi0kbDoj2IK6EknlB8Kyc"Language.PureScript.Bridge.Builder*Language.PureScript.Bridge.CodeGenSwitches#Language.PureScript.Bridge.TypeInfo"Language.PureScript.Bridge.SumType"Language.PureScript.Bridge.Printer"Language.PureScript.Bridge.PSTypes Language.PureScript.Bridge.Tuple%Language.PureScript.Bridge.PrimitivesLanguage.PureScript.Bridge)Language.PureScript.Bridge.TypeParametersbaseGHC.Base<|>SwitchForeignOptionsunwrapSingleConstructorsunwrapSingleArgumentsSettingsgenerateLensesgenericsGenRepgenerateArgonautCodecsgenerateForeigndefaultSettings getSettings defaultSwitchnoLensesnoArgonautCodecs genLenses useGenRepuseGen genForeigngenArgonautCodecs noForeign $fEqSettings$fShowSettings$fEqForeignOptions$fShowForeignOptionsTypeInfo _typePackage _typeModule _typeName_typeParametersLanguageHaskell PureScript $fEqTypeInfo $fOrdTypeInfo$fShowTypeInfo HasHaskTypehaskType HaskellTypePSType typeModuletypeName typePackagetypeParameters mkTypeInfo mkTypeInfo'flattenTypeInfo$fHasHaskTypeTypeInfo RecordEntry _recLabel _recValueDataConstructor_sigConstructor _sigValuesInstanceEncode EncodeJsonDecode DecodeJsonGenericNewtypeEqOrdSumType sumTypeInfosumTypeConstructors mkSumTypenootypeequalorder getUsedTypesconstructorToTypes$fGDataConstructor:+:$fGDataConstructorM1$fGRecordEntryM1$fGRecordEntryU1$fGRecordEntry:*:$fGDataConstructorM10 $fShowSumType $fEqSumType$fShowDataConstructor$fEqDataConstructor$fShowRecordEntry$fEqRecordEntry $fEqInstance$fShowInstancesigConstructor sigValuesrecLabelrecValue ImportLinesModules ImportLine importModule importAlias importTypesPSModuleModule psModuleName psImportLinespsTypes printModulesumTypesToNeededPackagessumTypeToNeededPackages moduleToText_genericsImports _lensImports_argonautCodecsImports_foreignImportsimportLineToText sumTypeToTextsumTypeToTypeDeclsforeignOptionsToPurescript instances isTypeParamencodeInstanceencodeJsonInstancedecodeInstancedecodeJsonInstancedecodeJsonFieldInstancegenericInstancesumTypeToOpticsconstructorOptics recordOpticsconstructorToTextspacestypeNameAndForall fromEntriesmkFnArgs mkTypeSigconstructorToOpticrecordEntryToLensrecordEntryToTexttypeInfoToTextmergedTypeInfoToTextsumTypesToModulessumTypeToModuletypesToImportLinestypeToImportLinesimportsFromListmergeImportLinesunlessM $fShowModule$fShowImportLine BridgeData FullBridge FixUpBridge FixUpBuilder BridgePart BridgeBuilder fullBridgeclearPackageFixUp errorFixUp buildBridgebuildBridgeWithCustomFixUpdoCheck^==psTypeParameters$fHasHaskTypeBridgeData$fMonadPlusBridgeBuilder$fAlternativeBridgeBuilder$fFunctorBridgeBuilder$fApplicativeBridgeBuilder$fMonadBridgeBuilder$$fMonadReaderBridgeDataBridgeBuilder$fFunctorFixUpBuilder$fApplicativeFixUpBuilder$fMonadFixUpBuilder#$fMonadReaderBridgeDataFixUpBuilderpsArraypsBoolpsEitherpsObjectpsIntpsNumberpsMaybepsStringpsTuplepsUnitpsWordpsWord8psWord16psWord32psWord64TupleParserStateStart OpenFound ColonFoundTupleNoTuple tupleBridgestepisTuple$fEqTupleParserState$fShowTupleParserState boolBridge eitherBridge strMapBridge dummyBridge intBridge doubleBridge listBridge maybeBridge stringBridge textBridge unitBridgenoContentBridge wordBridge word8Bridge word16Bridge word32Bridge word64Bridge writePSTypeswritePSTypesWith bridgeSumType defaultBridgeZ1Y1X1W1V1U1T1S1R1Q1P1O1N1M1L1K1J1I1H1G1F1E1D1C1B1A1ZYXWVUTSRQPONMLKJIHGFEDCBAmappendid Data.EitherLeftRightEither Data.ProxyProxy _haskType _fullBridge GHC.MaybeNothing mtl-2.2.2Control.Monad.Reader.Class MonadReaderGHC.ErrerroremptyfixTypeParameters Data.Foldableorghc-prim GHC.Classes||bridgeConstructorbridgeRecordEntry