[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Use of the Try typeclass

Subject: Re: [Haskell-cafe] Use of the Try typeclass
From: Alexander Dunlap
Date: Wed, 30 Dec 2009 21:06:58 -0800
On Wed, Dec 30, 2009 at 5:52 PM, Edward Z. Yang <[email protected]> wrote:
> Hello all,
> I am currently playing with the new cadre of failure libraries, and I'm
> trying to figure out how to use the monadic version of Failure while
> also getting the Try typeclass, which appears to be the standardized mechanism
> for marshalling values from specific monads into the failure monad.
> Unfortunately, it only seems to be defined when I import Control.Failure,
> and this module is fairly incompatible with Control.Monad.Failure, as
> demonstrated by this GHCI transcript:
> Â Â[email protected]:~/Documents/tmr$ ghci
> Â ÂPrelude> :m +Control.Failure
> Â ÂPrelude Control.Failure> :m +Control.Monad.Failure
> Â ÂPrelude Control.Failure Control.Monad.Failure> :t failure
> Â Â<interactive>:1:0:
> Â Â Â ÂAmbiguous occurrence `failure'
> Â Â Â ÂIt could refer to either `Control.Failure.failure', imported from 
> Control.Failure
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âor `Control.Monad.Failure.failure', imported 
> from Control.Monad.Failure
> I'm using MTL, which might be the reason why there's all sorts of 
> unhappiness. :-)
> Cheers,
> Edward
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Why are you importing both Control.Failure and Control.Monad.Failure
when the latter just re-exports the former? Are you using the latest
versions of the two packages? Try importing just
Control.Monad.Failure.MTL; that provides the MTL failure instances and
also re-exports Control.Failure.

Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>