uniform-strings: Manipulate and convert strings of characters uniformly and consistently

[ data-text-uniform, gpl, library ] [ Propose Tags ]

Reduce complexity of Haskell by providing a

  • set of uniformly named conversion functions between

  • String,

  • Text,

  • ByteString,

  • LazyByteString and

  • urlEncoding

with the most important text manipulation functions for string and text where the semantic is the same (tested with quickcheck). Tentatively some infix string manipulations are offered as well.

  • 0.1.3 added stack build lts 19.16 for ghc 9.0.2

  • 0.1.3.1 removed dependency on text-icu

Please see the README on GitHub at https://github.com/andrewufrank/uniform-strings/readme


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.2, 0.1.3, 0.1.3.1, 0.1.5.1
Change log ChangeLog.md
Dependencies base (>4.5 && <5), bytestring, MissingH, monads-tf, network-uri, pretty-show, safe, snap-core, split, text, uniform-algebras (>=0.1.3) [details]
License GPL-2.0-only
Copyright 2021 Andrew U. Frank
Author Andrew Frank
Maintainer Andrew U. Frank <uniform@gerastree.at>
Category Data Text Uniform
Bug tracker https://github.com/andrewufrank/uniform-strings/issues
Uploaded by andrewufrank at 2022-07-23T18:23:55Z
Distributions NixOS:0.1.5.1
Reverse Dependencies 5 direct, 9 indirect [details]
Downloads 523 total (26 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-07-23 [all 1 reports]

Readme for uniform-strings-0.1.3.1

[back to package description]

The uniform-strings package

Tries to resolve the confusing breadth of choices to represent and operate on text in Haskell. It contains

  • a principled set of conversions between representations for text, namely

    • s - Strings,

    • t - Text,

    • b - ByteString,

    • l - LazyByteString,

    • bu - ByteString containing UTF-8 characters,

    • latin - charcters with latin1 encoding

    • u - URLencoding, and

    conversions functions of x to y are named x2y (e.g. s2t for a conversion from String to Text).

  • a set of functions applicable to character strings, which have the exact same semantics for all the types (usually the name of the function applicable to Strings with an appended "'" to avoid name clashes with existing code.

  • a few infix function for string manipulation.

This is a package in uniformBase and other uniform packages will build on it.

It may require
debian: apt-get install libicu-dev

To Do: The code originated in 2010 to 2018. It will be revised and the dependencies greatly reduced when using text and basement.

Intention of uniform packages

The uniform packages are yet another attempt to select a useful subset from the overwhelming variety of the Haskell biotop. It was started in the 2010, grew over the years but was never packaged and put into Hackage; it is comparable to other similar attempts from which it has learned and occasionally copied code.

The "uniform" approach is different from some others by:

  • compatible with 'standard' Haskell, i.e. Haskell 2010 plus extensions as indicated in the modules,
  • use the regular Haskell prelude,
  • avoid name clashes as far as possible,
  • combine logically connected operations in one place and in a form allowing coordinated use, but
  • broken in small, mostly independently building packages.

Choices are:

  • strong preference for total functions, achieved often with producing error messages which makes debugging easier than the plain failure of partial functions,
  • use monads-tf because TypeFamilies seemed to lead to better documentation.

Issues with this approach: it is limited by the deeps of understanding of Haskell of the author and his experience. It shows a focus on understanding semantics (and formal ontology) linked to algebra applied to practical problems (Geographic Information Systems). It seems that efforts to construct coherent subsets of Haskell are limited by the complexity of the task -- the more comprehensive an environment should be the more complex is it to learn and use. The approach here is what emerged after some 25 years of using Haskell to write application oriented code, mostly to demonstrate theories in spatial information theory.