@hackage ascii1.7.0.2
The ASCII character set and encoding
Categories
License
Apache-2.0
Maintainer
Chris Martin, Julie Moronuki
Links
Versions
Installation
Dependencies (11)
- 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 Show all…
Dependents (13)
@hackage/time-http, @hackage/sockets-and-pipes, @hackage/html2hamlet, @hackage/mime-mail, @hackage/acme-everything, @hackage/http-enumerator, Show all…
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
Chartype, you can use theascii-charpackage, which is minimal so that it can be kept stable. -
The
ascii-grouppackage defines theGrouptype (ControlandPrintable), and theascii-casepackage defines theCasetype (UpperCaseandLowerCase). These package are also small and stable. -
The
ascii-predicatespackage provides additional ways of categorizing characters similar to what you can find in thebasepackage. -
For case-insensitivity, use the
ascii-caselesspackage. -
The
ascii-supersetpackage definesCharSupersetandStringSupersetclasses to generalize types that represent characters and strings, respectively, in character sets larger than ASCII. It also defines theASCIItype constructor, which is used to indicate that a value from some ASCII superset is confined to ASCII. -
The
ascii-numberspackage provides utilities for working with numbers represented using ASCII digits 0-9, ASCII letters A-F to represent hexadecimal digits 10-15, and theHyphenMinuscharacter for negation. -
The
ascii-thpackage 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 theStringSupersetclass, including[ASCII.Char],String,ByteString, andText.