Logs: freenode/#haskell
| 2020-11-02 05:46:24 | × | day quits (~Unknown@unaffiliated/day) (Ping timeout: 240 seconds) |
| 2020-11-02 05:46:24 | day_ | is now known as day |
| 2020-11-02 05:47:20 | <jackdk> | so the Costar thing is a pun, like Biff/Tannen? |
| 2020-11-02 05:49:28 | → | refried_ joins (~textual@pool-108-20-26-90.bstnma.fios.verizon.net) |
| 2020-11-02 05:49:31 | → | is_null joins (~jpic@pdpc/supporter/professional/is-null) |
| 2020-11-02 05:51:24 | <int-e> | jackdk: well, maybe :) |
| 2020-11-02 05:51:38 | <int-e> | but there is also an actual duality |
| 2020-11-02 05:57:00 | → | knupfer joins (~Thunderbi@87.123.206.240) |
| 2020-11-02 05:59:06 | × | mokulus_ quits (~mat@176.111.230.96) (Read error: Connection reset by peer) |
| 2020-11-02 05:59:41 | → | mokulus_ joins (~mat@176.111.230.96) |
| 2020-11-02 05:59:44 | × | mimi_vx quits (~mimi@2a01:490:16:1026:8cbe:b3f3:f284:209c) (Ping timeout: 268 seconds) |
| 2020-11-02 06:00:01 | × | reset quits (~reset@84.39.116.180) () |
| 2020-11-02 06:00:32 | × | refried_ quits (~textual@pool-108-20-26-90.bstnma.fios.verizon.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 2020-11-02 06:01:46 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 258 seconds) |
| 2020-11-02 06:06:02 | × | knupfer quits (~Thunderbi@87.123.206.240) (Ping timeout: 264 seconds) |
| 2020-11-02 06:11:02 | → | coot joins (~coot@37.30.60.135.nat.umts.dynamic.t-mobile.pl) |
| 2020-11-02 06:11:09 | <danso> | i see this pattern often in my code where i end up in many nested `case` expressions |
| 2020-11-02 06:11:13 | <danso> | https://github.com/ninedotnine/soucc/blob/main/src/TypeChecker/TypeChecker.hs#L61-L75 |
| 2020-11-02 06:11:43 | <danso> | usually `do` notation makes these go away, but here it only works for the outer monad (State) |
| 2020-11-02 06:11:51 | <danso> | and i would like it to work with Either as well |
| 2020-11-02 06:12:09 | <danso> | i'm sure i've read about the cure for this problem on a blog somewhere, but i don't know how to find it now. help? |
| 2020-11-02 06:12:37 | → | knupfer joins (~Thunderbi@200116b82c45b30000b473fffe3f50e6.dip.versatel-1u1.de) |
| 2020-11-02 06:12:37 | × | knupfer quits (~Thunderbi@200116b82c45b30000b473fffe3f50e6.dip.versatel-1u1.de) (Client Quit) |
| 2020-11-02 06:12:52 | → | knupfer joins (~Thunderbi@87.123.206.240) |
| 2020-11-02 06:13:24 | <jackdk> | danso: sounds like a job for monad transformers, specifically ExceptT |
| 2020-11-02 06:13:58 | <jackdk> | if I understand you correctly, you can temporarily work with a transformer, you don't have to use it all over your program |
| 2020-11-02 06:14:35 | <jackdk> | `run_globals defns = runExceptT $ do ...` etc |
| 2020-11-02 06:15:31 | <danso> | thanks, i will start reading |
| 2020-11-02 06:15:48 | <danso> | this occurs in many places in my program; maybe it would be appropriate to use ExceptT throughout |
| 2020-11-02 06:16:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 2020-11-02 06:17:18 | × | knupfer quits (~Thunderbi@87.123.206.240) (Ping timeout: 260 seconds) |
| 2020-11-02 06:19:39 | × | is_null quits (~jpic@pdpc/supporter/professional/is-null) (Ping timeout: 260 seconds) |
| 2020-11-02 06:20:24 | → | dorkside9 joins (~tdbgamer@208.190.197.222) |
| 2020-11-02 06:21:14 | → | juri_ joins (~juri@178.63.35.222) |
| 2020-11-02 06:21:19 | × | dorkside quits (~tdbgamer@208.190.197.222) (Ping timeout: 268 seconds) |
| 2020-11-02 06:21:19 | dorkside9 | is now known as dorkside |
| 2020-11-02 06:22:50 | × | falafel quits (~falafel@24-223-105-148.static.cablene.com) (Ping timeout: 264 seconds) |
| 2020-11-02 06:24:45 | × | ski quits (~ski@nc-2504-30.studat.chalmers.se) (Ping timeout: 240 seconds) |
| 2020-11-02 06:25:44 | → | ski joins (~ski@nc-2504-30.studat.chalmers.se) |
| 2020-11-02 06:29:18 | × | drbean quits (~drbean@TC210-63-209-71.static.apol.com.tw) (Ping timeout: 272 seconds) |
| 2020-11-02 06:36:48 | × | Jeanne-Kamikaze quits (~Jeanne-Ka@68.235.43.86) (Ping timeout: 256 seconds) |
| 2020-11-02 06:38:02 | <danso> | does it make a difference whether i use `StateT s (Either e a)` or `ExceptT e (State s) a` ? |
| 2020-11-02 06:43:14 | × | xff0x quits (~fox@2001:1a81:537c:3e00:c8f2:34d9:3609:f336) (Ping timeout: 264 seconds) |
| 2020-11-02 06:44:07 | → | xff0x joins (~fox@2001:1a81:537c:3e00:f9de:e525:5d75:c389) |
| 2020-11-02 06:45:59 | → | thir joins (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) |
| 2020-11-02 06:46:15 | × | berberman quits (~berberman@unaffiliated/berberman) (Quit: ZNC 1.7.5 - https://znc.in) |
| 2020-11-02 06:47:05 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2020-11-02 06:52:14 | <int-e> | danso: They're isomorphic as types, but the latter has a handy Monad instance that propagates errors (approximately what your `case`s do) |
| 2020-11-02 06:52:36 | <int-e> | (or exceptions, whatever) |
| 2020-11-02 06:54:08 | <int-e> | danso: Err |
| 2020-11-02 06:54:52 | <int-e> | danso: Sorry, I misread because the former is wrong... you must have meant StateT s (Either e) a. |
| 2020-11-02 06:55:29 | <int-e> | danso: In which case, the main difference is that the former will forget the state on an exception/error. |
| 2020-11-02 06:55:50 | <danso> | ah i see i mistyped |
| 2020-11-02 06:55:56 | <danso> | oops |
| 2020-11-02 06:56:02 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:419f:7551:94a4:41c1) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-02 06:56:12 | <danso> | okay, i definitely want to keep the state |
| 2020-11-02 06:56:15 | <danso> | thanks int-e |
| 2020-11-02 06:56:52 | → | Axman6 joins (~Axman6@pdpc/supporter/student/Axman6) |
| 2020-11-02 06:56:52 | <danso> | curious, why does that happen? |
| 2020-11-02 06:58:44 | × | elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 240 seconds) |
| 2020-11-02 06:59:00 | → | drbean joins (~drbean@TC210-63-209-59.static.apol.com.tw) |
| 2020-11-02 06:59:46 | <int-e> | @unmtl StateT s (Either e a) |
| 2020-11-02 06:59:46 | <lambdabot> | err: `StateT s (Either e a)' is not applied to enough arguments, giving `/\A. s -> Either e a (A, s)' |
| 2020-11-02 06:59:51 | <int-e> | @unmtl StateT s (Either e) a |
| 2020-11-02 06:59:51 | <lambdabot> | s -> Either e (a, s) |
| 2020-11-02 07:00:19 | → | mimi_vx joins (~mimi@2a01:490:16:1026:8cbe:b3f3:f284:209c) |
| 2020-11-02 07:00:29 | <int-e> | Because StateT puts the resulting state into the monadic return value and Either's Left doesn't have one. |
| 2020-11-02 07:00:41 | <int-e> | @unmtl ErrorT e (State s) a |
| 2020-11-02 07:00:41 | <lambdabot> | s -> (Either e a, s) |
| 2020-11-02 07:01:05 | × | yinfeng quits (~yinfeng@2001:250:5002:8100::1:851e) (Quit: WeeChat 2.9) |
| 2020-11-02 07:01:19 | × | toorevitimirp quits (~tooreviti@117.182.183.132) (Quit: Konversation terminated!) |
| 2020-11-02 07:01:51 | <int-e> | Whereas this always has a state. (ErrorT is a bit weird and deprecated, but @unmtl doesn't know ExceptT) |
| 2020-11-02 07:02:45 | <danso> | ah thanks, the ErrorT left me confused |
| 2020-11-02 07:03:35 | → | florian_ joins (~florian@85-170-214-92.rev.numericable.fr) |
| 2020-11-02 07:04:36 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-02 07:05:22 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Read error: Connection reset by peer) |
| 2020-11-02 07:08:25 | × | Neuromancer quits (~Neuromanc@unaffiliated/neuromancer) (Ping timeout: 240 seconds) |
| 2020-11-02 07:08:31 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) () |
| 2020-11-02 07:08:46 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2020-11-02 07:09:33 | × | thir quits (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 2020-11-02 07:09:39 | → | thir joins (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) |
| 2020-11-02 07:10:31 | × | Sgeo quits (~Sgeo@ool-18b982ad.dyn.optonline.net) (Read error: Connection reset by peer) |
| 2020-11-02 07:11:27 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 2020-11-02 07:14:09 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-02 07:17:10 | × | berberman quits (~berberman@unaffiliated/berberman) (Quit: ZNC 1.7.5 - https://znc.in) |
| 2020-11-02 07:17:34 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2020-11-02 07:17:53 | → | chaosmasttter joins (~chaosmast@p200300c4a72dee01a86cafb086ba766e.dip0.t-ipconnect.de) |
| 2020-11-02 07:19:27 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-11-02 07:21:13 | <energizer> | what is the name of the function that takes f : X -> Y and Either X Null, if a is Null returns Null otherwise `f a`? |
| 2020-11-02 07:22:31 | <energizer> | (forgive my word choice, i'm not experienced with this kind of stuff) |
| 2020-11-02 07:22:40 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-02 07:23:59 | <energizer> | for example, it takes addOne and either a number or null, and if it's null returns null, but otherwise increments the number |
| 2020-11-02 07:24:48 | <energizer> | f addOne null = null; f addOne 3 = 4 |
| 2020-11-02 07:25:17 | <danso> | what you're talking about is basically fmap |
| 2020-11-02 07:25:35 | <danso> | but you seem to be mixing a few different ideas here |
| 2020-11-02 07:25:41 | <energizer> | oh? |
| 2020-11-02 07:25:55 | × | ski quits (~ski@nc-2504-30.studat.chalmers.se) (Ping timeout: 260 seconds) |
| 2020-11-02 07:25:58 | × | sfvm quits (~sfvm@37.228.215.148) (Remote host closed the connection) |
| 2020-11-02 07:26:03 | <danso> | @t fmap |
| 2020-11-02 07:26:04 | <lambdabot> | Maybe you meant: tell thank you thanks thesaurus thx tic-tac-toe ticker time todo todo-add todo-delete type v @ ? . |
All times are in UTC.