-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxied.cabal
83 lines (81 loc) · 3.91 KB
/
proxied.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: proxied
version: 0.3.2
synopsis: Make functions consume Proxy instead of undefined
description: @proxied@ is a simple library that exports a function to
convert constant functions to ones that take a @proxy@
value in the "Data.Proxied" module. This is useful for
retrofiting typeclasses that have functions that return a
constant value for any value of a particular type (but
still need to consume some value, since one of the
parameterized types must appear in a typeclass function).
Often, these functions are given @undefined@ as an
argument, which might be considered poor design.
.
@Proxy@, however, does not carry any of the
error-throwing risks of @undefined@, so it is much more
preferable to take @Proxy@ as an argument to a constant
function instead of @undefined@. Unfortunately, @Proxy@
wasn't included in @base@ until GHC 7.8, so many of @base@'s
typeclasses still contain constant functions that aren't
amenable to passing @Proxy@. @proxied@ addresses this
issue by providing variants of those typeclass functions
that take an explicit @proxy@ value.
.
This library also contains the "Data.Proxyless" module,
which works in the opposite direction. That is, one can
take functions which take @Proxy@ (or @undefined@) as an
argument and convert them to functions which take no
arguments. This trick relies on the @-XTypeApplications@
extension, so it is only available with GHC 8.0 or later.
This library also offers
"Data.Proxyless.RequiredTypeArguments", a variant of
"Data.Proxyless" that uses @-XRequiredTypeArguments@ to
make type arguments explicit, which is only available with
GHC 9.10 or later.
homepage: https://github.com/RyanGlScott/proxied
bug-reports: https://github.com/RyanGlScott/proxied/issues
license: BSD3
license-file: LICENSE
author: Ryan Scott
maintainer: Ryan Scott <[email protected]>
stability: Provisional
copyright: (C) 2016-2017 Ryan Scott
category: Data
build-type: Simple
tested-with: GHC == 7.0.4
, GHC == 7.2.2
, GHC == 7.4.2
, GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.4
, GHC == 8.10.7
, GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.8
, GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1
extra-source-files: CHANGELOG.md, README.md
cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/RyanGlScott/proxied
library
exposed-modules: Data.Proxied
if impl(ghc >= 8.0)
exposed-modules: Data.Proxyless
if impl(ghc >= 9.10)
exposed-modules: Data.Proxyless.RequiredTypeArguments
build-depends: base >= 4.3 && < 5
if !impl(ghc >= 7.6)
build-depends: generic-deriving >= 1.10.1 && < 2
if !impl(ghc >= 7.8)
build-depends: tagged >= 0.4.4 && < 1
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall