on master help sign in
Prelude.Chars: add isControl function
72937bbMichael Morgan
libs/prelude/Prelude/Chars.idr+5
@@ -81,3 +81,8 @@ isHexDigit x = elem (toUpper x) hexChars where
81||| Returns true if the character is an octal digit.
81||| Returns true if the character is an octal digit.
82isOctDigit : Char -> Bool
82isOctDigit : Char -> Bool
83isOctDigit x = (x >= '0' && x <= '7')
83isOctDigit x = (x >= '0' && x <= '7')
84+
85+||| Returns true if the character is a control character.
86+isControl : Char -> Bool
87+isControl x = (x >= '\x0000' && x <= '\x001f')
88+ || (x >= '\x007f' && x <= '\x009f')