Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

That depends on the monad library. In transformers it would be:
(Monad m, Eq a) => a -> StateT [a] m Bool
State s is just a type synonym for StateT s Identity, so this works for State as well.
I like it, it is simpler than the one using MonadState. I had read many tutorials and wiki articles, and saw nowhere that there were different implementations of what seemed to be standard libraries.
On a higher level, in case you are interested, here's a description of how I would model your problem.
Actually using a monad transformer was the goal of it all, tutorial-like. The example was contrived. Another question would be: when is it relevant to use monad transformers? I'm not sure to have enough haskell practice to be ready for that one, though. :^) And for sure, my example didn't need it. Thanks Eric

On Jun 24, 2009, at 07:43 , papa.eric@free.fr wrote:
I had read many tutorials and wiki articles, and saw nowhere that there were different implementations of what seemed to be standard libraries.
Alternative monad libraries are still fairly new, and there's a lot of discussion still about whether to bless one as the official (instead of de-facto) standard and how, if it all, to implement a common interface/API. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
papa.eric@free.fr