ascii: The ASCII character set and encoding

[ apache, data, library, text ] [ Propose Tags ]

This package provides a variety of ways to work with ASCII text.


[Skip to Readme]

Modules

[Index] [Quick Jump]

  • ASCII
    • ASCII.Case
    • ASCII.CaseRefinement
    • ASCII.Caseless
    • ASCII.Char
    • ASCII.Decimal
    • ASCII.Group
    • ASCII.Hexadecimal
    • ASCII.Isomorphism
    • ASCII.Lists
    • ASCII.ListsAndPredicates
    • ASCII.Predicates
    • ASCII.QuasiQuoters
    • ASCII.Refinement
    • ASCII.Superset
      • ASCII.Superset.Text
    • ASCII.TemplateHaskell
    • ASCII.Word4

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0, 0.0.1, 0.0.1.1, 0.0.2, 0.0.2.1, 0.0.2.2, 0.0.3, 0.0.4, 0.0.4.1, 0.0.5, 0.0.5.1, 0.0.5.2, 1.0.0.0, 1.0.0.2, 1.0.1.0, 1.0.1.2, 1.0.1.4, 1.0.1.6, 1.1.0.0, 1.1.1.0, 1.1.1.2, 1.1.1.4, 1.1.2.0, 1.1.3.0, 1.2.0.0, 1.2.1.0, 1.2.2.0, 1.2.3.0, 1.2.4.0, 1.2.5.0, 1.3.0.0, 1.3.1.0, 1.4.0.0, 1.4.1.0, 1.4.1.1, 1.4.2.0, 1.5.0.0, 1.5.1.0, 1.5.2.0, 1.5.3.0, 1.5.4.0, 1.6.0.0, 1.7.0.0, 1.7.0.1 (info)
Change log changelog.md
Dependencies ascii-case (>=1.0.1 && <1.0.2), ascii-caseless (>=0.0.0 && <0.0.1), ascii-char (>=1.0.1 && <1.0.2), ascii-group (>=1.0.0 && <1.0.1), ascii-numbers (>=1.2.0 && <1.2.1), ascii-predicates (>=1.0.1 && <1.0.2), ascii-superset (>=1.3.0 && <1.3.1), ascii-th (>=1.2.0 && <1.2.1), base (>=4.16 && <4.19), bytestring (>=0.11.4 && <0.12), text (>=1.2.5 && <1.3 || >=2.0 && <2.1) [details]
License Apache-2.0
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Data, Text
Home page https://github.com/typeclasses/ascii
Bug tracker https://github.com/typeclasses/ascii/issues
Source repo head: git clone git://github.com/typeclasses/ascii.git
Uploaded by chris_martin at 2023-06-26T21:42:53Z
Distributions LTSHaskell:1.7.0.1, NixOS:1.7.0.1
Reverse Dependencies 12 direct, 3896 indirect [details]
Downloads 13213 total (84 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-06-26 [all 1 reports]

Readme for ascii-1.7.0.1

[back to package description]

What is ASCII?

The American Standard Code for Information Interchange (ASCII) comprises a set of 128 characters, each represented by 7 bits. 33 of these characters are "control codes"; a few of these are still in use, but most are obsolete relics of the early days of computing. The other 95 are "printable characters" such as letters and numbers, mostly corresponding to the keys on an American English keyboard.

Nowadays instead of ASCII we typically work with text using an encoding such as UTF-8 that can represent the entire Unicode character set, which includes over a hundred thousand characters and is not limited to the symbols of any particular writing system or culture. However, ASCII is still relevant to network protocols; for example, we can see it in the specification of HTTP.

There is a convenient relationship between ASCII and Unicode: the ASCII characters are the first 128 characters of the much larger Unicode character set. The C0 Controls and Basic Latin section of the Unicode standard contains a list of all the ASCII characters.

Haskell packages

This repository contains the main API, the ASCII module in the ascii package, which is an amalgamation of smaller packages in other repositories.

  • If you only need the ASCII Char type, you can use the ascii-char package, which is minimal so that it can be kept stable.

  • The ascii-group package defines the Group type (Control and Printable), and the ascii-case package defines the Case type (UpperCase and LowerCase). These package are also small and stable.

  • The ascii-predicates package provides additional ways of categorizing characters similar to what you can find in the base package.

  • For case-insensitivity, use the ascii-caseless package.

  • The ascii-superset package defines CharSuperset and StringSuperset classes to generalize types that represent characters and strings, respectively, in character sets larger than ASCII. It also defines the ASCII type constructor, which is used to indicate that a value from some ASCII superset is confined to ASCII.

  • The ascii-numbers package provides utilities for working with numbers represented using ASCII digits 0-9, ASCII letters A-F to represent hexadecimal digits 10-15, and the HyphenMinus character for negation.

  • The ascii-th package provides a quasi-quoter that allows one to safely and conveniently express ASCII string literals. The generated expressions are polymorphic and can take the form of any type belonging to the StringSuperset class, including [ASCII.Char], String, ByteString, and Text.