http://hackage.haskell.org/package/validation-0.3.4/docs/Data-Validation.html



On Thu, May 22, 2014 at 7:46 AM, John Meacham <john@repetae.net> wrote:
On Mon, May 19, 2014 at 8:31 AM, Corentin Dupont
<corentin.dupont@gmail.com> wrote:
> However the instance in Control.Monad.Trans.Error.Error gets in the way...
> I cannot use this one, it works only with Strings.
> My use case is that the Either handle in the Right a final value, or else in
> the Left a list of things "left to do" to compute the value.
> How can I do?

You want to use a newtype to wrap your Either. It sounds like you would want
to do this independently of the String instance because you are not using
left as shortcutting failure anyway, rather you want to collect together
the failure actions.

newtype NotDoneYet b a = NotDoneYet (Either [b] a)

instance Applicative (NotDoneYet b) where
        Left xs <*> Left ys = Left (xs ++ ys)
        ...


--
John Meacham - http://notanumber.net/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe