regex-indef
is a minimal library for parsing regular expressions. It is an
indefinite library. It defines two things:
- A module named
Regex
(which contains an import ofStr
) - A module signature named
Str
; we use a module signature here, rather than a module, to defer specifying exactly what type of strings theRegex
module parses.
Each of the following packages provides an implementation of the Str
module
signature:
str-string
defines strings asString
.str-bytestring
defines strings asByteString
.
Then there are two empty packages, regex-string
and regex-bytestring
. Each
of these packages combines regex-indef
with a Sig
implementation to produce
a definite regular expression library.
regex-string
depends onregex-indef
andstr-string
, and it reexports theRegex
module asRegex.String
.regex-bytestring
depends onregex-indef
andstr-bytestring
, and it reexports theRegex
module asRegex.ByteString
.
- Module - An
.hs
file. - Module signature - An
.hsig
file. - Package - A directory containing a
.cabal
file. - Library - A
library
stanza within a.cabal
file. - Indefinite library - A library that has module signatures without implementations. (A library with a "hole" in it.)
- Definite library - A library for which all module signatures (if any) have implementations. (A library that is not missing anything.)
- Reexporting a module - To include a module in a library's API under a different name than the name with which the module was originally defined.
See also: Edward Z. Yang's blog post Try Backpack: Cabal packages.