-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Data type like Either but with accumulating error type
--   
--   Please see the <a>Accuerr</a> Haddock documentation for more
--   information.
@package accuerr
@version 0.2.0.2


-- | Provides <a>Accuerr</a>, a type similar to <a>Either</a> but where the
--   <tt>Applicative</tt> instance accumulates error values. This module is
--   based on work in the <tt>validation</tt> package, which is available
--   at
--   
--   <a>https://hackage.haskell.org/package/validation</a>
--   
--   The main differences between the <tt>validation</tt> package and this
--   one:
--   
--   <ul>
--   <li><tt>validation</tt> has more data types, many of which overlap
--   with those available in other packages. This package sticks with the
--   <a>Accuerr</a> type only.</li>
--   <li>This package works with GHC 8; as of 2016-06-11,
--   <tt>validation</tt> does not.</li>
--   <li><a>Accuerr</a> has fewer typeclass instances than its
--   corresponding type in <tt>validation</tt>.</li>
--   </ul>
module Accuerr

-- | A type similar to <a>Either</a> but the <a>Applicative</a> instance
--   accumulates error values. Unlike <a>Either</a>, there is no
--   <a>Monad</a> instance, because there is no <a>&gt;&gt;=</a> such that
--   <a>ap</a> equals <a>&lt;*&gt;</a>.
--   
--   For the <a>Applicative</a> instance to work, your error type must be a
--   <a>Semigroup</a>, such as a list or a <a>NonEmpty</a>.
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; import Text.Read
--   
--   &gt;&gt;&gt; :{
--          let readInt x = case readMaybe x of
--                Nothing -&gt; AccFailure [x]
--                Just a -&gt; AccSuccess a
--                  where _types = a :: Int
--       :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; (+) &lt;$&gt; readInt "3" &lt;*&gt; readInt "4"
--   AccSuccess 7
--   
--   &gt;&gt;&gt; (+) &lt;$&gt; readInt "x3" &lt;*&gt; readInt "4"
--   AccFailure ["x3"]
--   
--   &gt;&gt;&gt; (+) &lt;$&gt; readInt "x3" &lt;*&gt; readInt "x4"
--   AccFailure ["x3","x4"]
--   
--   &gt;&gt;&gt; (,,) &lt;$&gt; readInt "3" &lt;*&gt; readInt "4" &lt;*&gt; readInt "x5"
--   AccFailure ["x5"]
--   
--   &gt;&gt;&gt; sequenceA [AccSuccess 3, AccSuccess 4]
--   AccSuccess [3,4]
--   
--   &gt;&gt;&gt; sequenceA [AccSuccess 3, AccSuccess 4, AccFailure ['c'], AccFailure ['a']]
--   AccFailure "ca"
--   </pre>
data Accuerr e a
AccFailure :: e -> Accuerr e a
AccSuccess :: a -> Accuerr e a
_AccSuccess :: forall e_a8hZ a_a8i0 a_adXu. Prism (Accuerr e_a8hZ a_adXu) (Accuerr e_a8hZ a_a8i0) a_adXu a_a8i0
_AccFailure :: forall e_a8hZ a_a8i0 e_adXp. Prism (Accuerr e_adXp a_a8i0) (Accuerr e_a8hZ a_a8i0) e_adXp e_a8hZ

-- | Case analysis for the <a>Accuerr</a> type. Like <a>either</a>.
accuerr :: (a -> c) -> (b -> c) -> Accuerr a b -> c
accuerrToEither :: Accuerr e a -> Either e a
eitherToAccuerr :: Either e a -> Accuerr e a
isoAccuerrEither :: Iso' (Accuerr e a) (Either e a)
isoEitherAccuerr :: Iso' (Either e a) (Accuerr e a)
instance Data.Semigroup.Semigroup e => GHC.Base.Applicative (Accuerr.Accuerr e)
instance Data.Bifunctor.Bifunctor Accuerr.Accuerr
instance Data.Bifoldable.Bifoldable Accuerr.Accuerr
instance Data.Bitraversable.Bitraversable Accuerr.Accuerr
instance Control.Lens.Iso.Swapped Accuerr.Accuerr
instance Data.Traversable.Traversable (Accuerr.Accuerr e)
instance Data.Foldable.Foldable (Accuerr.Accuerr e)
instance GHC.Base.Functor (Accuerr.Accuerr e)
instance (GHC.Show.Show a, GHC.Show.Show e) => GHC.Show.Show (Accuerr.Accuerr e a)
instance (GHC.Classes.Ord a, GHC.Classes.Ord e) => GHC.Classes.Ord (Accuerr.Accuerr e a)
instance (GHC.Classes.Eq a, GHC.Classes.Eq e) => GHC.Classes.Eq (Accuerr.Accuerr e a)
