Last active
December 30, 2016 15:20
-
-
Save sungkmi/3703ea08bf1b2c44ea0a29b663d56d38 to your computer and use it in GitHub Desktop.
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
import Data.Vect | |
readToBlank : IO (List String) | |
readToBlank = do x <- getLine | |
if (x == "") | |
then pure [] | |
else do xs <- readToBlank | |
pure (x :: xs) | |
readAndSave : IO () | |
readAndSave = do xs <- readToBlank | |
filename <- getLine | |
Right h <- writeFile filename (unlines xs) | |
| Left err => putStrLn (show err) | |
pure () | |
readVectFile : (filename : String) -> IO (n ** Vect n String) | |
readVectFile filename = do | |
Right h <- openFile filename Read | |
?readVectFile_rhs | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment