Logs: liberachat/#haskell
| 2021-06-04 08:14:13 | <bor0> | Ah, yea. Can ignore that :) Just some code to play around with mixing monads |
| 2021-06-04 08:14:33 | <c_wraith> | fooEq is weird, in that the monad laws say it should be the same as foo |
| 2021-06-04 08:14:37 | <dminuoso> | Second, you should use `fmap` rather than `>>= (\x -> return (...))` |
| 2021-06-04 08:15:02 | → | hendursaga joins (~weechat@user/hendursaga) |
| 2021-06-04 08:15:24 | <dminuoso> | Its hard to decipher what you're trying to accomplish. |
| 2021-06-04 08:16:20 | <dminuoso> | Though from what I can see, monad transformers is indeed what you should be exploring. |
| 2021-06-04 08:16:37 | × | rk04 quits (~rk04@user/rajk) (Ping timeout: 272 seconds) |
| 2021-06-04 08:16:39 | <bor0> | I want the same functionality of `combined` in `do` notation. Something I tried is https://paste.tomsmeding.com/NpMW45IZ (and different combinations) but they all type errored |
| 2021-06-04 08:18:31 | <dminuoso> | bor0: Look into using ExceptT + StateT. |
| 2021-06-04 08:18:34 | → | Heffalump joins (~ganesh@urchin.earth.li) |
| 2021-06-04 08:18:42 | → | hughjfchen joins (~hughjfche@vmi556545.contaboserver.net) |
| 2021-06-04 08:18:54 | <bor0> | Yeah, I came to that conclusion from Google but as I said, just exercising with transforming them manually for now :) |
| 2021-06-04 08:19:02 | <dminuoso> | e.g. what you seem to be after is just `ExceptT String (State Int)` and `StateT Int (ExceptT String)` |
| 2021-06-04 08:19:04 | → | Guest75 joins (~Guest75@180.168.212.6) |
| 2021-06-04 08:19:25 | → | ddellaco_ joins (~ddellacos@86.106.121.84) |
| 2021-06-04 08:19:36 | <dminuoso> | Oops, the latter should read `StateT Int (Except T)` |
| 2021-06-04 08:19:49 | <c_wraith> | bor0: https://paste.tomsmeding.com/ICIGlNG5 It's a completely mechanical translation |
| 2021-06-04 08:20:08 | <c_wraith> | other than the spot where I backspaced too far once :) |
| 2021-06-04 08:20:22 | Guest75 | is now known as yd502 |
| 2021-06-04 08:20:25 | <bor0> | Ahh.. |
| 2021-06-04 08:21:02 | <c_wraith> | also, whenever you have a single bind followed by a return, you shouldn't be using do notation. as dminuoso says, that's just an fmap |
| 2021-06-04 08:21:09 | × | hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection) |
| 2021-06-04 08:21:13 | <bor0> | OK I see where my error was. So you "lift" (or transform or whatever the best term is) in the end (after return), and you don't do it in between `do` and `return` |
| 2021-06-04 08:21:24 | → | nschoe joins (~quassel@2a01:e0a:8e:a190:4986:fc3e:f94f:76cf) |
| 2021-06-04 08:21:45 | → | hughjfchen joins (~hughjfche@vmi556545.contaboserver.net) |
| 2021-06-04 08:21:47 | <c_wraith> | The monad transformer stuff is sort of entirely orthogonal to what I did |
| 2021-06-04 08:21:59 | → | berberman joins (~berberman@user/berberman) |
| 2021-06-04 08:22:10 | <bor0> | Is it? We combine State + Either monads? |
| 2021-06-04 08:22:19 | <c_wraith> | That's a semantic transformation |
| 2021-06-04 08:22:19 | ← | Heffalump parts (~ganesh@urchin.earth.li) () |
| 2021-06-04 08:22:30 | <c_wraith> | I just did a syntactic transformation |
| 2021-06-04 08:22:57 | × | berberman_ quits (~berberman@user/berberman) (Ping timeout: 272 seconds) |
| 2021-06-04 08:23:44 | × | hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection) |
| 2021-06-04 08:24:02 | <bor0> | OK, yeah :) I need to get used to translating these mechanically |
| 2021-06-04 08:24:13 | × | ddellaco_ quits (~ddellacos@86.106.121.84) (Ping timeout: 272 seconds) |
| 2021-06-04 08:24:18 | → | fendor_ joins (~fendor@178.165.131.187.wireless.dyn.drei.com) |
| 2021-06-04 08:24:57 | <c_wraith> | the big mistake you made was dropping the return in the middle of your definition of combined |
| 2021-06-04 08:25:06 | <bor0> | Yeah ^ |
| 2021-06-04 08:26:43 | × | fendor quits (~fendor@178.115.129.101.wireless.dyn.drei.com) (Ping timeout: 244 seconds) |
| 2021-06-04 08:26:48 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-04 08:27:46 | × | wonko quits (~wjc@user/wonko) (Ping timeout: 272 seconds) |
| 2021-06-04 08:30:29 | → | kuribas joins (~user@ptr-25vy0iaefdcx0vu09ud.18120a2.ip6.access.telenet.be) |
| 2021-06-04 08:31:01 | <kuribas> | is it possible to turn some warnings into errors at project level? |
| 2021-06-04 08:31:29 | → | ixlun- joins (~matthew@109.249.184.235) |
| 2021-06-04 08:31:37 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 272 seconds) |
| 2021-06-04 08:32:25 | × | peterhil quits (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) (Ping timeout: 245 seconds) |
| 2021-06-04 08:32:50 | × | azeem quits (~azeem@dynamic-adsl-94-34-34-125.clienti.tiscali.it) (Ping timeout: 245 seconds) |
| 2021-06-04 08:35:48 | → | yd502_ joins (~yd502@180.168.212.6) |
| 2021-06-04 08:36:35 | × | werneta quits (~werneta@128.149.243.107) (Ping timeout: 245 seconds) |
| 2021-06-04 08:36:48 | <sm[m]> | kuribas: you can set GHC flags in your package.yaml/cabal file, ghc-options: -Wall -Werror sort of thing |
| 2021-06-04 08:38:04 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 2021-06-04 08:38:42 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 2021-06-04 08:38:54 | <maerwald> | cabal.project is project wide, package.yaml/cabal not |
| 2021-06-04 08:39:38 | <maerwald> | kuribas: top-level ghc-options isn't supported in cabal.project yet, so you have to spell out ghc-options for every local project target explicitly |
| 2021-06-04 08:39:40 | <maerwald> | I think |
| 2021-06-04 08:40:03 | <kuribas> | does ghc-options work in ghci? |
| 2021-06-04 08:40:10 | <kuribas> | for example cabal repl? |
| 2021-06-04 08:41:04 | <maerwald> | I think so... at least I get warnings about flags clashing with the repl sometimes |
| 2021-06-04 08:41:09 | → | pera joins (~pera@user/pera) |
| 2021-06-04 08:42:55 | × | dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.1) |
| 2021-06-04 08:43:08 | → | dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be) |
| 2021-06-04 08:44:10 | ← | yd502_ parts (~yd502@180.168.212.6) (Leaving) |
| 2021-06-04 08:47:29 | × | dunkeln quits (~dunkeln@94.129.65.28) (Ping timeout: 252 seconds) |
| 2021-06-04 08:50:02 | → | dhil joins (~dhil@195.213.192.47) |
| 2021-06-04 08:54:17 | → | ddellaco_ joins (~ddellacos@86.106.121.56) |
| 2021-06-04 08:56:10 | → | yd502_ joins (~yd502@180.168.212.6) |
| 2021-06-04 08:56:43 | × | yd502 quits (~Guest75@180.168.212.6) (Quit: Client closed) |
| 2021-06-04 08:56:50 | <kuribas> | ok, thanks |
| 2021-06-04 08:56:59 | → | mc47 joins (~yecinem@89.246.239.190) |
| 2021-06-04 08:57:00 | × | node-sh quits (~node-sh@223.228.233.174) (Ping timeout: 245 seconds) |
| 2021-06-04 08:59:06 | × | ddellaco_ quits (~ddellacos@86.106.121.56) (Ping timeout: 264 seconds) |
| 2021-06-04 09:00:04 | × | sszark quits (~sszark@h-85-24-213-180.A392.priv.bahnhof.se) (Ping timeout: 272 seconds) |
| 2021-06-04 09:00:10 | → | yd502 joins (~yd502@180.168.212.6) |
| 2021-06-04 09:00:37 | × | nkpart quits (uid3844@id-3844.highgate.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-06-04 09:00:46 | × | yd502 quits (~yd502@180.168.212.6) (Read error: Connection reset by peer) |
| 2021-06-04 09:03:20 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 2021-06-04 09:03:40 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds) |
| 2021-06-04 09:04:22 | <jumper149> | Hi, whats the difference between STM from GHC.Conc and from Control.Concurrent.STM |
| 2021-06-04 09:04:23 | × | dpl_ quits (~dpl@77-121-78-163.chn.volia.net) (Remote host closed the connection) |
| 2021-06-04 09:04:41 | → | dpl_ joins (~dpl@77-121-78-163.chn.volia.net) |
| 2021-06-04 09:04:51 | <c_wraith> | nothing |
| 2021-06-04 09:05:29 | <c_wraith> | GHC.Conc is where the actual implementation is located. Control.Concurrent.STM is the interface to it that isn't specific to GHC. |
| 2021-06-04 09:07:14 | <c_wraith> | But the actual types exported are the same. You can import STM from either and they will work together |
| 2021-06-04 09:10:57 | → | Torro joins (Torro@gateway/vpn/protonvpn/torro) |
| 2021-06-04 09:11:38 | → | ddellaco_ joins (~ddellacos@86.106.121.73) |
| 2021-06-04 09:16:47 | × | ddellaco_ quits (~ddellacos@86.106.121.73) (Ping timeout: 272 seconds) |
| 2021-06-04 09:18:28 | × | bor0 quits (~boro@user/bor0) (Quit: Leaving) |
| 2021-06-04 09:19:09 | → | wonko joins (~wjc@62.115.229.50) |
| 2021-06-04 09:19:25 | → | yd502__ joins (~yd502@180.168.212.6) |
| 2021-06-04 09:21:08 | × | ixlun- quits (~matthew@109.249.184.235) (Read error: Connection reset by peer) |
| 2021-06-04 09:21:08 | × | ixlun quits (~matthew@109.249.184.235) (Read error: Connection reset by peer) |
| 2021-06-04 09:22:55 | × | yd502_ quits (~yd502@180.168.212.6) (Ping timeout: 272 seconds) |
| 2021-06-04 09:24:18 | × | Sose quits (~username@mobile-access-6df04b-135.dhcp.inet.fi) (Ping timeout: 264 seconds) |
| 2021-06-04 09:27:47 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:3547:b6d4:7412:5857) (Remote host closed the connection) |
| 2021-06-04 09:30:40 | → | ddellaco_ joins (~ddellacos@86.106.121.31) |
| 2021-06-04 09:35:20 | × | ddellaco_ quits (~ddellacos@86.106.121.31) (Ping timeout: 252 seconds) |
| 2021-06-04 09:35:26 | × | marinelli quits (~marinelli@gateway/tor-sasl/marinelli) (Quit: marinelli) |
| 2021-06-04 09:37:33 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:2819:e0f3:7100:f98e) |
| 2021-06-04 09:38:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-04 09:41:56 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:2819:e0f3:7100:f98e) (Ping timeout: 252 seconds) |
All times are in UTC.