elm-bridge 0.3.0.0 → 0.3.0.2
raw patch · 2 files changed
+10/−2 lines, 2 files
Files
- elm-bridge.cabal +1/−1
- src/Elm/Derive.hs +9/−1
elm-bridge.cabal view
@@ -1,5 +1,5 @@ name: elm-bridge-version: 0.3.0.0+version: 0.3.0.2 synopsis: Derive Elm types from Haskell types description: Building the bridge from Haskell to Elm and back. Define types once, use on both sides and enjoy easy (de)serialisation. Cheers!
src/Elm/Derive.hs view
@@ -57,7 +57,6 @@ unwrapUnaryRecords _ = False #endif - {-| This generates a default set of options. The parameter represents the number of characters that must be dropped from the Haskell field names. The first letter of the field is then converted to lowercase, ie:@@ -188,12 +187,21 @@ deriveElmDef opts name = do TyConI tyCon <- reify name case tyCon of+#if __GLASGOW_HASKELL__ >= 800+ DataD _ _ tyVars _ constrs _ ->+#else DataD _ _ tyVars constrs _ ->+#endif+ case constrs of [] -> fail "Can not derive empty data decls" [RecC _ conFields] -> deriveAlias opts name tyVars conFields _ -> deriveSum opts name tyVars constrs+#if __GLASGOW_HASKELL__ >= 800+ NewtypeD _ _ tyVars _ (RecC _ conFields) _ ->+#else NewtypeD _ _ tyVars (RecC _ conFields) _ ->+#endif deriveAlias opts name tyVars conFields TySynD _ vars otherTy -> deriveSynonym opts name vars otherTy