console functions
This commit is contained in:
+60
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user