summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErikHesselink <>2020-05-22 09:42:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-05-22 09:42:00 (GMT)
commit1bb8363001a62f5a9bd94b5efcdefe32b3748d89 (patch)
tree6d54bf9ffb4d16f7f539420bbe43d4803ec02b18
parentcba686e1366b71cd33547fe88a690ac41632ed56 (diff)
version 2.0.5HEAD2.0.5master
-rw-r--r--[-rwxr-xr-x]CHANGELOG3
-rw-r--r--[-rwxr-xr-x]README.md0
-rw-r--r--fclabels.cabal18
-rw-r--r--src/Data/Label/Derive.hs10
4 files changed, 19 insertions, 12 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d20addf..31d1993 100755..100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
CHANGELOG
+2.0.5
+ - Support for GHC 8.10. Thanks to Potato Hatsue.
+
2.0.4
- Import Functor, Applicative, and Monad instances for Kleisli from the
base-orphans package for future GHC 8.10 support.
diff --git a/README.md b/README.md
index afb8251..afb8251 100755..100644
--- a/README.md
+++ b/README.md
diff --git a/fclabels.cabal b/fclabels.cabal
index 7ba72e9..0072508 100644
--- a/fclabels.cabal
+++ b/fclabels.cabal
@@ -1,5 +1,5 @@
Name: fclabels
-Version: 2.0.4
+Version: 2.0.5
Author: Sebastiaan Visser, Erik Hesselink, Chris Eidhof, Sjoerd Visscher
with lots of help and feedback from others.
Synopsis: First class accessor labels implemented as lenses.
@@ -47,11 +47,9 @@ Description: This package provides first class labels that can act as
See "Data.Label.Base" and "Data.Label.Monadic" for more
information.
.
- * /Changelog from 2.0.3.2 to 2.0.4/
+ * /Changelog from 2.0.4 to 2.0.5/
.
- > - Import Functor, Applicative, and Monad instances for
- > Kleisli from the base-orphans package for future GHC 8.10
- > support.
+ > - Support for GHC 8.10. Thanks to Potato Hatsue.
Maintainer: Sebastiaan Visser <code@fvisser.nl>
Homepage: https://github.com/sebastiaanvisser/fclabels
@@ -59,7 +57,7 @@ Bug-Reports: https://github.com/sebastiaanvisser/fclabels/issues
License: BSD3
License-File: LICENSE
Category: Data, Lenses
-Cabal-Version: >= 1.8
+Cabal-Version: >= 1.10
Build-Type: Simple
Tested-With:
GHC==7.4.2,
@@ -88,12 +86,14 @@ Library
GHC-Options: -Wall
Build-Depends:
- base >= 4.5 && < 4.14
+ base >= 4.5 && < 4.15
, base-orphans >= 0.8.2 && < 0.9
- , template-haskell >= 2.2 && < 2.16
+ , template-haskell >= 2.2 && < 2.17
, mtl >= 1.0 && < 2.3
, transformers >= 0.2 && < 0.6
+ Default-Language: Haskell2010
+
Source-Repository head
Type: git
Location: git://github.com/sebastiaanvisser/fclabels.git
@@ -110,6 +110,7 @@ Test-Suite suite
, mtl
, transformers
, HUnit >= 1.2 && < 1.7
+ Default-Language: Haskell2010
Benchmark benchmark
Type: exitcode-stdio-1.0
@@ -120,3 +121,4 @@ Benchmark benchmark
base < 5
, fclabels
, criterion < 1.6
+ Default-Language: Haskell2010
diff --git a/src/Data/Label/Derive.hs b/src/Data/Label/Derive.hs
index 0f3e716..70500d8 100644
--- a/src/Data/Label/Derive.hs
+++ b/src/Data/Label/Derive.hs
@@ -128,10 +128,12 @@ getLabelWith sigs concrete failing name =
types = map (\(LabelExpr _ _ t _) -> t) labels
context = head $ map (\(LabelExpr _ c _ _) -> c) labels
vars = head $ map (\(LabelExpr v _ _ _) -> v) labels
- if sigs
- then tupE bodies `sigE`
- forallT vars context (foldl appT (tupleT (length bodies)) types)
- else tupE bodies
+ case bodies of
+ [b] -> if sigs then b `sigE` forallT vars context (head types) else b
+ _ -> if sigs
+ then tupE bodies `sigE`
+ forallT vars context (foldl appT (tupleT (length bodies)) types)
+ else tupE bodies
-- | Low level standalone label derivation function.