text.cabal 7.64 KB
Newer Older
Bodigrim's avatar
Bodigrim committed
1
cabal-version:  2.2
Duncan Coutts's avatar
Duncan Coutts committed
2
name:           text
Bodigrim's avatar
Bodigrim committed
3
version:        2.0
4

bos's avatar
bos committed
5
6
homepage:       https://github.com/haskell/text
bug-reports:    https://github.com/haskell/text/issues
7
synopsis:       An efficient packed Unicode text type.
bos's avatar
bos committed
8
description:
9
10
    .
    An efficient packed, immutable Unicode text type (both strict and
11
    lazy).
12
13
14
15
16
17
18
    .
    The 'Text' type represents Unicode character strings, in a time and
    space-efficient manner. This package provides text processing
    capabilities that are optimized for performance critical use, both
    in terms of large data quantities and high speed.
    .
    The 'Text' type provides character-encoding, type-safe case
19
20
21
22
    conversion via whole-string case conversion functions (see "Data.Text").
    It also provides a range of functions for converting 'Text' values to
    and from 'ByteStrings', using several standard encodings
    (see "Data.Text.Encoding").
23
    .
24
25
    Efficient locale-sensitive support for text IO is also supported
    (see "Data.Text.IO").
26
    .
bos's avatar
bos committed
27
    These modules are intended to be imported qualified, to avoid name
28
29
30
31
    clashes with Prelude functions, e.g.
    .
    > import qualified Data.Text as T
    .
32
33
    == ICU Support
    .
bos's avatar
bos committed
34
35
36
    To use an extended and very rich family of functions for working
    with Unicode text (including normalization, regular expressions,
    non-standard encodings, text breaking, and locales), see
37
38
39
    the [text-icu package](https://hackage.haskell.org/package/text-icu)
    based on the well-respected and liberally
    licensed [ICU library](http://site.icu-project.org/).
bos's avatar
bos committed
40

Bodigrim's avatar
Bodigrim committed
41
license:        BSD-2-Clause
Duncan Coutts's avatar
Duncan Coutts committed
42
license-file:   LICENSE
bos's avatar
bos committed
43
author:         Bryan O'Sullivan <bos@serpentine.com>
Bodigrim's avatar
Bodigrim committed
44
maintainer:     Haskell Text Team <andrew.lelechenko@gmail.com>, Core Libraries Committee
45
copyright:      2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper, 2021 Andrew Lelechenko
Duncan Coutts's avatar
Duncan Coutts committed
46
47
category:       Data, Text
build-type:     Simple
andreas.abel's avatar
andreas.abel committed
48
49
50
51
52
53
54
55
56
57
58
tested-with:
    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.1
    GHC == 9.2.0.20210821
    -- this is GHC-9.2-rc1

bos's avatar
bos committed
59
extra-source-files:
bos's avatar
bos committed
60
61
    -- scripts/CaseFolding.txt
    -- scripts/SpecialCasing.txt
bos's avatar
bos committed
62
    README.markdown
bos's avatar
bos committed
63
    changelog.md
64
    scripts/*.hs
Bodigrim's avatar
Bodigrim committed
65
66
67
    simdutf/LICENSE-APACHE
    simdutf/LICENSE-MIT
    simdutf/simdutf.h
68
69
    tests/literal-rule-test.sh
    tests/LiteralRuleTest.hs
Duncan Coutts's avatar
Duncan Coutts committed
70

bos's avatar
bos committed
71
72
73
flag developer
  description: operate in developer mode
  default: False
tibbe's avatar
tibbe committed
74
  manual: True
bos's avatar
bos committed
75

Bodigrim's avatar
Bodigrim committed
76
77
78
79
80
flag simdutf
  description: use simdutf library
  default: True
  manual: True

Duncan Coutts's avatar
Duncan Coutts committed
81
library
Bodigrim's avatar
Bodigrim committed
82
  c-sources:    cbits/is_ascii.c
83
                cbits/measure_off.c
Bodigrim's avatar
Bodigrim committed
84
                cbits/reverse.c
85
                cbits/utils.c
Oleg Grenrus's avatar
Oleg Grenrus committed
86
  hs-source-dirs: src
Bodigrim's avatar
Bodigrim committed
87

Bodigrim's avatar
Bodigrim committed
88
  if flag(simdutf)
Bodigrim's avatar
Bodigrim committed
89
90
    include-dirs: simdutf
    cxx-sources: simdutf/simdutf.cpp
Bodigrim's avatar
Bodigrim committed
91
92
93
94
95
96
97
98
                 cbits/validate_utf8.cpp
    cxx-options: -std=c++17
    cpp-options: -DSIMDUTF
    if os(windows)
      if arch(x86_64)
        extra-libraries: stdc++-6 gcc_s_seh-1
      else
        extra-libraries: stdc++-6 gcc_s_dw2-1
Bodigrim's avatar
Bodigrim committed
99
    else
Bodigrim's avatar
Bodigrim committed
100
101
102
103
      if os(darwin)
        extra-libraries: c++
      else
        extra-libraries: stdc++
104

Duncan Coutts's avatar
Duncan Coutts committed
105
106
  exposed-modules:
    Data.Text
107
    Data.Text.Array
108
    Data.Text.Encoding
109
    Data.Text.Encoding.Error
bos's avatar
bos committed
110
    Data.Text.Foreign
bos's avatar
bos committed
111
    Data.Text.IO
112
    Data.Text.Internal
bos's avatar
bos committed
113
114
115
116
    Data.Text.Internal.Builder
    Data.Text.Internal.Builder.Functions
    Data.Text.Internal.Builder.Int.Digits
    Data.Text.Internal.Builder.RealFloat.Functions
Oleg Grenrus's avatar
Oleg Grenrus committed
117
    Data.Text.Internal.ByteStringCompat
118
    Data.Text.Internal.PrimCompat
119
120
121
122
123
    Data.Text.Internal.Encoding.Fusion
    Data.Text.Internal.Encoding.Fusion.Common
    Data.Text.Internal.Encoding.Utf16
    Data.Text.Internal.Encoding.Utf32
    Data.Text.Internal.Encoding.Utf8
bos's avatar
bos committed
124
125
126
127
128
    Data.Text.Internal.Fusion
    Data.Text.Internal.Fusion.CaseMapping
    Data.Text.Internal.Fusion.Common
    Data.Text.Internal.Fusion.Size
    Data.Text.Internal.Fusion.Types
129
    Data.Text.Internal.IO
bos's avatar
bos committed
130
    Data.Text.Internal.Lazy
bos's avatar
bos committed
131
132
133
    Data.Text.Internal.Lazy.Encoding.Fusion
    Data.Text.Internal.Lazy.Fusion
    Data.Text.Internal.Lazy.Search
bos's avatar
bos committed
134
    Data.Text.Internal.Private
bos's avatar
bos committed
135
    Data.Text.Internal.Read
bos's avatar
bos committed
136
137
138
    Data.Text.Internal.Search
    Data.Text.Internal.Unsafe
    Data.Text.Internal.Unsafe.Char
bos's avatar
bos committed
139
140
141
142
143
144
145
146
147
148
    Data.Text.Lazy
    Data.Text.Lazy.Builder
    Data.Text.Lazy.Builder.Int
    Data.Text.Lazy.Builder.RealFloat
    Data.Text.Lazy.Encoding
    Data.Text.Lazy.IO
    Data.Text.Lazy.Internal
    Data.Text.Lazy.Read
    Data.Text.Read
    Data.Text.Unsafe
Duncan Coutts's avatar
Duncan Coutts committed
149

bos's avatar
bos committed
150
151
152
  other-modules:
    Data.Text.Show

Duncan Coutts's avatar
Duncan Coutts committed
153
  build-depends:
154
    array            >= 0.3 && < 0.6,
Bodigrim's avatar
Bodigrim committed
155
    base             >= 4.9 && < 5,
156
    binary           >= 0.5 && < 0.9,
Bodigrim's avatar
Bodigrim committed
157
    bytestring       >= 0.10.4 && < 0.12,
158
    deepseq          >= 1.1 && < 1.5,
Moritz Angermann's avatar
Moritz Angermann committed
159
    ghc-prim         >= 0.2 && < 0.9,
160
    template-haskell >= 2.5 && < 2.19
161
162

  ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
bos's avatar
bos committed
163
  if flag(developer)
164
    ghc-options: -fno-ignore-asserts
bos's avatar
bos committed
165
    cpp-options: -DASSERTS
bos's avatar
bos committed
166

167
168
169
170
  -- https://gitlab.haskell.org/ghc/ghc/-/issues/19900
  if os(windows)
    extra-libraries: gcc_s

171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
  default-language: Haskell2010
  default-extensions:
    NondecreasingIndentation
  other-extensions:
    BangPatterns
    CPP
    DeriveDataTypeable
    ExistentialQuantification
    ForeignFunctionInterface
    GeneralizedNewtypeDeriving
    MagicHash
    OverloadedStrings
    Rank2Types
    RankNTypes
    RecordWildCards
Bodigrim's avatar
Bodigrim committed
186
    Safe
187
    ScopedTypeVariables
Bodigrim's avatar
Bodigrim committed
188
189
    TemplateHaskellQuotes
    Trustworthy
190
191
192
193
    TypeFamilies
    UnboxedTuples
    UnliftedFFITypes

bos's avatar
bos committed
194
195
source-repository head
  type:     git
bos's avatar
bos committed
196
  location: https://github.com/haskell/text
197

198
199
200
201
202
203
204
205
206
207
test-suite tests
  type:           exitcode-stdio-1.0
  ghc-options:
    -Wall -threaded -rtsopts

  hs-source-dirs: tests
  main-is:        Tests.hs
  other-modules:
    Tests.Lift
    Tests.Properties
Xia Li-yao's avatar
Xia Li-yao committed
208
209
210
211
212
213
214
215
216
    Tests.Properties.Basics
    Tests.Properties.Builder
    Tests.Properties.Folds
    Tests.Properties.Instances
    Tests.Properties.LowLevel
    Tests.Properties.Read
    Tests.Properties.Substrings
    Tests.Properties.Text
    Tests.Properties.Transcoding
217
218
219
220
221
222
    Tests.QuickCheckUtils
    Tests.Regressions
    Tests.SlowFunctions
    Tests.Utils

  build-depends:
223
    QuickCheck >= 2.12.6 && < 2.15,
224
225
226
227
    base <5,
    bytestring,
    deepseq,
    directory,
228
    ghc-prim,
229
230
231
232
233
234
    tasty,
    tasty-hunit,
    tasty-quickcheck,
    template-haskell,
    text

235
236
237
238
239
  -- Starting from 9.2 ghc library depends on parsec,
  -- which causes circular dependency.
  if impl(ghc < 9.2)
    build-depends: tasty-inspection-testing

240
241
  default-language: Haskell2010
  default-extensions: NondecreasingIndentation
242
243
244

benchmark text-benchmarks
  type:           exitcode-stdio-1.0
Bodigrim's avatar
Bodigrim committed
245

246
  ghc-options:    -Wall -O2 -rtsopts
Bodigrim's avatar
Bodigrim committed
247
248
249
250
251
  if impl(ghc >= 8.10)
    ghc-options:  "-with-rtsopts=-A32m --nonmoving-gc"
  else
    ghc-options:  "-with-rtsopts=-A32m"

252
  build-depends:  base,
Bodigrim's avatar
Bodigrim committed
253
                  bytestring >= 0.10.4,
254
255
                  containers,
                  deepseq,
256
                  directory,
257
258
259
                  filepath,
                  tasty-bench >= 0.2,
                  text,
260
                  transformers
261
262
263
264
265
266
267
268
269
270
271

  hs-source-dirs: benchmarks/haskell
  main-is:        Benchmarks.hs
  other-modules:
    Benchmarks.Builder
    Benchmarks.Concat
    Benchmarks.DecodeUtf8
    Benchmarks.EncodeUtf8
    Benchmarks.Equality
    Benchmarks.FileRead
    Benchmarks.FoldLines
272
    Benchmarks.Multilang
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
    Benchmarks.Programs.BigTable
    Benchmarks.Programs.Cut
    Benchmarks.Programs.Fold
    Benchmarks.Programs.Sort
    Benchmarks.Programs.StripTags
    Benchmarks.Programs.Throughput
    Benchmarks.Pure
    Benchmarks.ReadNumbers
    Benchmarks.Replace
    Benchmarks.Search
    Benchmarks.Stream
    Benchmarks.WordFrequencies

  default-language: Haskell2010
  default-extensions: NondecreasingIndentation
288
  other-extensions: DeriveGeneric