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
|
||||
replicate :: Int -> a -> [a]
|
||||
```
|
||||
|
||||
```haskell
|
||||
map :: Functor f => (a -> b) -> f a -> f b
|
||||
```
|
||||
|
||||
+12
-2
@@ -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
|
||||
|
||||
@@ -13,6 +13,7 @@ An alternative Prelude.
|
||||
Files
|
||||
Debug
|
||||
Bits
|
||||
Functor
|
||||
Applicative
|
||||
Monad
|
||||
Maybe
|
||||
|
||||
@@ -352,6 +352,7 @@ import Data.Text.Encoding as X (
|
||||
import Data.Text.Encoding.Error as X (
|
||||
OnDecodeError
|
||||
, OnError
|
||||
, UnicodeException
|
||||
, lenientDecode
|
||||
, strictDecode
|
||||
, ignore
|
||||
|
||||
Reference in New Issue
Block a user