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
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
|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
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
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
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
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