elm-bridge 0.6.1 → 0.7.0
raw patch · 4 files changed
+13/−10 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +4/−0
- elm-bridge.cabal +3/−3
- src/Elm/Derive.hs +6/−6
- src/Elm/TyRep.hs +0/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+# v0.7.0++ * Support for GHC 9+ # v0.6.0 * Support for Elm 0.19
elm-bridge.cabal view
@@ -1,5 +1,5 @@ name: elm-bridge-version: 0.6.1+version: 0.7.0 synopsis: Derive Elm types and Json code from Haskell types, using aeson's options description: Building the bridge from Haskell to Elm and back. Define types once, and derive the aeson and elm functions at the same time, using any aeson@@ -13,7 +13,7 @@ category: Web, Compiler, Language build-type: Simple cabal-version: >=1.10-tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2+tested-with: GHC==9.0.1 extra-source-files: README.md@@ -32,7 +32,7 @@ Elm.TyRep Elm.Versions other-modules: Elm.Utils- build-depends: base >= 4.9 && < 5,+ build-depends: base >= 4.15 && < 5, template-haskell, aeson >= 1 default-language: Haskell2010
src/Elm/Derive.hs view
@@ -94,7 +94,7 @@ TaggedObject tn cn -> [|SumEncoding' (TaggedObject tn cn)|] UntaggedValue -> [|SumEncoding' UntaggedValue|] -runDerive :: Name -> [TyVarBndr] -> (Q Exp -> Q Exp) -> Q [Dec]+runDerive :: Name -> [TyVarBndr ()] -> (Q Exp -> Q Exp) -> Q [Dec] runDerive name vars mkBody = liftM (:[]) elmDefInst where@@ -122,10 +122,10 @@ argNames = flip map vars $ \v -> case v of- PlainTV tv -> tv- KindedTV tv _ -> tv+ PlainTV tv _ -> tv+ KindedTV tv _ _ -> tv -deriveAlias :: Bool -> A.Options -> Name -> [TyVarBndr] -> [VarStrictType] -> Q [Dec]+deriveAlias :: Bool -> A.Options -> Name -> [TyVarBndr ()] -> [VarStrictType] -> Q [Dec] deriveAlias isNewtype opts name vars conFields = runDerive name vars $ \typeName -> [|ETypeAlias (EAlias $typeName $fields omitNothing isNewtype unwrapUnary)|] -- default to no newtype@@ -140,7 +140,7 @@ fldName = A.fieldLabelModifier opts $ nameBase fname fldType = compileType ftype -deriveSum :: A.Options -> Name -> [TyVarBndr] -> [Con] -> Q [Dec]+deriveSum :: A.Options -> Name -> [TyVarBndr ()] -> [Con] -> Q [Dec] deriveSum opts name vars constrs = runDerive name vars $ \typeName -> [|ETypeSum (ESum $typeName $sumOpts $sumEncOpts omitNothing allNullary)|]@@ -164,7 +164,7 @@ in [|STC b n (Named $tyArgs)|] _ -> fail ("Can't derive this sum: " ++ show c) -deriveSynonym :: A.Options -> Name -> [TyVarBndr] -> Type -> Q [Dec]+deriveSynonym :: A.Options -> Name -> [TyVarBndr ()] -> Type -> Q [Dec] deriveSynonym _ name vars otherT = runDerive name vars $ \typeName -> [|ETypePrimAlias (EPrimAlias $typeName $otherType)|]
src/Elm/TyRep.hs view
@@ -10,7 +10,6 @@ import Data.Aeson.Types (SumEncoding (..)) import Data.Maybe (fromMaybe)-import Data.Monoid ((<>)) -- | Type definition, including constructors. data ETypeDef