You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Control/Newtype.hs
+4-33Lines changed: 4 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,11 @@
1
1
{-# LANGUAGE CPP #-}
2
+
{-# LANGUAGE DefaultSignatures #-}
2
3
{-# LANGUAGE FlexibleInstances #-}
3
4
{-# LANGUAGE FunctionalDependencies #-}
4
5
{-# LANGUAGE MultiParamTypeClasses #-}
5
6
{-# LANGUAGE TypeFamilies #-}
6
-
#if __GLASGOW_HASKELL__ >= 704
7
-
{-# LANGUAGE DefaultSignatures #-}
8
-
#endif
9
7
10
-
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
8
+
{-# OPTIONS_GHC -Wno-unused-imports #-}
11
9
12
10
{- |
13
11
Module : Control.Newtype
@@ -42,19 +40,14 @@ module Control.Newtype
42
40
43
41
importControl.Applicative
44
42
importControl.Arrow
43
+
44
+
importData.Coerce
45
45
importData.Fixed
46
46
importData.Functor.Compose
47
47
importData.Functor.Identity
48
48
importData.Monoid
49
49
importData.Ord
50
50
51
-
#if !MIN_VERSION_base(4,7,0)
52
-
-- necessary evil for 'Newtype Fixed'
53
-
importUnsafe.Coerce (unsafeCoerce)
54
-
#else
55
-
importData.Coerce
56
-
#endif
57
-
58
51
--| Given a @newtype@ @n@, we will always have the same unwrapped type @o@, meaning we can represent this with a fundep @n -> o@.
59
52
--
60
53
-- Any instance of this class just needs to let 'pack' equal to the newtype's constructor, and let 'unpack' destruct the @newtype@ with pattern matching.
@@ -72,23 +65,11 @@ class Newtype n o | n -> o where
Copy file name to clipboardExpand all lines: newtype.cabal
+8-11Lines changed: 8 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
cabal-version: 1.12
2
2
build-type: Simple
3
3
name: newtype
4
-
version: 0.2.2.0
5
-
x-revision: 3
4
+
version: 0.2.2.1
6
5
7
6
license: BSD3
8
7
license-file: LICENSE
@@ -15,8 +14,9 @@ synopsis: A typeclass and set of functions for working with newtypes.
15
14
description: Per Conor McBride, the 'Newtype' typeclass represents the packing and unpacking of a @newtype@, and allows you to operate under that @newtype@ with functions such as 'ala'. See "Control.Newtype" for documentation and examples.
16
15
17
16
tested-with:
17
+
GHC ==9.14.1
18
18
GHC ==9.12.2
19
-
GHC ==9.10.2
19
+
GHC ==9.10.3
20
20
GHC ==9.8.4
21
21
GHC ==9.6.7
22
22
GHC ==9.4.8
@@ -38,20 +38,17 @@ source-repository head
38
38
library
39
39
exposed-modules: Control.Newtype
40
40
41
-
build-depends: base >=4.3&&<5
42
-
if !impl(ghc >=8.0)
43
-
build-depends: transformers >=0.2.2.0&&<0.6
41
+
build-depends: base >=4.9&&<5
44
42
45
43
default-language: Haskell2010
46
44
other-extensions:
47
45
CPP
48
46
FlexibleInstances
49
47
FunctionalDependencies
50
48
MultiParamTypeClasses
49
+
Trustworthy
51
50
TypeFamilies
52
51
53
-
if impl(ghc >=7.2)
54
-
default-extensions: Trustworthy
55
-
if impl(ghc >=7.10) { ghc-options: -fno-warn-trustworthy-safe }
0 commit comments