utility functions

This commit is contained in:
Stephen Diehl
2016-12-10 16:01:47 +00:00
parent 00c2fce11a
commit 6cb17bb94b
8 changed files with 159 additions and 2 deletions
+13
View File
@@ -41,6 +41,11 @@ orEmpty :: Alternative f => Bool -> a -> f a
eitherA :: (Alternative f) => f a -> f b -> f (Either a b)
```
```haskell
pass :: Applicative f => f ()
```
Alternative
-------
@@ -75,3 +80,11 @@ liftA :: Applicative f => (a -> b) -> f a -> f b
```haskell
empty :: Alternative f => f a
```
```haskell
guarded :: (Alternative f) => (a -> Bool) -> a -> f a
```
```haskell
guardedA :: (Functor f, Alternative t) => (a -> f Bool) -> a -> f (t a)
```