document structure
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
Applicative
|
Applicative
|
||||||
===========
|
===========
|
||||||
|
|
||||||
#### Functor
|
Functor
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Functor (f :: * -> *) where
|
class Functor (f :: * -> *) where
|
||||||
@@ -17,7 +18,8 @@ class Functor (f :: * -> *) where
|
|||||||
($>) :: Functor f => f a -> b -> f b
|
($>) :: Functor f => f a -> b -> f b
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Applicatives
|
Applicatives
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Functor f => Applicative (f :: * -> *) where
|
class Functor f => Applicative (f :: * -> *) where
|
||||||
@@ -43,7 +45,8 @@ orEmpty :: Alternative f => Bool -> a -> f a
|
|||||||
eitherA :: (Alternative f) => f a -> f b -> f (Either a b)
|
eitherA :: (Alternative f) => f a -> f b -> f (Either a b)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Alternative
|
Alternative
|
||||||
|
~~~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Applicative f => Alternative (f :: * -> *) where
|
class Applicative f => Alternative (f :: * -> *) where
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Bool
|
||||||
|
=====
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Either
|
||||||
|
======
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Folds
|
||||||
|
=====
|
||||||
+14
-7
@@ -1,7 +1,8 @@
|
|||||||
List
|
List
|
||||||
====
|
====
|
||||||
|
|
||||||
#### Slicing
|
Slicing
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
head :: Foldable f => f a -> Maybe a
|
head :: Foldable f => f a -> Maybe a
|
||||||
@@ -47,7 +48,8 @@ drop :: Int -> [a] -> [a]
|
|||||||
take :: Int -> [a] -> [a]
|
take :: Int -> [a] -> [a]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Unpacking
|
Unpacking
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
uncons :: [a] -> Maybe (a, [a])
|
uncons :: [a] -> Maybe (a, [a])
|
||||||
@@ -57,19 +59,22 @@ uncons :: [a] -> Maybe (a, [a])
|
|||||||
unsnoc :: [x] -> Maybe ([x],x)
|
unsnoc :: [x] -> Maybe ([x],x)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Sorting
|
Sorting
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
sortOn :: Ord o => (a -> o) -> [a] -> [a]
|
sortOn :: Ord o => (a -> o) -> [a] -> [a]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Removing
|
Removing
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
ordNub :: Ord a => [a] -> [a]
|
ordNub :: Ord a => [a] -> [a]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Splitting
|
Splitting
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
splitAt :: Int -> [a] -> ([a], [a])
|
splitAt :: Int -> [a] -> ([a], [a])
|
||||||
@@ -83,13 +88,15 @@ splitAt :: Int -> [a] -> ([a], [a])
|
|||||||
intercalate :: [a] -> [[a]] -> [a]
|
intercalate :: [a] -> [[a]] -> [a]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Comparison
|
Comparison
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
isPrefixOf :: Eq a => [a] -> [a] -> Bool
|
isPrefixOf :: Eq a => [a] -> [a] -> Bool
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Filter
|
Filtering
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
filter :: (a -> Bool) -> [a] -> [a]
|
filter :: (a -> Bool) -> [a] -> [a]
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Maybe
|
||||||
|
=====
|
||||||
+4
-2
@@ -1,7 +1,8 @@
|
|||||||
Monads
|
Monads
|
||||||
======
|
======
|
||||||
|
|
||||||
#### Monad
|
Monad
|
||||||
|
~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Applicative m => Monad (m :: * -> *) where
|
class Applicative m => Monad (m :: * -> *) where
|
||||||
@@ -119,7 +120,8 @@ ap :: Monad m => m (a -> b) -> m a -> m b
|
|||||||
(<$!>) :: Monad m => (a -> b) -> m a -> m b
|
(<$!>) :: Monad m => (a -> b) -> m a -> m b
|
||||||
```
|
```
|
||||||
|
|
||||||
#### MonadPlus
|
MonadPlus
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
|
class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Monoid
|
||||||
|
======
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Numbers
|
||||||
|
=======
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Strings
|
||||||
|
=======
|
||||||
|
|
||||||
|
Text
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
LText
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
Bytestring
|
||||||
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
LBytestring
|
||||||
|
~~~~~~~~~~~
|
||||||
+2
-2
@@ -4,7 +4,7 @@ Protolude Documentation
|
|||||||
An alternative Prelude.
|
An alternative Prelude.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 0
|
||||||
Printing
|
Printing
|
||||||
Files
|
Files
|
||||||
Strings
|
Strings
|
||||||
@@ -28,7 +28,7 @@ An alternative Prelude.
|
|||||||
ST
|
ST
|
||||||
Concurrency
|
Concurrency
|
||||||
Storable
|
Storable
|
||||||
Systsem
|
System
|
||||||
Map
|
Map
|
||||||
Set
|
Set
|
||||||
Tuple
|
Tuple
|
||||||
|
|||||||
Reference in New Issue
Block a user