[Haskell-cafe] Monadic correctness
Andrew Coppin
andrewcoppin at btinternet.com
Sat Oct 17 17:32:29 EDT 2009
Daniel Fischer wrote:
> Am Samstag 17 Oktober 2009 22:24:08 schrieb Andrew Coppin:
>
>> Edward Z. Yang wrote:
>>
>>> Excerpts from Andrew Coppin's message of Sat Oct 17 15:21:28 -0400 2009:
>>>
>>>> Suppose we have
>>>>
>>>> newtype Foo x
>>>> instance Monad Foo
>>>> runFoo :: Foo x -> IO x
>>>>
>
> Are you sure that's really the type you want for runFoo ?
> By the definition below, runFoo :: Foo x -> M -> IO x would be the natural type.
>
M is a type containing a bunch of IORefs. runFoo generates M, feeds M to
Foo x, and then does magical stuff with M afterwards.
More information about the Haskell-Cafe
mailing list