Re: [Haskell-cafe] Ambiguous reified dictionaries

2009-04-09 Thread Martijn van Steenbergen
Lennart Augustsson wrote: That program is incorrect, it contains two instances for Monoid Int, and the compiler should flag it as illegal. Two simultaneous instances are okay as long as you don't use any of those instances, right? Just like two imported symbols with the same name are okay as

[Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Mark Spezzano
Hi, How exactly do monads “solve” the problem of referential transparency? I understand RT to be such that a function can be replaced with a actual value. Since a monad could potentially encapsulate any other value—say, data read from a keyboard—doesn’t that violate the assumption of RT

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-09 Thread Claus Reinke
|Oh now i see what you mean: consider |f' = abst . (id :: (d-a)-(d-a)) . appl |which GHC understands to mean |f' = abst . (id :: forall d a. (d-a)-(d-a)) . appl | |GHC infers the type |f' :: (Fun d) = Memo d a - Memo d a |Now you are saying that GHC *could* have figured

Re: [Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Brandon S. Allbery KF8NH
On 2009 Apr 9, at 22:30, Jonathan Cast wrote: On Thu, 2009-04-09 at 21:57 -0400, Brandon S. Allbery KF8NH wrote: On 2009 Apr 9, at 16:09, Luke Palmer wrote: On Thu, Apr 9, 2009 at 1:33 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: I'm not sure what you mean by that, but

Re: [Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Miguel Mitrofanov
On 10 Apr 2009, at 06:30, Jonathan Cast wrote: do s - readFile /my_file writeFile /my_file Hello, world!\n threadDelay 1 -- If you don't like threadDelay, just substitute forcing -- an expensive thunk here writeFile /my_file s As a function from

[Haskell-cafe] Re: Referential Transparency and Monads

2009-04-09 Thread Heinrich Apfelmus
Luke Palmer wrote: Miguel Mitrofanov wrote: I'm not sure what you mean by that, but semantically IO is definitely *not* a state monad. Under any circumstances or any set of assumptions. Ehm? Why not? Mainly forkIO. There may be other reasons. Tackling the awkward squad mentions that

Re: [Haskell-cafe] Re: Referential Transparency and Monads

2009-04-09 Thread Brandon S. Allbery KF8NH
On 2009 Apr 10, at 1:09, Jonathan Cast wrote: On Fri, 2009-04-10 at 01:03 -0400, Brandon S. Allbery KF8NH wrote: On 2009 Apr 10, at 0:52, Jonathan Cast wrote: On Fri, 2009-04-10 at 00:46 -0400, Brandon S. Allbery KF8NH wrote: IO a ~ World - (a, World) I still don't understand this; we are