purescript-bridge 0.6.0.1 → 0.6.0.2
raw patch · 3 files changed
+7/−10 lines, 3 files
Files
README.md view
@@ -13,12 +13,7 @@ ## JSON encoding / decoding For compatible JSON representations you should be using [aeson](http://hackage.haskell.org/package/aeson)'s generic encoding/decoding with default options-and `gAesonEncodeJson` and `gAesonDecodeJson` from the [purescript-argonaut-codecs](https://github.com/purescript-contrib/purescript-argonaut-codecs)-package, (Data.Argonaut.Aeson).--At the time of this writing the PR providing `Data.Argonaut.Aeson` was not yet merged.-In the meantime, you can find the PR-[here](https://github.com/purescript-contrib/purescript-argonaut-codecs/pull/12).+and `encodeJson` and `decodeJson` from "Data.Argonaut.Generic.Aeson" in [purescript-argonaut-generic-codecs](https://github.com/eskimor/purescript-argonaut-generic-codecs). ## Documentation
purescript-bridge.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.6.0.1+version: 0.6.0.2 -- A short (one-line) description of the package. synopsis: Generate PureScript data types from Haskell data types
src/Language/PureScript/Bridge/Printer.hs view
@@ -124,10 +124,12 @@ typesToImportLines = foldr typeToImportLines typeToImportLines :: PSType -> ImportLines -> ImportLines-typeToImportLines t = if not (T.null (_typeModule t))- then Map.alter (Just . updateLine) (_typeModule t)- else id+typeToImportLines t ls = typesToImportLines (update ls) (_typeParameters t) where+ update = if not (T.null (_typeModule t))+ then Map.alter (Just . updateLine) (_typeModule t)+ else id+ updateLine Nothing = ImportLine (_typeModule t) (Set.singleton (_typeName t)) updateLine (Just (ImportLine m types)) = ImportLine m $ Set.insert (_typeName t) types