Release v0.4.3

Drop support for GHC < 8
This commit is contained in:
bartavelle 2018-02-15 09:35:26 +01:00
parent 6247ebf877
commit 1c3c6f2887
3 changed files with 3 additions and 15 deletions

View File

@ -28,9 +28,6 @@ before_cache:
matrix:
include:
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}

View File

@ -1,5 +1,5 @@
name: elm-bridge
version: 0.4.2
version: 0.4.3
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 @@ copyright: (c) 2015 - 2016 Alexander Thiemann and contributors
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, GHC==7.10.3
tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2
extra-source-files:
README.md
@ -32,7 +32,7 @@ library
Elm.TyRep
Elm.Versions
other-modules: Elm.Utils
build-depends: base >= 4.7 && < 5,
build-depends: base >= 4.9 && < 5,
template-haskell,
aeson >= 1
default-language: Haskell2010

View File

@ -184,26 +184,17 @@ deriveElmDef :: A.Options -> Name -> Q [Dec]
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 False opts name tyVars conFields
_ -> deriveSum opts name tyVars constrs
#if __GLASGOW_HASKELL__ >= 800
NewtypeD [] _ [] Nothing (NormalC _ [(Bang NoSourceUnpackedness NoSourceStrictness, otherTy)]) [] ->
deriveSynonym opts name [] otherTy
NewtypeD [] _ [] Nothing (RecC _ conFields@[(Name (OccName _) _, Bang NoSourceUnpackedness NoSourceStrictness, otherTy)]) [] ->
if A.unwrapUnaryRecords opts
then deriveSynonym opts name [] otherTy
else deriveAlias True opts name [] conFields
#else
NewtypeD _ _ tyVars (RecC _ conFields) _ ->
deriveAlias True opts name tyVars conFields
#endif
TySynD _ vars otherTy ->
deriveSynonym opts name vars otherTy
_ -> fail ("Oops, can only derive data and newtype, not this: " ++ show tyCon)