mirror of
https://github.com/ilyakooo0/syntax.git
synced 2024-09-11 16:26:27 +03:00
Add hexadecimal and realFloat.
This commit is contained in:
parent
152e961db9
commit
a0aeedbf65
@ -27,6 +27,7 @@ module Data.Syntax.Char (
|
||||
) where
|
||||
|
||||
import Control.Lens.SemiIso
|
||||
import Data.Bits
|
||||
import Data.Char
|
||||
import Data.MonoTraversable
|
||||
import Data.Scientific (Scientific)
|
||||
@ -43,10 +44,16 @@ class (Syntax syn seq, Element seq ~ Char) => SyntaxChar syn seq where
|
||||
-- | An unsigned decimal number.
|
||||
decimal :: Integral a => syn a
|
||||
|
||||
-- | An unsigned hexadecimal number.
|
||||
hexadecimal :: (Integral a, Bits a) => syn a
|
||||
|
||||
-- | A signed real number.
|
||||
realFloat :: RealFloat a => syn a
|
||||
|
||||
-- | A scientific number.
|
||||
scientific :: syn Scientific
|
||||
|
||||
{-# MINIMAL decimal, scientific #-}
|
||||
{-# MINIMAL decimal, hexadecimal, realFloat, scientific #-}
|
||||
|
||||
-- | An useful synonym for SyntaxChars with Text sequences.
|
||||
type SyntaxText syn = SyntaxChar syn Text
|
||||
|
Loading…
Reference in New Issue
Block a user