Andrew J Bromage
Fri, 3 Jan 2003 09:56:41 +1100
On Wed, Jan 01, 2003 at 01:15:09PM +0100, Nicolas.Oury wrote:
> From this, I think the safety become intuitive.
Using the OI module from Richard Kieburtz' paper, I can write
-- Bootstrap into the OI comonad
main :: IO ()
main = return $! comain stdOI
-- The following are the OI functions which we use.
-- stdGetChar :: OI () -> Char
-- stdPutStrLn :: OI String -> ()
comain :: OI a -> ()
= coeval (w .>> show (a,b) =>> stdPutStrLn)
a = coeval (w .>> () =>> stdGetChar)
b = coeval (w .>> () =>> stdGetChar)
Even though a and b are identical, they return different values. I see
two possibilities: Either my intuition is way off, or the OI comonad
breaks referential transparency.
It's possible that it's a fault in the implementation. It was clearly
intended as an example only, after all.