summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-05-31 15:03:01 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-09 15:11:22 -0400
commitb128a880b225d3abc98f58a0426b58138aed5504 (patch)
tree4f6056d289f1695c5c0378329af5c0c324725b12
parent080ffd4b78fe8b60f9eb4490b39f971d76ebb46e (diff)
downloadhaskell-b128a880b225d3abc98f58a0426b58138aed5504.tar.gz
Ensure that newtype deriving strategy is used for CTypes
-rw-r--r--libraries/base/include/CTypes.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/libraries/base/include/CTypes.h b/libraries/base/include/CTypes.h
index 2b40c41f03..13ab70ada3 100644
--- a/libraries/base/include/CTypes.h
+++ b/libraries/base/include/CTypes.h
@@ -21,28 +21,22 @@
#define OPAQUE_CLASSES Eq,Ord,Storable
#define ARITHMETIC_TYPE(T,B) \
-newtype T = T B deriving (ARITHMETIC_CLASSES) \
- deriving newtype (Read, Show);
+newtype T = T B deriving newtype (Read, Show, ARITHMETIC_CLASSES);
#define INTEGRAL_TYPE(T,B) \
-newtype T = T B deriving (ARITHMETIC_CLASSES, INTEGRAL_CLASSES) \
- deriving newtype (Read, Show);
+newtype T = T B deriving newtype (Read, Show, ARITHMETIC_CLASSES, INTEGRAL_CLASSES);
#define INTEGRAL_TYPE_WITH_CTYPE(T,THE_CTYPE,B) \
newtype {-# CTYPE "THE_CTYPE" #-} T = T B \
- deriving (ARITHMETIC_CLASSES, INTEGRAL_CLASSES) \
- deriving newtype (Read, Show);
+ deriving newtype (Read, Show, ARITHMETIC_CLASSES, INTEGRAL_CLASSES);
#define FLOATING_TYPE(T,B) \
-newtype T = T B deriving (ARITHMETIC_CLASSES, FLOATING_CLASSES) \
- deriving newtype (Read, Show);
+newtype T = T B deriving newtype (Read, Show, ARITHMETIC_CLASSES, FLOATING_CLASSES);
#define FLOATING_TYPE_WITH_CTYPE(T,THE_CTYPE,B) \
newtype {-# CTYPE "THE_CTYPE" #-} T = T B \
- deriving (ARITHMETIC_CLASSES, FLOATING_CLASSES) \
- deriving newtype (Read, Show);
+ deriving newtype (Read, Show, ARITHMETIC_CLASSES, FLOATING_CLASSES);
#define OPAQUE_TYPE_WITH_CTYPE(T,THE_CTYPE,B) \
newtype {-# CTYPE "THE_CTYPE" #-} T = T (B) \
- deriving (OPAQUE_CLASSES) \
- deriving newtype Show;
+ deriving newtype (Show, OPAQUE_CLASSES);