ascii 1.2.1.0 → 1.2.2.0
raw patch · 2 files changed
+22/−17 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ ASCII: type UnicodeChar = Char
- ASCII: charToUnicode :: Char -> Char
+ ASCII: charToUnicode :: Char -> UnicodeChar
- ASCII: digitToUnicode :: Digit -> Char
+ ASCII: digitToUnicode :: Digit -> UnicodeChar
- ASCII: hexCharToUnicode :: HexChar -> Char
+ ASCII: hexCharToUnicode :: HexChar -> UnicodeChar
- ASCII: unicodeToCharMaybe :: Char -> Maybe Char
+ ASCII: unicodeToCharMaybe :: UnicodeChar -> Maybe Char
- ASCII: unicodeToCharUnsafe :: Char -> Char
+ ASCII: unicodeToCharUnsafe :: UnicodeChar -> Char
- ASCII: unicodeToDigitMaybe :: Char -> Maybe Digit
+ ASCII: unicodeToDigitMaybe :: UnicodeChar -> Maybe Digit
- ASCII: unicodeToDigitUnsafe :: Char -> Digit
+ ASCII: unicodeToDigitUnsafe :: UnicodeChar -> Digit
- ASCII: unicodeToHexCharMaybe :: Char -> Maybe HexChar
+ ASCII: unicodeToHexCharMaybe :: UnicodeChar -> Maybe HexChar
- ASCII: unicodeToHexCharUnsafe :: Char -> HexChar
+ ASCII: unicodeToHexCharUnsafe :: UnicodeChar -> HexChar
Files
- ascii.cabal +1/−1
- library/ASCII.hs +21/−16
ascii.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 name: ascii-version: 1.2.1.0+version: 1.2.2.0 synopsis: The ASCII character set and encoding category: Data, Text
library/ASCII.hs view
@@ -12,7 +12,7 @@ module ASCII (- {- * @Char@ -} {- $char -} Char,+ {- * @Char@ -} {- $char -} Char, UnicodeChar, {- * Character classifications -} {- ** Print/control groups -} {- $groups -}@@ -31,7 +31,7 @@ charToInt, intToCharMaybe, intToCharUnsafe, {- ** @ASCII.Char@ ↔ @Word8@ -} {- $word8Conversions -} charToWord8, word8ToCharMaybe, word8ToCharUnsafe,- {- ** @ASCII.Char@ ↔ Unicode @Char@ -} {- $unicodeCharConversions -}+ {- ** @ASCII.Char@ ↔ @UnicodeChar@ -} {- $unicodeCharConversions -} charToUnicode, unicodeToCharMaybe, unicodeToCharUnsafe, {- * Monomorphic digit conversions -}@@ -39,13 +39,13 @@ digitToWord8, word8ToDigitMaybe, word8ToDigitUnsafe, {- ** @Digit@ ↔ @ASCII.Char@ -} {- $digitCharConversions -} digitToChar, charToDigitMaybe, charToDigitUnsafe,- {- ** @Digit@ ↔ Unicode @Char@ -} {- $digitUnicodeConversions -}+ {- ** @Digit@ ↔ @UnicodeChar@ -} {- $digitUnicodeConversions -} digitToUnicode, unicodeToDigitMaybe, unicodeToDigitUnsafe, {- ** @HexChar@ ↔ @Word8@ -} {- $hexCharWord8Conversions -} hexCharToWord8, word8ToHexCharMaybe, word8ToHexCharUnsafe, {- ** @HexChar@ ↔ @ASCII.Char@ -} {- $hexCharCharConversions -} hexCharToChar, charToHexCharMaybe, charToHexCharUnsafe,- {- ** @HexChar@ ↔ Unicode @Char@ -} {- $hexCharUnicodeConversions -}+ {- ** @HexChar@ ↔ @UnicodeChar@ -} {- $hexCharUnicodeConversions -} hexCharToUnicode, unicodeToHexCharMaybe, unicodeToHexCharUnsafe, {- * Monomorphic string conversions -}@@ -138,6 +138,11 @@ -} +-- | A character in the full range of Unicode+--+-- ASCII 'Char' is a subset of this type. Convert using 'charToUnicode' and 'unicodeToCharMaybe'.+type UnicodeChar = Unicode.Char+ {- $groups ASCII characters are broadly categorized into two groups: /control codes/ and /printable characters/.@@ -290,17 +295,17 @@ {- $unicodeCharConversions -These functions convert between the ASCII 'Char' type and the Unicode 'Unicode.Char' type.+These functions convert between the ASCII 'Char' type and the 'UnicodeChar' type. -} -charToUnicode :: Char -> Unicode.Char+charToUnicode :: Char -> UnicodeChar charToUnicode = ASCII.Superset.fromChar -unicodeToCharMaybe :: Unicode.Char -> Maybe Char+unicodeToCharMaybe :: UnicodeChar -> Maybe Char unicodeToCharMaybe = ASCII.Superset.toCharMaybe -unicodeToCharUnsafe :: Unicode.Char -> Char+unicodeToCharUnsafe :: UnicodeChar -> Char unicodeToCharUnsafe = ASCII.Superset.toCharUnsafe {- $digitWord8Conversions@@ -337,17 +342,17 @@ {- $digitUnicodeConversions -These functions convert between the ASCII 'Digit' type and the Unicode 'Unicode.Char' type.+These functions convert between the ASCII 'Digit' type and the 'UnicodeChar' type. -} -digitToUnicode :: Digit -> Unicode.Char+digitToUnicode :: Digit -> UnicodeChar digitToUnicode = ASCII.Decimal.fromDigit -unicodeToDigitMaybe :: Unicode.Char -> Maybe Digit+unicodeToDigitMaybe :: UnicodeChar -> Maybe Digit unicodeToDigitMaybe = ASCII.Decimal.toDigitMaybe -unicodeToDigitUnsafe :: Unicode.Char -> Digit+unicodeToDigitUnsafe :: UnicodeChar -> Digit unicodeToDigitUnsafe = ASCII.Decimal.toDigitUnsafe @@ -385,17 +390,17 @@ {- $hexCharUnicodeConversions -These functions convert between the ASCII 'HexChar' type and the Unicode 'Unicode.Char' type.+These functions convert between the ASCII 'HexChar' type and the 'UnicodeChar' type. -} -hexCharToUnicode :: HexChar -> Unicode.Char+hexCharToUnicode :: HexChar -> UnicodeChar hexCharToUnicode = ASCII.Hexadecimal.fromHexChar -unicodeToHexCharMaybe :: Unicode.Char -> Maybe HexChar+unicodeToHexCharMaybe :: UnicodeChar -> Maybe HexChar unicodeToHexCharMaybe = ASCII.Hexadecimal.toHexCharMaybe -unicodeToHexCharUnsafe :: Unicode.Char -> HexChar+unicodeToHexCharUnsafe :: UnicodeChar -> HexChar unicodeToHexCharUnsafe = ASCII.Hexadecimal.toHexCharUnsafe {- $unicodeStringConversions