@@ -16,7 +16,7 @@ are somewhat experimental; while fully supported by cabal-install, they are curr
16
16
17
17
A Backpack package is defined by use of the
18
18
:pkg-field: `library:signatures ` field, or by (transitive) dependency on
19
- a package that defines some requirements. To define a parametrized
19
+ a package that defines some requirements. To define a parameterized
20
20
package, define a signature file (file extension ``hsig ``) that
21
21
specifies the signature of the module you want to parametrize over, and
22
22
add it to your Cabal file in the :pkg-field: `library:signatures ` field.
@@ -31,10 +31,10 @@ add it to your Cabal file in the :pkg-field:`library:signatures` field.
31
31
concat :: [Str] -> Str
32
32
33
33
.. code-block :: cabal
34
- :caption: parametrized .cabal
34
+ :caption: parameterized .cabal
35
35
36
36
cabal-version: 2.2
37
- name: parametrized
37
+ name: parameterized
38
38
39
39
library
40
40
build-depends: base
@@ -45,14 +45,14 @@ You can define any number of regular modules (e.g., ``MyModule``) that
45
45
import signatures and use them as regular modules.
46
46
47
47
If you are familiar with ML modules, you might now expect there to be
48
- some way to apply the parametrized package with an implementation of
48
+ some way to apply the parameterized package with an implementation of
49
49
the ``Str `` module to get a concrete instantiation of the package.
50
50
Backpack operates slightly differently with a concept of *mix-in
51
51
linking *, where you provide an implementation of ``Str `` simply by
52
52
bringing another module into scope with the same name as the
53
53
requirement. For example, if you had a package ``str-impl `` that provided a
54
- module named ``Str ``, instantiating ``parametrized `` is as simple as
55
- just depending on both ``str-impl `` and ``parametrized ``:
54
+ module named ``Str ``, instantiating ``parameterized `` is as simple as
55
+ just depending on both ``str-impl `` and ``parameterized ``:
56
56
57
57
.. code-block :: cabal
58
58
:caption: combined.cabal
@@ -61,7 +61,7 @@ just depending on both ``str-impl`` and ``parametrized``:
61
61
name: combined
62
62
63
63
library
64
- build-depends: base, str-impl, parametrized
64
+ build-depends: base, str-impl, parameterized
65
65
66
66
Note that due to technical limitations, you cannot directly define
67
67
``Str `` in the ``combined `` library; it must be placed in its own
@@ -75,7 +75,7 @@ a requirement ``Str`` and an implementation ``Data.Text``, you can
75
75
line up the names in one of two ways:
76
76
77
77
* Rename the requirement to match the implementation:
78
- ``mixins: parametrized requires (Str as Data.Text) ``
78
+ ``mixins: parameterized requires (Str as Data.Text) ``
79
79
* Rename the implementation to match the requirement:
80
80
``mixins: text (Data.Text as Str) ``
81
81
@@ -91,13 +91,13 @@ the requirements and provided modules renamed to be distinct.
91
91
name: double-combined
92
92
93
93
library
94
- build-depends: base, text, bytestring, parametrized
94
+ build-depends: base, text, bytestring, parameterized
95
95
mixins:
96
- parametrized (MyModule as MyModule.Text) requires (Str as Data.Text),
97
- parametrized (MyModule as MyModule.BS) requires (Str as Data.ByteString)
96
+ parameterized (MyModule as MyModule.Text) requires (Str as Data.Text),
97
+ parameterized (MyModule as MyModule.BS) requires (Str as Data.ByteString)
98
98
99
99
Intensive use of Backpack sometimes involves creating lots of small
100
- parametrized libraries; :ref: `Sublibraries <sublibs >` can be used
100
+ parameterized libraries; :ref: `Sublibraries <sublibs >` can be used
101
101
to define all of these libraries in a single package without having to
102
102
create many separate Cabal packages. You may also find it useful to use
103
103
:pkg-field: `library:reexported-modules ` to reexport instantiated
0 commit comments