11 lines
256 B
Haskell
11 lines
256 B
Haskell
|
|
isInteger s = case reads s :: [(Integer, String)] of
|
||
|
|
[(_, "")] -> True
|
||
|
|
_ -> False
|
||
|
|
|
||
|
|
isDouble s = case reads s :: [(Double, String)] of
|
||
|
|
[(_, "")] -> True
|
||
|
|
_ -> False
|
||
|
|
|
||
|
|
isNumeric :: String -> Bool
|
||
|
|
isNumeric s = isInteger s || isDouble s
|