-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
module Main where | ||
|
||
import YAML ( parseYamlList ) | ||
import YAML ( parseYamlList, parseYaml, makeTree, makeTokens ) | ||
|
||
main :: IO () | ||
main = do let partialstring = unlines ["- foo","- bar",undefined] | ||
main = do let partialstring = unlines ["- foo","- bar" --, undefined | ||
] | ||
putStrLn "The partialstring has two defined elements:" | ||
print $ take 2 $ lines partialstring | ||
putStrLn "makeTokens should find those two elements:" | ||
mapM_ print $ makeTokens partialstring | ||
putStrLn "makeTree should find those two elements:" | ||
mapM_ print $ makeTree partialstring | ||
putStrLn "parseYamlList should find those two elements:" | ||
print $ take 2 $ parseYamlList partialstring | ||
mapM_ print $ parseYaml partialstring | ||
print $ take 1 $ parseYamlList partialstring | ||
putStrLn "You may now play with parseYamlList interactively:" | ||
x <- parseYamlList `fmap` getContents | ||
mapM_ print x |