From ef3f5453337f5259df2a9dfb68a4eb8246aa58e4 Mon Sep 17 00:00:00 2001 From: Jack Ek <2727556+kjekac@users.noreply.github.com> Date: Sun, 3 Oct 2021 04:04:10 +0200 Subject: [PATCH] documentation --- src/Error.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Error.hs b/src/Error.hs index 1a4e7bb3..606efd73 100644 --- a/src/Error.hs +++ b/src/Error.hs @@ -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 @@ -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