2024/10/03

Newest at the top

2024-10-03 19:16:04 +0200 <c_wraith> seq (print 5) ()
2024-10-03 19:16:00 +0200 <c_wraith> I mean, no
2024-10-03 19:15:51 +0200 <EvanR> ^
2024-10-03 19:15:14 +0200 <gentauro> but I think that the behavior might have to due solely to `ghci`
2024-10-03 19:15:12 +0200 <c_wraith> that made it complicated for no value
2024-10-03 19:15:10 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-10-03 19:15:07 +0200 <c_wraith> well, it was until people started demanding the ability to add declarations in ghci
2024-10-03 19:14:57 +0200 <gentauro> EvanR: Yes and no. My guess for what author is experiencing was the lazy nature of Haskell and hereby `ghci`
2024-10-03 19:14:51 +0200 <c_wraith> ghci's behavior is "you are entering lines in a do block that makes up the entry point of the program". Nice and simple.
2024-10-03 19:14:14 +0200 <EvanR> which is weird
2024-10-03 19:14:06 +0200 <EvanR> gentauro was asking about ghci's behavior I thought
2024-10-03 19:13:47 +0200 <EvanR> on top of that
2024-10-03 19:13:32 +0200 <EvanR> you actually have to type it in ghci
2024-10-03 19:13:30 +0200 <c_wraith> it's just that ghci binds IO actions that are entered at the top level
2024-10-03 19:13:26 +0200 <EvanR> true, existence is an act of mental construction
2024-10-03 19:13:11 +0200 <c_wraith> seq (print 5) ()
2024-10-03 19:13:03 +0200 <c_wraith> even simply *existing* doesn't cause them to execute in ghci
2024-10-03 19:12:48 +0200 <EvanR> except in ghci
2024-10-03 19:12:38 +0200 <c_wraith> Yeah, seems to me that the best answer is "IO values aren't executed simply for existing"
2024-10-03 19:12:34 +0200 <gentauro> hmmmm
2024-10-03 19:12:28 +0200 <yahb2> <no output>
2024-10-03 19:12:28 +0200 <gentauro> % !e = print 5
2024-10-03 19:12:21 +0200 <yahb2> <no output>
2024-10-03 19:12:20 +0200 <gentauro> % e = print 5
2024-10-03 19:12:12 +0200 <gentauro> (0.01 secs, 114,280 bytes)
2024-10-03 19:12:04 +0200 <gentauro> λ> e = print 5
2024-10-03 19:12:01 +0200 <yahb2> 5
2024-10-03 19:12:01 +0200 <EvanR> % print 5
2024-10-03 19:11:53 +0200 <gentauro> λ> :set -fprint-bind-result
2024-10-03 19:11:45 +0200 <geekosaur> otherwise you'd need to evaluate `e` separately
2024-10-03 19:11:13 +0200 <geekosaur> I think with `-fprint-bind-result` you'll see it because ghci detects things that are in `MonadIO` and sequences them for you
2024-10-03 19:10:32 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) merijn
2024-10-03 19:10:20 +0200 <gentauro> thx I mean
2024-10-03 19:10:17 +0200 <gentauro> geekosaur: No probs and tx.
2024-10-03 19:10:03 +0200 <geekosaur> okay, I'm in count, must go, sorry
2024-10-03 19:09:19 +0200 <geekosaur> `e = print 5` binds `e` to an IO action. you need to sequence the IO action to have it do anything
2024-10-03 19:08:33 +0200 <geekosaur> right, but the way it's being mimicked will affect the result
2024-10-03 19:07:29 +0200 <gentauro> geekosaur: my example for Ocaml/F# is: `let e = System.Console.WriteLine 5` would print 5. However: `let el () = System.Console.WriteLine 5` would not (this is how you tend to mimic Haskell lazyness in F# for example)
2024-10-03 19:07:11 +0200ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en
2024-10-03 19:07:06 +0200 <geekosaur> `:set -fprint-bind-result` will allow `let`s to show results but I think you'd just get a type error because `IO` actions don't have `Show` instances
2024-10-03 19:05:37 +0200 <geekosaur> both to some extent, but the major omne is that `e` is bound to an IO action
2024-10-03 19:05:03 +0200 <gentauro> Thx in advance :-)
2024-10-03 19:04:56 +0200 <gentauro> Hey all. Having a discussion with the author of https://discourse.haskell.org/t/question-on-a-simple-repl-example-for-side-effects/10459 about if `e = print 5` in `ghci` is not triggering `print 5` on binding due to `IO` effects (his claim) or due to Haskells lazy nature (my claim). Which is it?
2024-10-03 19:01:34 +0200polyphem(~rod@p4fc2c55e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2024-10-03 18:59:33 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
2024-10-03 18:58:36 +0200paddymahoney(~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com)
2024-10-03 18:57:34 +0200raehik(~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) raehik
2024-10-03 18:55:02 +0200merijn(~merijn@204-220-045-062.dynamic.caiway.nl) merijn
2024-10-03 18:53:32 +0200paddymahoney(~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Ping timeout: 255 seconds)
2024-10-03 18:53:23 +0200 <EvanR> cabal install leftPad