functor module
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
Functor
|
||||||
|
=======
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
foreach :: Functor f => f a -> (a -> b) -> f b
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
map :: Functor f => (a -> b) -> f a -> f b
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
($>) :: Functor f => f a -> b -> f b
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
(<$>) :: Functor f => (a -> b) -> f a -> f b
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
(<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
void :: Functor f => f a -> f ()
|
||||||
|
```
|
||||||
@@ -109,7 +109,3 @@ filter :: (a -> Bool) -> [a] -> [a]
|
|||||||
```haskell
|
```haskell
|
||||||
replicate :: Int -> a -> [a]
|
replicate :: Int -> a -> [a]
|
||||||
```
|
```
|
||||||
|
|
||||||
```haskell
|
|
||||||
map :: Functor f => (a -> b) -> f a -> f b
|
|
||||||
```
|
|
||||||
|
|||||||
+12
-2
@@ -29,22 +29,32 @@ Encoding
|
|||||||
encodeUtf8 :: Text -> ByteString
|
encodeUtf8 :: Text -> ByteString
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
> encodeUtf8 "ポケット"
|
||||||
|
"\227\131\157\227\130\177\227\131\131\227\131\136"
|
||||||
|
```
|
||||||
|
|
||||||
#### decodeUtf8
|
#### decodeUtf8
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
decodeUtf8 :: ByteString -> Text
|
decodeUtf8 :: ByteString -> Text
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
> putStrLn $ decodeUtf8 "\227\131\157\227\130\177\227\131\131\227\131\136"
|
||||||
|
ポケット
|
||||||
|
```
|
||||||
|
|
||||||
#### decodeUtf8'
|
#### decodeUtf8'
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
decodeUtf8' :: ByteString -> Text
|
decodeUtf8' :: ByteString -> Either UnicodeException Text
|
||||||
```
|
```
|
||||||
|
|
||||||
#### decodeUtf8With
|
#### decodeUtf8With
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
decodeUtf8With :: Data.Text.Encoding.Error.OnDecodeError -> ByteString -> Text
|
decodeUtf8With :: OnDecodeError -> ByteString -> Text
|
||||||
```
|
```
|
||||||
|
|
||||||
Conversion
|
Conversion
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ An alternative Prelude.
|
|||||||
Files
|
Files
|
||||||
Debug
|
Debug
|
||||||
Bits
|
Bits
|
||||||
|
Functor
|
||||||
Applicative
|
Applicative
|
||||||
Monad
|
Monad
|
||||||
Maybe
|
Maybe
|
||||||
|
|||||||
@@ -352,6 +352,7 @@ import Data.Text.Encoding as X (
|
|||||||
import Data.Text.Encoding.Error as X (
|
import Data.Text.Encoding.Error as X (
|
||||||
OnDecodeError
|
OnDecodeError
|
||||||
, OnError
|
, OnError
|
||||||
|
, UnicodeException
|
||||||
, lenientDecode
|
, lenientDecode
|
||||||
, strictDecode
|
, strictDecode
|
||||||
, ignore
|
, ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user