debug module
This commit is contained in:
@@ -2,7 +2,7 @@ Applicative
|
|||||||
===========
|
===========
|
||||||
|
|
||||||
Functor
|
Functor
|
||||||
~~~~~~~
|
-------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Functor (f :: * -> *) where
|
class Functor (f :: * -> *) where
|
||||||
@@ -19,7 +19,7 @@ class Functor (f :: * -> *) where
|
|||||||
```
|
```
|
||||||
|
|
||||||
Applicatives
|
Applicatives
|
||||||
~~~~~~~~~~~~
|
-------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Functor f => Applicative (f :: * -> *) where
|
class Functor f => Applicative (f :: * -> *) where
|
||||||
@@ -46,7 +46,7 @@ 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,38 @@
|
|||||||
|
Debug
|
||||||
|
=====
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
undefined :: a
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
notImplemented :: a
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
trace :: Print b => b -> a -> a
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceM :: (Monad m) => Text -> m ()
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceId :: Text -> Text
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceShowM :: (P.Show a, Monad m) => a -> m ()
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceShowId :: P.Show a => a -> a
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceShow :: P.Show a => a -> b -> b
|
||||||
|
```
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
traceIO :: Print b => b -> a -> IO a
|
||||||
|
```
|
||||||
@@ -2,7 +2,7 @@ List
|
|||||||
====
|
====
|
||||||
|
|
||||||
Slicing
|
Slicing
|
||||||
~~~~~~~
|
-------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
head :: Foldable f => f a -> Maybe a
|
head :: Foldable f => f a -> Maybe a
|
||||||
@@ -49,7 +49,7 @@ take :: Int -> [a] -> [a]
|
|||||||
```
|
```
|
||||||
|
|
||||||
Unpacking
|
Unpacking
|
||||||
~~~~~~~~~
|
---------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
uncons :: [a] -> Maybe (a, [a])
|
uncons :: [a] -> Maybe (a, [a])
|
||||||
@@ -60,21 +60,21 @@ 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])
|
||||||
@@ -89,14 +89,14 @@ intercalate :: [a] -> [[a]] -> [a]
|
|||||||
```
|
```
|
||||||
|
|
||||||
Comparison
|
Comparison
|
||||||
~~~~~~~~~
|
---------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
isPrefixOf :: Eq a => [a] -> [a] -> Bool
|
isPrefixOf :: Eq a => [a] -> [a] -> Bool
|
||||||
```
|
```
|
||||||
|
|
||||||
Filtering
|
Filtering
|
||||||
~~~~~~~~~
|
---------
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
filter :: (a -> Bool) -> [a] -> [a]
|
filter :: (a -> Bool) -> [a] -> [a]
|
||||||
@@ -2,7 +2,7 @@ Monads
|
|||||||
======
|
======
|
||||||
|
|
||||||
Monad
|
Monad
|
||||||
~~~~~
|
-----
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
class Applicative m => Monad (m :: * -> *) where
|
class Applicative m => Monad (m :: * -> *) where
|
||||||
@@ -121,7 +121,7 @@ ap :: Monad m => 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
|
||||||
@@ -30,6 +30,16 @@ vacuous :: Functor f => f Void -> f a
|
|||||||
data Proxy (t :: k) = Proxy
|
data Proxy (t :: k) = Proxy
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Symbol
|
||||||
|
|
||||||
|
* symbolVal
|
||||||
|
* someSymbolVal
|
||||||
|
|
||||||
|
#### Nat
|
||||||
|
|
||||||
|
* natVal
|
||||||
|
* someNatVal
|
||||||
|
|
||||||
#### Type Equality
|
#### Type Equality
|
||||||
|
|
||||||
```haskell
|
```haskell
|
||||||
@@ -6,6 +6,7 @@ An alternative Prelude.
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 0
|
:maxdepth: 0
|
||||||
Printing
|
Printing
|
||||||
|
Debug
|
||||||
Files
|
Files
|
||||||
Strings
|
Strings
|
||||||
Function
|
Function
|
||||||
|
|||||||
Reference in New Issue
Block a user