mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-27 13:40:15 +03:00
18 lines
414 B
Idris
18 lines
414 B
Idris
|
module Main
|
||
|
|
||
|
import Data.String.Parser
|
||
|
import Control.Monad.Identity
|
||
|
|
||
|
-- Buld this program with '-p contrib'
|
||
|
|
||
|
partial
|
||
|
main : IO ()
|
||
|
main = do
|
||
|
res <- parseT (string "hi") "hideous"
|
||
|
case res of
|
||
|
Left err => putStrLn "NOOOOOOO!"
|
||
|
Right () => putStrLn "YEEEES!"
|
||
|
digs <- parseT (satisfy isDigit) "8878993"
|
||
|
case digs of
|
||
|
Left err => putStrLn "NOOOOOOO!"
|
||
|
Right ds => printLn ds
|