[darcs-devel] changing (PatchInfo, Maybe Patch) to (PatchInfo, Hopefully Patch)

Jason Dagit dagit at codersbase.com
Sat Dec 9 11:50:57 PST 2006


On 12/9/06, David Roundy <droundy at darcs.net> wrote:
> Hi all,
>
> I've just started (an hour ago) converting all the (PatchInfo, Maybe Patch)
> instances in darcs to (PatchInfo, Hopefully Patch) where
>
> data Hopefully a = Actually a | Unavailable String

Is there a reason to not use 'Either a String' instead?  That's the
common way to handle error propagation (Either is a commonly used
instance of MonadError).

Obviously creating new datatypes is easy in Haskell, but is it the
right thing here?  Maybe we just need 'type Hopefully a = Either a
String' instead.

Jason




More information about the darcs-devel mailing list