character-ps (empty) → 0.1
raw patch · 6 files changed
+2187/−0 lines, 6 filesdep +basedep +character-ps
Dependencies added: base, character-ps
Files
- LICENSE +30/−0
- character-ps.cabal +59/−0
- src/Data/Char/Patterns.hs +560/−0
- src/Data/Word16/Patterns.hs +562/−0
- src/Data/Word8/Patterns.hs +562/−0
- tests/character-ps-tests.hs +414/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2023, Oleg Grenrus++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Oleg Grenrus nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ character-ps.cabal view
@@ -0,0 +1,59 @@+cabal-version: 2.2+name: character-ps+version: 0.1+synopsis: Pattern synonyms for ASCII characters for Word8, Word16 etc+description:+ Pattern synonyms for ASCII characters, e.g.+ .+ @+ pattern SPACE :: Word8+ pattern SPACE = 0x20+ @++homepage: https://github.com/phadej/character-ps+bug-reports: https://github.com/phadej/character-ps/issues+license: BSD-3-Clause+license-file: LICENSE+author: Oleg Grenrus <oleg.grenrus@iki.fi>+maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>+category: Data+build-type: Simple+tested-with:+ GHC ==8.0.2+ || ==8.2.2+ || ==8.4.4+ || ==8.6.5+ || ==8.8.4+ || ==8.10.7+ || ==9.0.2+ || ==9.2.8+ || ==9.4.7+ || ==9.6.3+ || ==9.8.1++source-repository head+ type: git+ location: https://github.com/phadej/character-ps.git++common language+ default-language: Haskell2010+ default-extensions: PatternSynonyms++library+ import: language+ hs-source-dirs: src+ exposed-modules:+ Data.Char.Patterns+ Data.Word16.Patterns+ Data.Word8.Patterns++ build-depends: base >=4.9 && <5++test-suite character-ps-tests+ import: language+ hs-source-dirs: tests+ main-is: character-ps-tests.hs+ type: exitcode-stdio-1.0+ build-depends:+ , base+ , character-ps
+ src/Data/Char/Patterns.hs view
@@ -0,0 +1,560 @@+-- | This module provides pattern synonyms for 'Char' in [Basic Latin block](https://compart.com/en/unicode/block/U+0000) (range @'\x00'-'\x7f'@).+--+-- The pattern names are inspired by Unicode (letter and digits) and PostScript names (symbols),+-- e.g. @/@ is 'SLASH', not @SOLIDUS@.+--+-- This module is designed to be imported qualified+--+-- @+-- import "Data.Char.Patterns" as C+--+-- hello = [C.'LOWER_H', C.'LOWER_E', C.'LOWER_L', C.'LOWER_L', C.'LOWER_O']+-- @+--+-- but can also be used unqualified as well.+--+module Data.Char.Patterns where++-------------------------------------------------------------------------------+-- * Control characters, x00-x1f+-------------------------------------------------------------------------------++-- | Null character (NUL)+pattern NUL :: Char+pattern NUL = '\x00'++-- | Start of Heading (SOH)+pattern SOH :: Char+pattern SOH = '\x01'++-- | Start of Text (STX)+pattern STX :: Char+pattern STX = '\x02'++-- | End of Text (ETX)+pattern ETX :: Char+pattern ETX = '\x03'++-- | End of Transmission (EOT)+pattern EOT :: Char+pattern EOT = '\x04'++-- | Enquiry (ENQ)+pattern ENQ :: Char+pattern ENQ = '\x05'++-- | Acknowledge (ACK)+pattern ACK :: Char+pattern ACK = '\x06'++-- | Alert (BEL)+pattern BEL :: Char+pattern BEL = '\x07'++-- | Backspace (BS)+pattern BS :: Char+pattern BS = '\x08'++-- | Character tabulation (TAB)+pattern TAB :: Char+pattern TAB = '\x09'++-- | End of line, line feed (LF)+pattern LF :: Char+pattern LF = '\x0a'++-- | Line tabulation, vertical tab (VT)+pattern VT :: Char+pattern VT = '\x0b'++-- | Form feed (FF)+pattern FF :: Char+pattern FF = '\x0c'++-- | Carriage Return (CR)+pattern CR :: Char+pattern CR = '\x0d'++-- | Locking-Shift One, Shift Out (SO)+pattern SO :: Char+pattern SO = '\x0e'++-- | Locking-Shift Zero, Shift In (SI)+pattern SI :: Char+pattern SI = '\x0f'++-- | Data Link Escape (DLE)+pattern DLE :: Char+pattern DLE = '\x10'++-- | Device Control One, XON (DC1)+pattern DC1 :: Char+pattern DC1 = '\x11'++-- | Device Control Two (DC2)+pattern DC2 :: Char+pattern DC2 = '\x12'++-- | Device Control Three, XOFF (DC3)+pattern DC3 :: Char+pattern DC3 = '\x13'++-- | Device Control Four (DC4)+pattern DC4 :: Char+pattern DC4 = '\x14'++-- | Negative Acknowledge (NAK)+pattern NAK :: Char+pattern NAK = '\x15'++-- | Syncronous Idle (SYN)+pattern SYN :: Char+pattern SYN = '\x16'++-- | End of Transmission Block (ETB)+pattern ETB :: Char+pattern ETB = '\x17'++-- | Cancel (CAN)+pattern CAN :: Char+pattern CAN = '\x18'++-- | End of Medium (EOM)+pattern EOM :: Char+pattern EOM = '\x19'++-- | Substitute (SUB)+pattern SUB :: Char+pattern SUB = '\x1a'++-- | Escape (ESC)+pattern ESC :: Char+pattern ESC = '\x1b'++-- | File Separator (FS)+pattern FS :: Char+pattern FS = '\x1c'++-- | Group Separator (GS)+pattern GS :: Char+pattern GS = '\x1d'++-- | Information Separator One, Record Separator (RS)+pattern RS :: Char+pattern RS = '\x1e'++-- | Information Separator Two, Unit Separator (US)+pattern US :: Char+pattern US = '\x1f'++-------------------------------------------------------------------------------+-- * Symbols 1, x20-x2f+-------------------------------------------------------------------------------++-- | Space (SP), @' '@.+pattern SPACE :: Char+pattern SPACE = '\x20'++-- | Exclamation mark, @!@+pattern EXCLAM :: Char+pattern EXCLAM = '\x21'++-- | Quotation mark, double quote, @"@+pattern DOUBLE_QUOTE :: Char+pattern DOUBLE_QUOTE = '\x22'++-- | Number sign, @#@+pattern NUMBER :: Char+pattern NUMBER = '\x23'++-- | Dollar sign, @$@+pattern DOLLAR :: Char+pattern DOLLAR = '\x24'++-- | Percent sign, @%@+pattern PERCENT :: Char+pattern PERCENT = '\x25'++-- | Ampersand, @&@+pattern AMPERSAND :: Char+pattern AMPERSAND = '\x26'++-- | Apostrophe, single quote, @'@+pattern SINGLE_QUOTE :: Char+pattern SINGLE_QUOTE = '\x27'++-- | Left parenthesis, @(@+pattern LEFT_PAREN :: Char+pattern LEFT_PAREN = '\x28'++-- | Right parenthesis, @)@+pattern RIGHT_PAREN :: Char+pattern RIGHT_PAREN = '\x29'++-- | Asterisk, @*@+pattern ASTERISK :: Char+pattern ASTERISK = '\x2a'++-- | Plus sign, @+@+pattern PLUS :: Char+pattern PLUS = '\x2b'++-- | Comma, @,@+pattern COMMA :: Char+pattern COMMA = '\x2c'++-- | Hyphen-minus, @-@+pattern HYPHEN :: Char+pattern HYPHEN = '\x2d'++-- | Full stop, period, @.@+pattern PERIOD :: Char+pattern PERIOD = '\x2e'++-- | Solidus, slash, @/@+pattern SLASH :: Char+pattern SLASH = '\x2f'++-------------------------------------------------------------------------------+-- * Digits, x30-x39+-------------------------------------------------------------------------------++-- | Digit 0, @0@+pattern DIGIT_0 :: Char+pattern DIGIT_0 = '\x30'++-- | Digit 1, @1@+pattern DIGIT_1 :: Char+pattern DIGIT_1 = '\x31'++-- | Digit 2, @2@+pattern DIGIT_2 :: Char+pattern DIGIT_2 = '\x32'++-- | Digit 3, @3@+pattern DIGIT_3 :: Char+pattern DIGIT_3 = '\x33'++-- | Digit 4, @4@+pattern DIGIT_4 :: Char+pattern DIGIT_4 = '\x34'++-- | Digit 5, @5@+pattern DIGIT_5 :: Char+pattern DIGIT_5 = '\x35'++-- | Digit 6, @6@+pattern DIGIT_6 :: Char+pattern DIGIT_6 = '\x36'++-- | Digit 7, @7@+pattern DIGIT_7 :: Char+pattern DIGIT_7 = '\x37'++-- | Digit 8, @8@+pattern DIGIT_8 :: Char+pattern DIGIT_8 = '\x38'++-- | Digit 9, @9@+pattern DIGIT_9 :: Char+pattern DIGIT_9 = '\x39'++-------------------------------------------------------------------------------+-- * Symbols 2, x3a-x40+-------------------------------------------------------------------------------++-- | Colon, @:@+pattern COLON :: Char+pattern COLON = '\x3a'++-- | Semicolon, @;@+pattern SEMICOLON :: Char+pattern SEMICOLON = '\x3b'++-- | Less-than sign, @<@+pattern LESS :: Char+pattern LESS = '\x3c'++-- | Equals sign, @=@+pattern EQUAL :: Char+pattern EQUAL = '\x3d'++-- | Greater-than sign, @>@+pattern GREATER :: Char+pattern GREATER = '\x3e'++-- | Question mark, @?@+pattern QUESTION :: Char+pattern QUESTION = '\x3f'++-- | Commercial At, @\@@+pattern AT :: Char+pattern AT = '\x40'++-------------------------------------------------------------------------------+-- * Upper case letters, x41-x5a+-------------------------------------------------------------------------------++-- | Latin small letter A, @A@+pattern UPPER_A :: Char+pattern UPPER_A = '\x41'++-- | Latin small letter B, @B@+pattern UPPER_B :: Char+pattern UPPER_B = '\x42'++-- | Latin small letter C, @C@+pattern UPPER_C :: Char+pattern UPPER_C = '\x43'++-- | Latin small letter D, @D@+pattern UPPER_D :: Char+pattern UPPER_D = '\x44'++-- | Latin small letter E, @E@+pattern UPPER_E :: Char+pattern UPPER_E = '\x45'++-- | Latin small letter F, @F@+pattern UPPER_F :: Char+pattern UPPER_F = '\x46'++-- | Latin small letter G, @G@+pattern UPPER_G :: Char+pattern UPPER_G = '\x47'++-- | Latin small letter H, @H@+pattern UPPER_H :: Char+pattern UPPER_H = '\x48'++-- | Latin small letter I, @I@+pattern UPPER_I :: Char+pattern UPPER_I = '\x49'++-- | Latin small letter J, @J@+pattern UPPER_J :: Char+pattern UPPER_J = '\x4a'++-- | Latin small letter K, @K@+pattern UPPER_K :: Char+pattern UPPER_K = '\x4b'++-- | Latin small letter L, @L@+pattern UPPER_L :: Char+pattern UPPER_L = '\x4c'++-- | Latin small letter M, @M@+pattern UPPER_M :: Char+pattern UPPER_M = '\x4d'++-- | Latin small letter N, @N@+pattern UPPER_N :: Char+pattern UPPER_N = '\x4e'++-- | Latin small letter O, @O@+pattern UPPER_O :: Char+pattern UPPER_O = '\x4f'++-- | Latin small letter P, @P@+pattern UPPER_P :: Char+pattern UPPER_P = '\x50'++-- | Latin small letter Q, @Q@+pattern UPPER_Q :: Char+pattern UPPER_Q = '\x51'++-- | Latin small letter R, @R@+pattern UPPER_R :: Char+pattern UPPER_R = '\x52'++-- | Latin small letter S, @S@+pattern UPPER_S :: Char+pattern UPPER_S = '\x53'++-- | Latin small letter T, @T@+pattern UPPER_T :: Char+pattern UPPER_T = '\x54'++-- | Latin small letter U, @U@+pattern UPPER_U :: Char+pattern UPPER_U = '\x55'++-- | Latin small letter V, @V@+pattern UPPER_V :: Char+pattern UPPER_V = '\x56'++-- | Latin small letter W, @W@+pattern UPPER_W :: Char+pattern UPPER_W = '\x57'++-- | Latin small letter X, @X@+pattern UPPER_X :: Char+pattern UPPER_X = '\x58'++-- | Latin small letter Y, @Y@+pattern UPPER_Y :: Char+pattern UPPER_Y = '\x59'++-- | Latin small letter Z, @Z@+pattern UPPER_Z :: Char+pattern UPPER_Z = '\x5a'++-------------------------------------------------------------------------------+-- * Symbols 3, x5b-x60+-------------------------------------------------------------------------------++-- | Left square bracket, @[@+pattern LEFT_SQUARE :: Char+pattern LEFT_SQUARE = '\x5b'++-- | Reverse solidus, backslash, @\\@+pattern BACKSLASH :: Char+pattern BACKSLASH = '\x5c'++-- | Right square bracket, @]@+pattern RIGHT_SQUARE :: Char+pattern RIGHT_SQUARE = '\x5d'++-- | Circumflex accent, @^@+pattern CIRCUM :: Char+pattern CIRCUM = '\x5e'++-- | Low line, underscore, @_@+pattern UNDERSCORE :: Char+pattern UNDERSCORE = '\x5f'++-- | Grave accent, @`@+pattern GRAVE :: Char+pattern GRAVE = '\x60'++-------------------------------------------------------------------------------+-- * Lower case letters, x61-x7a+-------------------------------------------------------------------------------++-- | Latin small letter A, @a@+pattern LOWER_A :: Char+pattern LOWER_A = '\x61'++-- | Latin small letter B, @b@+pattern LOWER_B :: Char+pattern LOWER_B = '\x62'++-- | Latin small letter C, @c@+pattern LOWER_C :: Char+pattern LOWER_C = '\x63'++-- | Latin small letter D, @d@+pattern LOWER_D :: Char+pattern LOWER_D = '\x64'++-- | Latin small letter E, @e@+pattern LOWER_E :: Char+pattern LOWER_E = '\x65'++-- | Latin small letter F, @f@+pattern LOWER_F :: Char+pattern LOWER_F = '\x66'++-- | Latin small letter G, @g@+pattern LOWER_G :: Char+pattern LOWER_G = '\x67'++-- | Latin small letter H, @h@+pattern LOWER_H :: Char+pattern LOWER_H = '\x68'++-- | Latin small letter I, @i@+pattern LOWER_I :: Char+pattern LOWER_I = '\x69'++-- | Latin small letter J, @j@+pattern LOWER_J :: Char+pattern LOWER_J = '\x6a'++-- | Latin small letter K, @k@+pattern LOWER_K :: Char+pattern LOWER_K = '\x6b'++-- | Latin small letter L, @l@+pattern LOWER_L :: Char+pattern LOWER_L = '\x6c'++-- | Latin small letter M, @m@+pattern LOWER_M :: Char+pattern LOWER_M = '\x6d'++-- | Latin small letter N, @n@+pattern LOWER_N :: Char+pattern LOWER_N = '\x6e'++-- | Latin small letter O, @o@+pattern LOWER_O :: Char+pattern LOWER_O = '\x6f'++-- | Latin small letter P, @p@+pattern LOWER_P :: Char+pattern LOWER_P = '\x70'++-- | Latin small letter Q, @q@+pattern LOWER_Q :: Char+pattern LOWER_Q = '\x71'++-- | Latin small letter R, @r@+pattern LOWER_R :: Char+pattern LOWER_R = '\x72'++-- | Latin small letter S, @s@+pattern LOWER_S :: Char+pattern LOWER_S = '\x73'++-- | Latin small letter T, @t@+pattern LOWER_T :: Char+pattern LOWER_T = '\x74'++-- | Latin small letter U, @u@+pattern LOWER_U :: Char+pattern LOWER_U = '\x75'++-- | Latin small letter V, @v@+pattern LOWER_V :: Char+pattern LOWER_V = '\x76'++-- | Latin small letter W, @w@+pattern LOWER_W :: Char+pattern LOWER_W = '\x77'++-- | Latin small letter X, @x@+pattern LOWER_X :: Char+pattern LOWER_X = '\x78'++-- | Latin small letter Y, @y@+pattern LOWER_Y :: Char+pattern LOWER_Y = '\x79'++-- | Latin small letter Z, @z@+pattern LOWER_Z :: Char+pattern LOWER_Z = '\x7a'++-------------------------------------------------------------------------------+-- * Symbols 5, x7b-x7f+-------------------------------------------------------------------------------++-- | Left curly bracket, @{@+pattern LEFT_CURLY :: Char+pattern LEFT_CURLY = '\x7b'++-- | Vertical line, vecrtical bar, @|@+pattern BAR :: Char+pattern BAR = '\x7c'++-- | Right curly bracket, @}@+pattern RIGHT_CURLY :: Char+pattern RIGHT_CURLY = '\x7d'++-- | Tilde, @~@+pattern TILDE :: Char+pattern TILDE = '\x7e'++-- | Delete (DEL)+pattern DEL :: Char+pattern DEL = '\x7f'
+ src/Data/Word16/Patterns.hs view
@@ -0,0 +1,562 @@+-- | This module provides pattern synonyms for 'Word16' in [Basic Latin block](https://compart.com/en/unicode/block/U+0000) (range @0x00-0x7f@).+--+-- The pattern names are inspired by Unicode (letter and digits) and PostScript names (symbols),+-- e.g. @/@ is 'SLASH', not @SOLIDUS@.+--+-- This module is designed to be imported qualified+--+-- @+-- import "Data.Word16.Patterns" as W16+--+-- hello = [W16.'LOWER_H', W16.'LOWER_E', W16.'LOWER_L', W16.'LOWER_L', W16.'LOWER_O']+-- @+--+-- but can also be used unqualified as well.+--+module Data.Word16.Patterns where++import Data.Word (Word16)++-------------------------------------------------------------------------------+-- * Control characters, x00-x1f+-------------------------------------------------------------------------------++-- | Null character (NUL)+pattern NUL :: Word16+pattern NUL = 0x00++-- | Start of Heading (SOH)+pattern SOH :: Word16+pattern SOH = 0x01++-- | Start of Text (STX)+pattern STX :: Word16+pattern STX = 0x02++-- | End of Text (ETX)+pattern ETX :: Word16+pattern ETX = 0x03++-- | End of Transmission (EOT)+pattern EOT :: Word16+pattern EOT = 0x04++-- | Enquiry (ENQ)+pattern ENQ :: Word16+pattern ENQ = 0x05++-- | Acknowledge (ACK)+pattern ACK :: Word16+pattern ACK = 0x06++-- | Alert (BEL)+pattern BEL :: Word16+pattern BEL = 0x07++-- | Backspace (BS)+pattern BS :: Word16+pattern BS = 0x08++-- | Character tabulation (TAB)+pattern TAB :: Word16+pattern TAB = 0x09++-- | End of line, line feed (LF)+pattern LF :: Word16+pattern LF = 0x0a++-- | Line tabulation, vertical tab (VT)+pattern VT :: Word16+pattern VT = 0x0b++-- | Form feed (FF)+pattern FF :: Word16+pattern FF = 0x0c++-- | Carriage Return (CR)+pattern CR :: Word16+pattern CR = 0x0d++-- | Locking-Shift One, Shift Out (SO)+pattern SO :: Word16+pattern SO = 0x0e++-- | Locking-Shift Zero, Shift In (SI)+pattern SI :: Word16+pattern SI = 0x0f++-- | Data Link Escape (DLE)+pattern DLE :: Word16+pattern DLE = 0x10++-- | Device Control One, XON (DC1)+pattern DC1 :: Word16+pattern DC1 = 0x11++-- | Device Control Two (DC2)+pattern DC2 :: Word16+pattern DC2 = 0x12++-- | Device Control Three, XOFF (DC3)+pattern DC3 :: Word16+pattern DC3 = 0x13++-- | Device Control Four (DC4)+pattern DC4 :: Word16+pattern DC4 = 0x14++-- | Negative Acknowledge (NAK)+pattern NAK :: Word16+pattern NAK = 0x15++-- | Syncronous Idle (SYN)+pattern SYN :: Word16+pattern SYN = 0x16++-- | End of Transmission Block (ETB)+pattern ETB :: Word16+pattern ETB = 0x17++-- | Cancel (CAN)+pattern CAN :: Word16+pattern CAN = 0x18++-- | End of Medium (EOM)+pattern EOM :: Word16+pattern EOM = 0x19++-- | Substitute (SUB)+pattern SUB :: Word16+pattern SUB = 0x1a++-- | Escape (ESC)+pattern ESC :: Word16+pattern ESC = 0x1b++-- | File Separator (FS)+pattern FS :: Word16+pattern FS = 0x1c++-- | Group Separator (GS)+pattern GS :: Word16+pattern GS = 0x1d++-- | Information Separator One, Record Separator (RS)+pattern RS :: Word16+pattern RS = 0x1e++-- | Information Separator Two, Unit Separator (US)+pattern US :: Word16+pattern US = 0x1f++-------------------------------------------------------------------------------+-- * Symbols 1, x20-x2f+-------------------------------------------------------------------------------++-- | Space (SP), @' '@.+pattern SPACE :: Word16+pattern SPACE = 0x20++-- | Exclamation mark, @!@+pattern EXCLAM :: Word16+pattern EXCLAM = 0x21++-- | Quotation mark, double quote, @"@+pattern DOUBLE_QUOTE :: Word16+pattern DOUBLE_QUOTE = 0x22++-- | Number sign, @#@+pattern NUMBER :: Word16+pattern NUMBER = 0x23++-- | Dollar sign, @$@+pattern DOLLAR :: Word16+pattern DOLLAR = 0x24++-- | Percent sign, @%@+pattern PERCENT :: Word16+pattern PERCENT = 0x25++-- | Ampersand, @&@+pattern AMPERSAND :: Word16+pattern AMPERSAND = 0x26++-- | Apostrophe, single quote, @'@+pattern SINGLE_QUOTE :: Word16+pattern SINGLE_QUOTE = 0x27++-- | Left parenthesis, @(@+pattern LEFT_PAREN :: Word16+pattern LEFT_PAREN = 0x28++-- | Right parenthesis, @)@+pattern RIGHT_PAREN :: Word16+pattern RIGHT_PAREN = 0x29++-- | Asterisk, @*@+pattern ASTERISK :: Word16+pattern ASTERISK = 0x2a++-- | Plus sign, @+@+pattern PLUS :: Word16+pattern PLUS = 0x2b++-- | Comma, @,@+pattern COMMA :: Word16+pattern COMMA = 0x2c++-- | Hyphen-minus, @-@+pattern HYPHEN :: Word16+pattern HYPHEN = 0x2d++-- | Full stop, period, @.@+pattern PERIOD :: Word16+pattern PERIOD = 0x2e++-- | Solidus, slash, @/@+pattern SLASH :: Word16+pattern SLASH = 0x2f++-------------------------------------------------------------------------------+-- * Digits, x30-x39+-------------------------------------------------------------------------------++-- | Digit 0, @0@+pattern DIGIT_0 :: Word16+pattern DIGIT_0 = 0x30++-- | Digit 1, @1@+pattern DIGIT_1 :: Word16+pattern DIGIT_1 = 0x31++-- | Digit 2, @2@+pattern DIGIT_2 :: Word16+pattern DIGIT_2 = 0x32++-- | Digit 3, @3@+pattern DIGIT_3 :: Word16+pattern DIGIT_3 = 0x33++-- | Digit 4, @4@+pattern DIGIT_4 :: Word16+pattern DIGIT_4 = 0x34++-- | Digit 5, @5@+pattern DIGIT_5 :: Word16+pattern DIGIT_5 = 0x35++-- | Digit 6, @6@+pattern DIGIT_6 :: Word16+pattern DIGIT_6 = 0x36++-- | Digit 7, @7@+pattern DIGIT_7 :: Word16+pattern DIGIT_7 = 0x37++-- | Digit 8, @8@+pattern DIGIT_8 :: Word16+pattern DIGIT_8 = 0x38++-- | Digit 9, @9@+pattern DIGIT_9 :: Word16+pattern DIGIT_9 = 0x39++-------------------------------------------------------------------------------+-- * Symbols 2, x3a-x40+-------------------------------------------------------------------------------++-- | Colon, @:@+pattern COLON :: Word16+pattern COLON = 0x3a++-- | Semicolon, @;@+pattern SEMICOLON :: Word16+pattern SEMICOLON = 0x3b++-- | Less-than sign, @<@+pattern LESS :: Word16+pattern LESS = 0x3c++-- | Equals sign, @=@+pattern EQUAL :: Word16+pattern EQUAL = 0x3d++-- | Greater-than sign, @>@+pattern GREATER :: Word16+pattern GREATER = 0x3e++-- | Question mark, @?@+pattern QUESTION :: Word16+pattern QUESTION = 0x3f++-- | Commercial At, @\@@+pattern AT :: Word16+pattern AT = 0x40++-------------------------------------------------------------------------------+-- * Upper case letters, x41-x5a+-------------------------------------------------------------------------------++-- | Latin small letter A, @A@+pattern UPPER_A :: Word16+pattern UPPER_A = 0x41++-- | Latin small letter B, @B@+pattern UPPER_B :: Word16+pattern UPPER_B = 0x42++-- | Latin small letter C, @C@+pattern UPPER_C :: Word16+pattern UPPER_C = 0x43++-- | Latin small letter D, @D@+pattern UPPER_D :: Word16+pattern UPPER_D = 0x44++-- | Latin small letter E, @E@+pattern UPPER_E :: Word16+pattern UPPER_E = 0x45++-- | Latin small letter F, @F@+pattern UPPER_F :: Word16+pattern UPPER_F = 0x46++-- | Latin small letter G, @G@+pattern UPPER_G :: Word16+pattern UPPER_G = 0x47++-- | Latin small letter H, @H@+pattern UPPER_H :: Word16+pattern UPPER_H = 0x48++-- | Latin small letter I, @I@+pattern UPPER_I :: Word16+pattern UPPER_I = 0x49++-- | Latin small letter J, @J@+pattern UPPER_J :: Word16+pattern UPPER_J = 0x4a++-- | Latin small letter K, @K@+pattern UPPER_K :: Word16+pattern UPPER_K = 0x4b++-- | Latin small letter L, @L@+pattern UPPER_L :: Word16+pattern UPPER_L = 0x4c++-- | Latin small letter M, @M@+pattern UPPER_M :: Word16+pattern UPPER_M = 0x4d++-- | Latin small letter N, @N@+pattern UPPER_N :: Word16+pattern UPPER_N = 0x4e++-- | Latin small letter O, @O@+pattern UPPER_O :: Word16+pattern UPPER_O = 0x4f++-- | Latin small letter P, @P@+pattern UPPER_P :: Word16+pattern UPPER_P = 0x50++-- | Latin small letter Q, @Q@+pattern UPPER_Q :: Word16+pattern UPPER_Q = 0x51++-- | Latin small letter R, @R@+pattern UPPER_R :: Word16+pattern UPPER_R = 0x52++-- | Latin small letter S, @S@+pattern UPPER_S :: Word16+pattern UPPER_S = 0x53++-- | Latin small letter T, @T@+pattern UPPER_T :: Word16+pattern UPPER_T = 0x54++-- | Latin small letter U, @U@+pattern UPPER_U :: Word16+pattern UPPER_U = 0x55++-- | Latin small letter V, @V@+pattern UPPER_V :: Word16+pattern UPPER_V = 0x56++-- | Latin small letter W, @W@+pattern UPPER_W :: Word16+pattern UPPER_W = 0x57++-- | Latin small letter X, @X@+pattern UPPER_X :: Word16+pattern UPPER_X = 0x58++-- | Latin small letter Y, @Y@+pattern UPPER_Y :: Word16+pattern UPPER_Y = 0x59++-- | Latin small letter Z, @Z@+pattern UPPER_Z :: Word16+pattern UPPER_Z = 0x5a++-------------------------------------------------------------------------------+-- * Symbols 3, x5b-x60+-------------------------------------------------------------------------------++-- | Left square bracket, @[@+pattern LEFT_SQUARE :: Word16+pattern LEFT_SQUARE = 0x5b++-- | Reverse solidus, backslash, @\\@+pattern BACKSLASH :: Word16+pattern BACKSLASH = 0x5c++-- | Right square bracket, @]@+pattern RIGHT_SQUARE :: Word16+pattern RIGHT_SQUARE = 0x5d++-- | Circumflex accent, @^@+pattern CIRCUM :: Word16+pattern CIRCUM = 0x5e++-- | Low line, underscore, @_@+pattern UNDERSCORE :: Word16+pattern UNDERSCORE = 0x5f++-- | Grave accent, @`@+pattern GRAVE :: Word16+pattern GRAVE = 0x60++-------------------------------------------------------------------------------+-- * Lower case letters, x61-x7a+-------------------------------------------------------------------------------++-- | Latin small letter A, @a@+pattern LOWER_A :: Word16+pattern LOWER_A = 0x61++-- | Latin small letter B, @b@+pattern LOWER_B :: Word16+pattern LOWER_B = 0x62++-- | Latin small letter C, @c@+pattern LOWER_C :: Word16+pattern LOWER_C = 0x63++-- | Latin small letter D, @d@+pattern LOWER_D :: Word16+pattern LOWER_D = 0x64++-- | Latin small letter E, @e@+pattern LOWER_E :: Word16+pattern LOWER_E = 0x65++-- | Latin small letter F, @f@+pattern LOWER_F :: Word16+pattern LOWER_F = 0x66++-- | Latin small letter G, @g@+pattern LOWER_G :: Word16+pattern LOWER_G = 0x67++-- | Latin small letter H, @h@+pattern LOWER_H :: Word16+pattern LOWER_H = 0x68++-- | Latin small letter I, @i@+pattern LOWER_I :: Word16+pattern LOWER_I = 0x69++-- | Latin small letter J, @j@+pattern LOWER_J :: Word16+pattern LOWER_J = 0x6a++-- | Latin small letter K, @k@+pattern LOWER_K :: Word16+pattern LOWER_K = 0x6b++-- | Latin small letter L, @l@+pattern LOWER_L :: Word16+pattern LOWER_L = 0x6c++-- | Latin small letter M, @m@+pattern LOWER_M :: Word16+pattern LOWER_M = 0x6d++-- | Latin small letter N, @n@+pattern LOWER_N :: Word16+pattern LOWER_N = 0x6e++-- | Latin small letter O, @o@+pattern LOWER_O :: Word16+pattern LOWER_O = 0x6f++-- | Latin small letter P, @p@+pattern LOWER_P :: Word16+pattern LOWER_P = 0x70++-- | Latin small letter Q, @q@+pattern LOWER_Q :: Word16+pattern LOWER_Q = 0x71++-- | Latin small letter R, @r@+pattern LOWER_R :: Word16+pattern LOWER_R = 0x72++-- | Latin small letter S, @s@+pattern LOWER_S :: Word16+pattern LOWER_S = 0x73++-- | Latin small letter T, @t@+pattern LOWER_T :: Word16+pattern LOWER_T = 0x74++-- | Latin small letter U, @u@+pattern LOWER_U :: Word16+pattern LOWER_U = 0x75++-- | Latin small letter V, @v@+pattern LOWER_V :: Word16+pattern LOWER_V = 0x76++-- | Latin small letter W, @w@+pattern LOWER_W :: Word16+pattern LOWER_W = 0x77++-- | Latin small letter X, @x@+pattern LOWER_X :: Word16+pattern LOWER_X = 0x78++-- | Latin small letter Y, @y@+pattern LOWER_Y :: Word16+pattern LOWER_Y = 0x79++-- | Latin small letter Z, @z@+pattern LOWER_Z :: Word16+pattern LOWER_Z = 0x7a++-------------------------------------------------------------------------------+-- * Symbols 5, x7b-x7f+-------------------------------------------------------------------------------++-- | Left curly bracket, @{@+pattern LEFT_CURLY :: Word16+pattern LEFT_CURLY = 0x7b++-- | Vertical line, vecrtical bar, @|@+pattern BAR :: Word16+pattern BAR = 0x7c++-- | Right curly bracket, @}@+pattern RIGHT_CURLY :: Word16+pattern RIGHT_CURLY = 0x7d++-- | Tilde, @~@+pattern TILDE :: Word16+pattern TILDE = 0x7e++-- | Delete (DEL)+pattern DEL :: Word16+pattern DEL = 0x7f
+ src/Data/Word8/Patterns.hs view
@@ -0,0 +1,562 @@+-- | This module provides pattern synonyms for 'Word8' in [Basic Latin block](https://compart.com/en/unicode/block/U+0000) (range @0x00-0x7f@).+--+-- The pattern names are inspired by Unicode (letter and digits) and PostScript names (symbols),+-- e.g. @/@ is 'SLASH', not @SOLIDUS@.+--+-- This module is designed to be imported qualified+--+-- @+-- import "Data.Word8.Patterns" as W8+--+-- hello = [W8.'LOWER_H', W8.'LOWER_E', W8.'LOWER_L', W8.'LOWER_L', W8.'LOWER_O']+-- @+--+-- but can also be used unqualified as well.+--+module Data.Word8.Patterns where++import Data.Word (Word8)++-------------------------------------------------------------------------------+-- * Control characters, x00-x1f+-------------------------------------------------------------------------------++-- | Null character (NUL)+pattern NUL :: Word8+pattern NUL = 0x00++-- | Start of Heading (SOH)+pattern SOH :: Word8+pattern SOH = 0x01++-- | Start of Text (STX)+pattern STX :: Word8+pattern STX = 0x02++-- | End of Text (ETX)+pattern ETX :: Word8+pattern ETX = 0x03++-- | End of Transmission (EOT)+pattern EOT :: Word8+pattern EOT = 0x04++-- | Enquiry (ENQ)+pattern ENQ :: Word8+pattern ENQ = 0x05++-- | Acknowledge (ACK)+pattern ACK :: Word8+pattern ACK = 0x06++-- | Alert (BEL)+pattern BEL :: Word8+pattern BEL = 0x07++-- | Backspace (BS)+pattern BS :: Word8+pattern BS = 0x08++-- | Character tabulation (TAB)+pattern TAB :: Word8+pattern TAB = 0x09++-- | End of line, line feed (LF)+pattern LF :: Word8+pattern LF = 0x0a++-- | Line tabulation, vertical tab (VT)+pattern VT :: Word8+pattern VT = 0x0b++-- | Form feed (FF)+pattern FF :: Word8+pattern FF = 0x0c++-- | Carriage Return (CR)+pattern CR :: Word8+pattern CR = 0x0d++-- | Locking-Shift One, Shift Out (SO)+pattern SO :: Word8+pattern SO = 0x0e++-- | Locking-Shift Zero, Shift In (SI)+pattern SI :: Word8+pattern SI = 0x0f++-- | Data Link Escape (DLE)+pattern DLE :: Word8+pattern DLE = 0x10++-- | Device Control One, XON (DC1)+pattern DC1 :: Word8+pattern DC1 = 0x11++-- | Device Control Two (DC2)+pattern DC2 :: Word8+pattern DC2 = 0x12++-- | Device Control Three, XOFF (DC3)+pattern DC3 :: Word8+pattern DC3 = 0x13++-- | Device Control Four (DC4)+pattern DC4 :: Word8+pattern DC4 = 0x14++-- | Negative Acknowledge (NAK)+pattern NAK :: Word8+pattern NAK = 0x15++-- | Syncronous Idle (SYN)+pattern SYN :: Word8+pattern SYN = 0x16++-- | End of Transmission Block (ETB)+pattern ETB :: Word8+pattern ETB = 0x17++-- | Cancel (CAN)+pattern CAN :: Word8+pattern CAN = 0x18++-- | End of Medium (EOM)+pattern EOM :: Word8+pattern EOM = 0x19++-- | Substitute (SUB)+pattern SUB :: Word8+pattern SUB = 0x1a++-- | Escape (ESC)+pattern ESC :: Word8+pattern ESC = 0x1b++-- | File Separator (FS)+pattern FS :: Word8+pattern FS = 0x1c++-- | Group Separator (GS)+pattern GS :: Word8+pattern GS = 0x1d++-- | Information Separator One, Record Separator (RS)+pattern RS :: Word8+pattern RS = 0x1e++-- | Information Separator Two, Unit Separator (US)+pattern US :: Word8+pattern US = 0x1f++-------------------------------------------------------------------------------+-- * Symbols 1, x20-x2f+-------------------------------------------------------------------------------++-- | Space (SP), @' '@.+pattern SPACE :: Word8+pattern SPACE = 0x20++-- | Exclamation mark, @!@+pattern EXCLAM :: Word8+pattern EXCLAM = 0x21++-- | Quotation mark, double quote, @"@+pattern DOUBLE_QUOTE :: Word8+pattern DOUBLE_QUOTE = 0x22++-- | Number sign, @#@+pattern NUMBER :: Word8+pattern NUMBER = 0x23++-- | Dollar sign, @$@+pattern DOLLAR :: Word8+pattern DOLLAR = 0x24++-- | Percent sign, @%@+pattern PERCENT :: Word8+pattern PERCENT = 0x25++-- | Ampersand, @&@+pattern AMPERSAND :: Word8+pattern AMPERSAND = 0x26++-- | Apostrophe, single quote, @'@+pattern SINGLE_QUOTE :: Word8+pattern SINGLE_QUOTE = 0x27++-- | Left parenthesis, @(@+pattern LEFT_PAREN :: Word8+pattern LEFT_PAREN = 0x28++-- | Right parenthesis, @)@+pattern RIGHT_PAREN :: Word8+pattern RIGHT_PAREN = 0x29++-- | Asterisk, @*@+pattern ASTERISK :: Word8+pattern ASTERISK = 0x2a++-- | Plus sign, @+@+pattern PLUS :: Word8+pattern PLUS = 0x2b++-- | Comma, @,@+pattern COMMA :: Word8+pattern COMMA = 0x2c++-- | Hyphen-minus, @-@+pattern HYPHEN :: Word8+pattern HYPHEN = 0x2d++-- | Full stop, period, @.@+pattern PERIOD :: Word8+pattern PERIOD = 0x2e++-- | Solidus, slash, @/@+pattern SLASH :: Word8+pattern SLASH = 0x2f++-------------------------------------------------------------------------------+-- * Digits, x30-x39+-------------------------------------------------------------------------------++-- | Digit 0, @0@+pattern DIGIT_0 :: Word8+pattern DIGIT_0 = 0x30++-- | Digit 1, @1@+pattern DIGIT_1 :: Word8+pattern DIGIT_1 = 0x31++-- | Digit 2, @2@+pattern DIGIT_2 :: Word8+pattern DIGIT_2 = 0x32++-- | Digit 3, @3@+pattern DIGIT_3 :: Word8+pattern DIGIT_3 = 0x33++-- | Digit 4, @4@+pattern DIGIT_4 :: Word8+pattern DIGIT_4 = 0x34++-- | Digit 5, @5@+pattern DIGIT_5 :: Word8+pattern DIGIT_5 = 0x35++-- | Digit 6, @6@+pattern DIGIT_6 :: Word8+pattern DIGIT_6 = 0x36++-- | Digit 7, @7@+pattern DIGIT_7 :: Word8+pattern DIGIT_7 = 0x37++-- | Digit 8, @8@+pattern DIGIT_8 :: Word8+pattern DIGIT_8 = 0x38++-- | Digit 9, @9@+pattern DIGIT_9 :: Word8+pattern DIGIT_9 = 0x39++-------------------------------------------------------------------------------+-- * Symbols 2, x3a-x40+-------------------------------------------------------------------------------++-- | Colon, @:@+pattern COLON :: Word8+pattern COLON = 0x3a++-- | Semicolon, @;@+pattern SEMICOLON :: Word8+pattern SEMICOLON = 0x3b++-- | Less-than sign, @<@+pattern LESS :: Word8+pattern LESS = 0x3c++-- | Equals sign, @=@+pattern EQUAL :: Word8+pattern EQUAL = 0x3d++-- | Greater-than sign, @>@+pattern GREATER :: Word8+pattern GREATER = 0x3e++-- | Question mark, @?@+pattern QUESTION :: Word8+pattern QUESTION = 0x3f++-- | Commercial At, @\@@+pattern AT :: Word8+pattern AT = 0x40++-------------------------------------------------------------------------------+-- * Upper case letters, x41-x5a+-------------------------------------------------------------------------------++-- | Latin small letter A, @A@+pattern UPPER_A :: Word8+pattern UPPER_A = 0x41++-- | Latin small letter B, @B@+pattern UPPER_B :: Word8+pattern UPPER_B = 0x42++-- | Latin small letter C, @C@+pattern UPPER_C :: Word8+pattern UPPER_C = 0x43++-- | Latin small letter D, @D@+pattern UPPER_D :: Word8+pattern UPPER_D = 0x44++-- | Latin small letter E, @E@+pattern UPPER_E :: Word8+pattern UPPER_E = 0x45++-- | Latin small letter F, @F@+pattern UPPER_F :: Word8+pattern UPPER_F = 0x46++-- | Latin small letter G, @G@+pattern UPPER_G :: Word8+pattern UPPER_G = 0x47++-- | Latin small letter H, @H@+pattern UPPER_H :: Word8+pattern UPPER_H = 0x48++-- | Latin small letter I, @I@+pattern UPPER_I :: Word8+pattern UPPER_I = 0x49++-- | Latin small letter J, @J@+pattern UPPER_J :: Word8+pattern UPPER_J = 0x4a++-- | Latin small letter K, @K@+pattern UPPER_K :: Word8+pattern UPPER_K = 0x4b++-- | Latin small letter L, @L@+pattern UPPER_L :: Word8+pattern UPPER_L = 0x4c++-- | Latin small letter M, @M@+pattern UPPER_M :: Word8+pattern UPPER_M = 0x4d++-- | Latin small letter N, @N@+pattern UPPER_N :: Word8+pattern UPPER_N = 0x4e++-- | Latin small letter O, @O@+pattern UPPER_O :: Word8+pattern UPPER_O = 0x4f++-- | Latin small letter P, @P@+pattern UPPER_P :: Word8+pattern UPPER_P = 0x50++-- | Latin small letter Q, @Q@+pattern UPPER_Q :: Word8+pattern UPPER_Q = 0x51++-- | Latin small letter R, @R@+pattern UPPER_R :: Word8+pattern UPPER_R = 0x52++-- | Latin small letter S, @S@+pattern UPPER_S :: Word8+pattern UPPER_S = 0x53++-- | Latin small letter T, @T@+pattern UPPER_T :: Word8+pattern UPPER_T = 0x54++-- | Latin small letter U, @U@+pattern UPPER_U :: Word8+pattern UPPER_U = 0x55++-- | Latin small letter V, @V@+pattern UPPER_V :: Word8+pattern UPPER_V = 0x56++-- | Latin small letter W, @W@+pattern UPPER_W :: Word8+pattern UPPER_W = 0x57++-- | Latin small letter X, @X@+pattern UPPER_X :: Word8+pattern UPPER_X = 0x58++-- | Latin small letter Y, @Y@+pattern UPPER_Y :: Word8+pattern UPPER_Y = 0x59++-- | Latin small letter Z, @Z@+pattern UPPER_Z :: Word8+pattern UPPER_Z = 0x5a++-------------------------------------------------------------------------------+-- * Symbols 3, x5b-x60+-------------------------------------------------------------------------------++-- | Left square bracket, @[@+pattern LEFT_SQUARE :: Word8+pattern LEFT_SQUARE = 0x5b++-- | Reverse solidus, backslash, @\\@+pattern BACKSLASH :: Word8+pattern BACKSLASH = 0x5c++-- | Right square bracket, @]@+pattern RIGHT_SQUARE :: Word8+pattern RIGHT_SQUARE = 0x5d++-- | Circumflex accent, @^@+pattern CIRCUM :: Word8+pattern CIRCUM = 0x5e++-- | Low line, underscore, @_@+pattern UNDERSCORE :: Word8+pattern UNDERSCORE = 0x5f++-- | Grave accent, @`@+pattern GRAVE :: Word8+pattern GRAVE = 0x60++-------------------------------------------------------------------------------+-- * Lower case letters, x61-x7a+-------------------------------------------------------------------------------++-- | Latin small letter A, @a@+pattern LOWER_A :: Word8+pattern LOWER_A = 0x61++-- | Latin small letter B, @b@+pattern LOWER_B :: Word8+pattern LOWER_B = 0x62++-- | Latin small letter C, @c@+pattern LOWER_C :: Word8+pattern LOWER_C = 0x63++-- | Latin small letter D, @d@+pattern LOWER_D :: Word8+pattern LOWER_D = 0x64++-- | Latin small letter E, @e@+pattern LOWER_E :: Word8+pattern LOWER_E = 0x65++-- | Latin small letter F, @f@+pattern LOWER_F :: Word8+pattern LOWER_F = 0x66++-- | Latin small letter G, @g@+pattern LOWER_G :: Word8+pattern LOWER_G = 0x67++-- | Latin small letter H, @h@+pattern LOWER_H :: Word8+pattern LOWER_H = 0x68++-- | Latin small letter I, @i@+pattern LOWER_I :: Word8+pattern LOWER_I = 0x69++-- | Latin small letter J, @j@+pattern LOWER_J :: Word8+pattern LOWER_J = 0x6a++-- | Latin small letter K, @k@+pattern LOWER_K :: Word8+pattern LOWER_K = 0x6b++-- | Latin small letter L, @l@+pattern LOWER_L :: Word8+pattern LOWER_L = 0x6c++-- | Latin small letter M, @m@+pattern LOWER_M :: Word8+pattern LOWER_M = 0x6d++-- | Latin small letter N, @n@+pattern LOWER_N :: Word8+pattern LOWER_N = 0x6e++-- | Latin small letter O, @o@+pattern LOWER_O :: Word8+pattern LOWER_O = 0x6f++-- | Latin small letter P, @p@+pattern LOWER_P :: Word8+pattern LOWER_P = 0x70++-- | Latin small letter Q, @q@+pattern LOWER_Q :: Word8+pattern LOWER_Q = 0x71++-- | Latin small letter R, @r@+pattern LOWER_R :: Word8+pattern LOWER_R = 0x72++-- | Latin small letter S, @s@+pattern LOWER_S :: Word8+pattern LOWER_S = 0x73++-- | Latin small letter T, @t@+pattern LOWER_T :: Word8+pattern LOWER_T = 0x74++-- | Latin small letter U, @u@+pattern LOWER_U :: Word8+pattern LOWER_U = 0x75++-- | Latin small letter V, @v@+pattern LOWER_V :: Word8+pattern LOWER_V = 0x76++-- | Latin small letter W, @w@+pattern LOWER_W :: Word8+pattern LOWER_W = 0x77++-- | Latin small letter X, @x@+pattern LOWER_X :: Word8+pattern LOWER_X = 0x78++-- | Latin small letter Y, @y@+pattern LOWER_Y :: Word8+pattern LOWER_Y = 0x79++-- | Latin small letter Z, @z@+pattern LOWER_Z :: Word8+pattern LOWER_Z = 0x7a++-------------------------------------------------------------------------------+-- * Symbols 5, x7b-x7f+-------------------------------------------------------------------------------++-- | Left curly bracket, @{@+pattern LEFT_CURLY :: Word8+pattern LEFT_CURLY = 0x7b++-- | Vertical line, vecrtical bar, @|@+pattern BAR :: Word8+pattern BAR = 0x7c++-- | Right curly bracket, @}@+pattern RIGHT_CURLY :: Word8+pattern RIGHT_CURLY = 0x7d++-- | Tilde, @~@+pattern TILDE :: Word8+pattern TILDE = 0x7e++-- | Delete (DEL)+pattern DEL :: Word8+pattern DEL = 0x7f
+ tests/character-ps-tests.hs view
@@ -0,0 +1,414 @@+module Main (main) where++import Control.Monad (unless)+import Data.Word (Word8, Word16)+import qualified Data.Char.Patterns as C+import qualified Data.Word8.Patterns as W8+import qualified Data.Word16.Patterns as W16++main :: IO ()+main = do+ print word8s+ unless (word8s == [0..127]) $ fail "something wrong"++ print word16s+ unless (word16s == [0..127]) $ fail "something wrong"++ print chars+ unless (chars == ['\NUL'..'\DEL']) $ fail "something wrong"++word8s :: [Word8]+word8s =+ [ W8.NUL+ , W8.SOH+ , W8.STX+ , W8.ETX+ , W8.EOT+ , W8.ENQ+ , W8.ACK+ , W8.BEL+ , W8.BS+ , W8.TAB+ , W8.LF+ , W8.VT+ , W8.FF+ , W8.CR+ , W8.SO+ , W8.SI+ , W8.DLE+ , W8.DC1+ , W8.DC2+ , W8.DC3+ , W8.DC4+ , W8.NAK+ , W8.SYN+ , W8.ETB+ , W8.CAN+ , W8.EOM+ , W8.SUB+ , W8.ESC+ , W8.FS+ , W8.GS+ , W8.RS+ , W8.US+ , W8.SPACE+ , W8.EXCLAM+ , W8.DOUBLE_QUOTE+ , W8.NUMBER+ , W8.DOLLAR+ , W8.PERCENT+ , W8.AMPERSAND+ , W8.SINGLE_QUOTE+ , W8.LEFT_PAREN+ , W8.RIGHT_PAREN+ , W8.ASTERISK+ , W8.PLUS+ , W8.COMMA+ , W8.HYPHEN+ , W8.PERIOD+ , W8.SLASH+ , W8.DIGIT_0+ , W8.DIGIT_1+ , W8.DIGIT_2+ , W8.DIGIT_3+ , W8.DIGIT_4+ , W8.DIGIT_5+ , W8.DIGIT_6+ , W8.DIGIT_7+ , W8.DIGIT_8+ , W8.DIGIT_9+ , W8.COLON+ , W8.SEMICOLON+ , W8.LESS+ , W8.EQUAL+ , W8.GREATER+ , W8.QUESTION+ , W8.AT+ , W8.UPPER_A+ , W8.UPPER_B+ , W8.UPPER_C+ , W8.UPPER_D+ , W8.UPPER_E+ , W8.UPPER_F+ , W8.UPPER_G+ , W8.UPPER_H+ , W8.UPPER_I+ , W8.UPPER_J+ , W8.UPPER_K+ , W8.UPPER_L+ , W8.UPPER_M+ , W8.UPPER_N+ , W8.UPPER_O+ , W8.UPPER_P+ , W8.UPPER_Q+ , W8.UPPER_R+ , W8.UPPER_S+ , W8.UPPER_T+ , W8.UPPER_U+ , W8.UPPER_V+ , W8.UPPER_W+ , W8.UPPER_X+ , W8.UPPER_Y+ , W8.UPPER_Z+ , W8.LEFT_SQUARE+ , W8.BACKSLASH+ , W8.RIGHT_SQUARE+ , W8.CIRCUM+ , W8.UNDERSCORE+ , W8.GRAVE+ , W8.LOWER_A+ , W8.LOWER_B+ , W8.LOWER_C+ , W8.LOWER_D+ , W8.LOWER_E+ , W8.LOWER_F+ , W8.LOWER_G+ , W8.LOWER_H+ , W8.LOWER_I+ , W8.LOWER_J+ , W8.LOWER_K+ , W8.LOWER_L+ , W8.LOWER_M+ , W8.LOWER_N+ , W8.LOWER_O+ , W8.LOWER_P+ , W8.LOWER_Q+ , W8.LOWER_R+ , W8.LOWER_S+ , W8.LOWER_T+ , W8.LOWER_U+ , W8.LOWER_V+ , W8.LOWER_W+ , W8.LOWER_X+ , W8.LOWER_Y+ , W8.LOWER_Z+ , W8.LEFT_CURLY+ , W8.BAR+ , W8.RIGHT_CURLY+ , W8.TILDE+ , W8.DEL+ ]++word16s :: [Word16]+word16s =+ [ W16.NUL+ , W16.SOH+ , W16.STX+ , W16.ETX+ , W16.EOT+ , W16.ENQ+ , W16.ACK+ , W16.BEL+ , W16.BS+ , W16.TAB+ , W16.LF+ , W16.VT+ , W16.FF+ , W16.CR+ , W16.SO+ , W16.SI+ , W16.DLE+ , W16.DC1+ , W16.DC2+ , W16.DC3+ , W16.DC4+ , W16.NAK+ , W16.SYN+ , W16.ETB+ , W16.CAN+ , W16.EOM+ , W16.SUB+ , W16.ESC+ , W16.FS+ , W16.GS+ , W16.RS+ , W16.US+ , W16.SPACE+ , W16.EXCLAM+ , W16.DOUBLE_QUOTE+ , W16.NUMBER+ , W16.DOLLAR+ , W16.PERCENT+ , W16.AMPERSAND+ , W16.SINGLE_QUOTE+ , W16.LEFT_PAREN+ , W16.RIGHT_PAREN+ , W16.ASTERISK+ , W16.PLUS+ , W16.COMMA+ , W16.HYPHEN+ , W16.PERIOD+ , W16.SLASH+ , W16.DIGIT_0+ , W16.DIGIT_1+ , W16.DIGIT_2+ , W16.DIGIT_3+ , W16.DIGIT_4+ , W16.DIGIT_5+ , W16.DIGIT_6+ , W16.DIGIT_7+ , W16.DIGIT_8+ , W16.DIGIT_9+ , W16.COLON+ , W16.SEMICOLON+ , W16.LESS+ , W16.EQUAL+ , W16.GREATER+ , W16.QUESTION+ , W16.AT+ , W16.UPPER_A+ , W16.UPPER_B+ , W16.UPPER_C+ , W16.UPPER_D+ , W16.UPPER_E+ , W16.UPPER_F+ , W16.UPPER_G+ , W16.UPPER_H+ , W16.UPPER_I+ , W16.UPPER_J+ , W16.UPPER_K+ , W16.UPPER_L+ , W16.UPPER_M+ , W16.UPPER_N+ , W16.UPPER_O+ , W16.UPPER_P+ , W16.UPPER_Q+ , W16.UPPER_R+ , W16.UPPER_S+ , W16.UPPER_T+ , W16.UPPER_U+ , W16.UPPER_V+ , W16.UPPER_W+ , W16.UPPER_X+ , W16.UPPER_Y+ , W16.UPPER_Z+ , W16.LEFT_SQUARE+ , W16.BACKSLASH+ , W16.RIGHT_SQUARE+ , W16.CIRCUM+ , W16.UNDERSCORE+ , W16.GRAVE+ , W16.LOWER_A+ , W16.LOWER_B+ , W16.LOWER_C+ , W16.LOWER_D+ , W16.LOWER_E+ , W16.LOWER_F+ , W16.LOWER_G+ , W16.LOWER_H+ , W16.LOWER_I+ , W16.LOWER_J+ , W16.LOWER_K+ , W16.LOWER_L+ , W16.LOWER_M+ , W16.LOWER_N+ , W16.LOWER_O+ , W16.LOWER_P+ , W16.LOWER_Q+ , W16.LOWER_R+ , W16.LOWER_S+ , W16.LOWER_T+ , W16.LOWER_U+ , W16.LOWER_V+ , W16.LOWER_W+ , W16.LOWER_X+ , W16.LOWER_Y+ , W16.LOWER_Z+ , W16.LEFT_CURLY+ , W16.BAR+ , W16.RIGHT_CURLY+ , W16.TILDE+ , W16.DEL+ ]++chars :: [Char]+chars =+ [ C.NUL+ , C.SOH+ , C.STX+ , C.ETX+ , C.EOT+ , C.ENQ+ , C.ACK+ , C.BEL+ , C.BS+ , C.TAB+ , C.LF+ , C.VT+ , C.FF+ , C.CR+ , C.SO+ , C.SI+ , C.DLE+ , C.DC1+ , C.DC2+ , C.DC3+ , C.DC4+ , C.NAK+ , C.SYN+ , C.ETB+ , C.CAN+ , C.EOM+ , C.SUB+ , C.ESC+ , C.FS+ , C.GS+ , C.RS+ , C.US+ , C.SPACE+ , C.EXCLAM+ , C.DOUBLE_QUOTE+ , C.NUMBER+ , C.DOLLAR+ , C.PERCENT+ , C.AMPERSAND+ , C.SINGLE_QUOTE+ , C.LEFT_PAREN+ , C.RIGHT_PAREN+ , C.ASTERISK+ , C.PLUS+ , C.COMMA+ , C.HYPHEN+ , C.PERIOD+ , C.SLASH+ , C.DIGIT_0+ , C.DIGIT_1+ , C.DIGIT_2+ , C.DIGIT_3+ , C.DIGIT_4+ , C.DIGIT_5+ , C.DIGIT_6+ , C.DIGIT_7+ , C.DIGIT_8+ , C.DIGIT_9+ , C.COLON+ , C.SEMICOLON+ , C.LESS+ , C.EQUAL+ , C.GREATER+ , C.QUESTION+ , C.AT+ , C.UPPER_A+ , C.UPPER_B+ , C.UPPER_C+ , C.UPPER_D+ , C.UPPER_E+ , C.UPPER_F+ , C.UPPER_G+ , C.UPPER_H+ , C.UPPER_I+ , C.UPPER_J+ , C.UPPER_K+ , C.UPPER_L+ , C.UPPER_M+ , C.UPPER_N+ , C.UPPER_O+ , C.UPPER_P+ , C.UPPER_Q+ , C.UPPER_R+ , C.UPPER_S+ , C.UPPER_T+ , C.UPPER_U+ , C.UPPER_V+ , C.UPPER_W+ , C.UPPER_X+ , C.UPPER_Y+ , C.UPPER_Z+ , C.LEFT_SQUARE+ , C.BACKSLASH+ , C.RIGHT_SQUARE+ , C.CIRCUM+ , C.UNDERSCORE+ , C.GRAVE+ , C.LOWER_A+ , C.LOWER_B+ , C.LOWER_C+ , C.LOWER_D+ , C.LOWER_E+ , C.LOWER_F+ , C.LOWER_G+ , C.LOWER_H+ , C.LOWER_I+ , C.LOWER_J+ , C.LOWER_K+ , C.LOWER_L+ , C.LOWER_M+ , C.LOWER_N+ , C.LOWER_O+ , C.LOWER_P+ , C.LOWER_Q+ , C.LOWER_R+ , C.LOWER_S+ , C.LOWER_T+ , C.LOWER_U+ , C.LOWER_V+ , C.LOWER_W+ , C.LOWER_X+ , C.LOWER_Y+ , C.LOWER_Z+ , C.LEFT_CURLY+ , C.BAR+ , C.RIGHT_CURLY+ , C.TILDE+ , C.DEL+ ]