2025/09/16

Newest at the top

2025-09-16 17:29:27 +0200trickard_(~trickard@cpe-94-98-47-163.wireline.com.au)
2025-09-16 17:29:26 +0200tureba(~tureba@tureba.org) tureba
2025-09-16 17:26:45 +0200 <merijn> Guest19: Step one would be to figure out/write out what the type of each argument is
2025-09-16 17:25:49 +0200trickard_(~trickard@cpe-94-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-09-16 17:25:35 +0200 <[exa]> also tbh I don't recall a good "simple" example where such 2 layers would be used
2025-09-16 17:24:38 +0200 <[exa]> function `g :: ((Int -> Int) -> Int) -> Int` gets a callback which itself gets callback(s) and produces integers for `g`
2025-09-16 17:23:57 +0200 <[exa]> function `f :: (Int -> Int) -> Int` gets a callback that processes integers for it
2025-09-16 17:23:26 +0200 <[exa]> Guest19: not sure if it helps but sometimes I got lucky getting stuff explained to myself by calling that function a "callback" as in procedural languages
2025-09-16 17:23:10 +0200 <Guest19> haha it is an exercise, thanks for clarification
2025-09-16 17:21:54 +0200 <tomsmeding> x might always return 42; it might apply the passed Int-mutator function to 6; it might apply the function 100 times to 1; it might also `unsafePerformIO launchMissiles`
2025-09-16 17:21:15 +0200 <tomsmeding> now what is x supposed to do? I dunno, there's no context here
2025-09-16 17:21:04 +0200end(~end@user/end/x-0094621) end^
2025-09-16 17:21:01 +0200 <tomsmeding> so inside f10, we create an Int-mutattor (\a -> a + 10), pass it to the service, and indeed we get an Int back
2025-09-16 17:20:38 +0200AlexZenon(~alzenon@178.34.162.29)
2025-09-16 17:20:29 +0200 <tomsmeding> this is exactly the same thing as the literal interpretation of the type, but it gives a little... crude intuition, maybe, for thinking about this x
2025-09-16 17:20:17 +0200confusedalex(~confuseda@user/confusedalex) confusedalex
2025-09-16 17:20:14 +0200jmcantrell_jmcantrell
2025-09-16 17:20:13 +0200jmcantrell_(~weechat@user/jmcantrell) jmcantrell
2025-09-16 17:19:50 +0200 <tomsmeding> one could explain x as a service that, when passed an Int-mutator, gives you back an Int
2025-09-16 17:19:34 +0200 <tomsmeding> since there is no context here (I suspect this is an exercise), one can try to invent context
2025-09-16 17:19:23 +0200Raito_Bezarius(~Raito@libera/contributor/wireguard.tunneler.raito-bezarius) Raito_Bezarius
2025-09-16 17:19:19 +0200 <tomsmeding> while you can work out the algebra -- it's a function that, when given an Int -> Int function, gives you back an Int -- it's often helpful when dealing with these kind of multi-layered higher-order functions to have some context to get intuition from
2025-09-16 17:19:00 +0200mjrosenb(~mjrosenb@70.18.10.118)
2025-09-16 17:18:45 +0200 <tomsmeding> that case is less trivial indeed
2025-09-16 17:18:38 +0200down200(~down200@shell.lug.mtu.edu) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200tureba(~tureba@tureba.org) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200mjrosenb(~mjrosenb@70.18.10.118) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200peutri(~peutri@bobo.desast.re) (Remote host closed the connection)
2025-09-16 17:18:38 +0200confusedalex(~confuseda@user/confusedalex) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200ystael_(~ystael@user/ystael) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200AlexZenon(~alzenon@178.34.162.29) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200ames8ames
2025-09-16 17:18:38 +0200jcarpenter2(~lol@2603:3016:1e01:b980:50d7:d756:5d4d:269d) (Ping timeout: 260 seconds)
2025-09-16 17:18:38 +0200ames(~amelia@offtopia/offtopian/amelia) (Ping timeout: 260 seconds)
2025-09-16 17:18:37 +0200taktoa[c]_taktoa[c]
2025-09-16 17:18:37 +0200taktoa[c](sid282096@id-282096.tinside.irccloud.com) (Ping timeout: 260 seconds)
2025-09-16 17:18:31 +0200 <Guest19> I get that it’s a higher-order function, but I’d love to hear how you mentally unpack or visualize what’s going on there.
2025-09-16 17:18:31 +0200 <Guest19> Now I’m wondering about the inverse situation—how do you reason about nested types like `((Int -> Int) -> Int)`?
2025-09-16 17:18:30 +0200 <Guest19> Thanks so much, that really helped clarify things! 🙌
2025-09-16 17:18:29 +0200trickard_(~trickard@cpe-94-98-47-163.wireline.com.au)
2025-09-16 17:18:15 +0200trickard(~trickard@cpe-94-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-09-16 17:18:09 +0200down200-(~down200@shell.lug.mtu.edu) down200
2025-09-16 17:17:49 +0200arandombit(~arandombi@user/arandombit) arandombit
2025-09-16 17:17:39 +0200peutri_(~peutri@bobo.desast.re) peutri
2025-09-16 17:17:36 +0200taktoa[c]_(sid282096@id-282096.tinside.irccloud.com) taktoa[c]
2025-09-16 17:17:16 +0200ystael(~ystael@user/ystael) ystael
2025-09-16 17:16:36 +0200pie_(~pie_bnc@user/pie/x-2818909) (Remote host closed the connection)
2025-09-16 17:15:10 +0200tromp(~textual@2001:1c00:3487:1b00:988d:4246:ce46:c357) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-09-16 17:14:59 +0200arandombit(~arandombi@user/arandombit) (Ping timeout: 260 seconds)
2025-09-16 17:14:14 +0200pie__(~pie_bnc@user/pie/x-2818909) __