MyNixOS website logo
Description

Manipulate and convert strings of characters uniformly and consistently.

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.

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

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.

Metadata

Version

0.1.5.1

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows