2025/01/30

Newest at the top

2025-01-30 20:35:52 +0100weary-traveler(~user@user/user363627) (Remote host closed the connection)
2025-01-30 20:35:40 +0100 <lambdabot> Just 4
2025-01-30 20:35:38 +0100 <[exa]> > Just (+) <*> Just 1 <*> Just 3 -- euouae try replacing one with Nothing
2025-01-30 20:35:12 +0100 <tomsmeding> euouae: if you think of Int -> Int as a state transformer, then a monad is a state transformer _that also does something else_
2025-01-30 20:34:46 +0100 <[exa]> euouae: btw are you familiar with how applicatives work? these are essentially the same thing but waaaaaaaaaaaaay more accessible for intuition
2025-01-30 20:33:07 +0100alexherbo2(~alexherbo@2a02-8440-3504-afc6-21c9-80c8-175a-acbd.rev.sfr.net) alexherbo2
2025-01-30 20:32:48 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-01-30 20:32:48 +0100alexherbo2(~alexherbo@2a02-8440-3504-afc6-21c9-80c8-175a-acbd.rev.sfr.net) (Remote host closed the connection)
2025-01-30 20:29:49 +0100 <euouae> I think Goedel's numbering will help you
2025-01-30 20:29:36 +0100 <mauke> how do I wrote an uncomputable function
2025-01-30 20:29:30 +0100 <euouae> I don't know if state machines can be noncomputable, because I think of them in terms of rule sets (algorithmic)
2025-01-30 20:29:04 +0100 <euouae> btw with Int -> Int you'd have to restrict to recursively defined functions, i.e. computable
2025-01-30 20:27:53 +0100CiaoSen(~Jura@2a05:5800:241:f200:ca4b:d6ff:fec1:99da) CiaoSen
2025-01-30 20:27:43 +0100 <tomsmeding> not consciously
2025-01-30 20:27:15 +0100 <mauke> have you never opened a box and found N copies of yourself in N different parallel universes?
2025-01-30 20:27:08 +0100 <euouae> maybe I should look more into the state monad at this point
2025-01-30 20:26:28 +0100 <mauke> works for me!
2025-01-30 20:26:15 +0100 <tomsmeding> mauke: I'd call that one not even an intuition any more. :P
2025-01-30 20:26:00 +0100 <mauke> anything that doesn't fit into the box model just uses more magic
2025-01-30 20:25:48 +0100 <tomsmeding> "burrito" works fine for a State monad, but it makes little sense for the Maybe monad already
2025-01-30 20:25:40 +0100 <mauke> look, it's simple: magic boxes
2025-01-30 20:25:26 +0100 <tomsmeding> the more concrete / simple you make your intuition of monads, the less actual monads it applies to
2025-01-30 20:25:11 +0100 <tomsmeding> the only intuition that I know for monads that can still sensibly be called an "intuition", but nevertheless scales to the vast majority of monads (if not all of them), is "overloaded semicolon"
2025-01-30 20:24:54 +0100 <euouae> In the definition of >>= in the instance of Monad
2025-01-30 20:24:46 +0100 <mauke> where do you see a rule set?
2025-01-30 20:24:33 +0100 <euouae> I don't mean functionally composable, I mean that their state machine rule sets compose
2025-01-30 20:24:12 +0100 <mauke> composes fine
2025-01-30 20:24:10 +0100 <lambdabot> 8
2025-01-30 20:24:08 +0100 <mauke> > ((* 2) . (+ 1)) 3
2025-01-30 20:24:06 +0100 <euouae> Well, perhaps it is faulty intuition.
2025-01-30 20:24:01 +0100 <tomsmeding> functions are the ultimate composable thing!
2025-01-30 20:23:52 +0100 <euouae> Yeah but 'composable' state machines is where I like the idea -- that';s what makes monads different
2025-01-30 20:23:45 +0100 <mauke> in particular, it's no longer specific to monads or >>=
2025-01-30 20:23:34 +0100Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla
2025-01-30 20:23:33 +0100 <tomsmeding> and it's not a useful label to attach to programs any more
2025-01-30 20:23:32 +0100 <[exa]> <3
2025-01-30 20:23:29 +0100MyNetAz(~MyNetAz@user/MyNetAz) MyNetAz
2025-01-30 20:23:26 +0100 <tomsmeding> at that point all programs are state machines :p
2025-01-30 20:23:24 +0100Square2(~Square4@user/square) (Ping timeout: 246 seconds)
2025-01-30 20:23:14 +0100 <euouae> tomsmeding: I see your point about it being stateless; but if the Int -> Int function is algorithmic, it is the computation of a state machine
2025-01-30 20:22:53 +0100 <tomsmeding> you had a state of type Int, and you get back a new one
2025-01-30 20:22:36 +0100 <tomsmeding> euouae: if you have a function `Int -> Int`, is that also a state machine?
2025-01-30 20:22:19 +0100 <tomsmeding> you need the second Just
2025-01-30 20:22:17 +0100 <lambdabot> Just 2
2025-01-30 20:22:15 +0100 <tomsmeding> > Just 1 >>= \x -> Just (x + 1)
2025-01-30 20:22:13 +0100 <[exa]> you can look at Maybe as a state machine too, with 2 states (the one that carries data and the one that has failed already)
2025-01-30 20:22:06 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-01-30 20:22:05 +0100 <euouae> mauke, well e.g. `Just 1 >>= (\x -> x + 1)` will give you Just 2. You had the state Just 1; now you have the state Just 2 with input the x+1 calculation.
2025-01-30 20:21:57 +0100 <tomsmeding> euouae: I see a state machine as a box that has some internal state, and that you can send events to and it responds to those events and updates its state
2025-01-30 20:21:36 +0100 <euouae> I'm not familiar with `State` yet, so before we go there, maybe if you can tell me a bit more about why Maybe is not a state machine