Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kjekac committed Oct 3, 2021
1 parent 31f33c7 commit 0b4c157
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}

{-|
Module : Error
Description : An instantiation of 'Validation' with our error type.
This specializes 'Data.Validation.Validation' to keep its errors in a 'NonEmpty' list
and keep track of a 'Pn' for every error it logs. There is also some infrastructure
around modified chaining/branching behaviours.
-}

module Error (module Error) where

import Data.Functor.Alt
Expand All @@ -27,7 +36,7 @@ throw msg = Failure [msg]

infixr 1 <==<, >==>

-- Like @Control.Monad.'(>=>)'@ but allows us to chain error-prone
-- Like 'Control.Monad.(>=>)' but allows us to chain error-prone
-- computations even without a @Monad@ instance.
(>==>) :: (a -> Error e b) -> (b -> Error e c) -> a -> Error e c
f >==> g = \x -> f x `bindValidation` g
Expand Down

0 comments on commit 0b4c157

Please sign in to comment.