console functions

This commit is contained in:
Stephen Diehl
2016-12-10 14:51:33 +00:00
parent 8995aa71f3
commit 00c2fce11a
6 changed files with 255 additions and 14 deletions
+60 -14
View File
@@ -4,25 +4,71 @@ Files
Basic IO
--------
* readFile
* writeFile
* appendFile
* openFile
* withFile
#### readFile
```haskell
readFile :: FilePath -> IO Text
```
#### writeFile
```haskell
writeFile :: FilePath -> Text -> IO ()
```
#### appendFile
```haskell
appendFile :: FilePath -> Text -> IO ()
```
Console
-------
* getLine
* getContents
* interact
#### getLine
```haskell
getLine :: IO Text
```
#### getContents
```haskell
getContents :: IO Text
```
#### interact
```haskell
interact :: (Text -> Text) -> IO ()
```
File Handles
------------
* stdin
* stdout
* stderr
* Handle
* FilePath
* IOMode(..)
```haskell
data IOMode
= ReadMode
| WriteMode
| AppendMode
| ReadWriteMode
```
#### openFile
```haskell
openFile :: FilePath -> IOMode -> IO Handle
```
#### withFile
```haskell
withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
```
#### stdin
#### stdout
#### stderr
#### Handle
#### FilePath