diff --git a/docs/Exceptions.md b/docs/Exceptions.md index 99a3d1585..6a33cef03 100644 --- a/docs/Exceptions.md +++ b/docs/Exceptions.md @@ -60,3 +60,13 @@ throwSTM :: Exception e => e -> STM a ```haskell throwError :: MonadError e m => e -> m a ``` + +#### Panic + +```haskell +data FatalError = FatalError {msg :: Text} +``` + +```haskell +panic :: Text -> a +``` diff --git a/docs/Index.md b/docs/Index.md index a441e740f..4ac04b050 100644 --- a/docs/Index.md +++ b/docs/Index.md @@ -1,11 +1,31 @@ Welcome to project documentation. +- [Printing](Printing.md) +- [File Handling](Files.md) +- [Strings](Strings.md) - [Functions](Function.md) - [Functors](Applicative.md) - [Monad](Monad.md) - [Maybe](Maybe.md) +- [Either](Either.md) +- [Booleans](Bool.md) +- [Numbers](Numbers.md) +- [Monoid](Monoid.md) +- [Semigroup](Semigroup.md) +- [Bifunctor](Bifunctor.md) - [Lists](List.md) - [Folds](Folds.md) +- [Traversals](Traversals.md) +- [Transformers](Transformers.md) +- [Reader](Reader.md) +- [State](State.md) +- [Exception Handling](Exceptions.md) +- [ST](ST.md) +- [Async & Concurrency](Concurrency.md) +- [Storable & Bytes](Storable.md) +- [System](Systsem.md) - [Dictionaries](Map.md) - [Sets](Set.md) -- [Exception Handling](Exceptions.md) +- [Tuples](Tuples.md) +- [Generics](Generics.md) +- [Type Level Programming](TypeLevel.md) diff --git a/docs/List.md b/docs/List.md index 3c4057d0a..3135a4926 100644 --- a/docs/List.md +++ b/docs/List.md @@ -98,3 +98,7 @@ filter :: (a -> Bool) -> [a] -> [a] ```haskell replicate :: Int -> a -> [a] ``` + +```haskell +map :: Functor f => (a -> b) -> f a -> f b +``` diff --git a/docs/Tuple.md b/docs/Tuple.md new file mode 100644 index 000000000..3b59ad459 --- /dev/null +++ b/docs/Tuple.md @@ -0,0 +1,22 @@ +Tuples +====== + +```haskell +fst :: (a, b) -> a +``` + +```haskell +snd :: (a, b) -> b +``` + +```haskell +swap :: (a, b) -> (b, a) +``` + +```haskell +curry :: ((a, b) -> c) -> a -> b -> c +``` + +```haskell +uncurry :: (a -> b -> c) -> (a, b) -> c +``` diff --git a/docs/TypeLevel.md b/docs/TypeLevel.md new file mode 100644 index 000000000..3a0346a3d --- /dev/null +++ b/docs/TypeLevel.md @@ -0,0 +1,57 @@ +Type Level +========== + +```haskell +data Coercion (a :: k) (b :: k) where + Coercion :: forall (k :: BOX) (a :: k) (b :: k). Coercible a b => Coercion a b +``` + +```haskell +coerceWith :: Coercion a b -> a -> b +``` + +#### Empty + +```haskell +data Void +``` + +```haskell +absurd :: Void -> a +``` + +```haskell +vacuous :: Functor f => f Void -> f a +``` + +#### Proxy + +```haskell +data Proxy (t :: k) = Proxy +``` + +#### Type Equality + +```haskell +(:~:) :: k -> k -> * +``` + +```haskell +(==) :: k -> k -> Bool +``` + +```haskell +sym :: a :~: b -> b :~: a +``` + +```haskell +trans :: a :~: b -> b :~: c -> a :~: c +``` + +```haskell +castWith :: a :~: b -> a -> b +``` + +```haskell +gcastWith :: a :~: b -> ((a ~ b) => r) -> r +```