functor module

This commit is contained in:
Stephen Diehl
2016-12-12 13:09:18 +00:00
parent 66958def93
commit 257a38f68f
5 changed files with 40 additions and 6 deletions
+12 -2
View File
@@ -29,22 +29,32 @@ Encoding
encodeUtf8 :: Text -> ByteString
```
```haskell
> encodeUtf8 "ポケット"
"\227\131\157\227\130\177\227\131\131\227\131\136"
```
#### decodeUtf8
```haskell
decodeUtf8 :: ByteString -> Text
```
```haskell
> putStrLn $ decodeUtf8 "\227\131\157\227\130\177\227\131\131\227\131\136"
```
#### decodeUtf8'
```haskell
decodeUtf8' :: ByteString -> Text
decodeUtf8' :: ByteString -> Either UnicodeException Text
```
#### decodeUtf8With
```haskell
decodeUtf8With :: Data.Text.Encoding.Error.OnDecodeError -> ByteString -> Text
decodeUtf8With :: OnDecodeError -> ByteString -> Text
```
Conversion