Logs: freenode/#haskell
| 2021-03-03 07:15:43 | <siraben> | however I still have a monoid constraint on the state |
| 2021-03-03 07:15:48 | <siraben> | instance Monoid s => Monad (State s) |
| 2021-03-03 07:15:52 | <koz_> | Hmmm, I wonder why. |
| 2021-03-03 07:15:54 | × | ddellacosta quits (~ddellacos@86.106.143.201) (Ping timeout: 245 seconds) |
| 2021-03-03 07:16:06 | <siraben> | I think it's definitely because of the applicative instance of `(,) s` |
| 2021-03-03 07:16:10 | <siraben> | I have this: |
| 2021-03-03 07:16:11 | <siraben> | `instance (Applicative g, Applicative f, Adjoint f g) => Monad (Compose g f) where` |
| 2021-03-03 07:16:28 | <siraben> | so it chooses the instance for `(,) s` that requires the type to be monoidial |
| 2021-03-03 07:16:44 | <koz_> | > liftA2 (+) ("foo", 1) ("bar", 2) |
| 2021-03-03 07:16:46 | <lambdabot> | ("foobar",3) |
| 2021-03-03 07:16:48 | <siraben> | I should just make another pair type and have it always choose the right elem or something |
| 2021-03-03 07:16:50 | <koz_> | Yup. |
| 2021-03-03 07:17:07 | <koz_> | So you do get a Monad, just not the one you expected. |
| 2021-03-03 07:17:53 | <edwardk> | siraben: the problem is there are several ways to compose a functor and a monad to make a monad, and they don't all lead to the two pieces being compatible applicatives, and to the result being compatible with the applicative for Compose f g |
| 2021-03-03 07:18:08 | <koz_> | edwardk: Does this make a lawful Monad? |
| 2021-03-03 07:18:11 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 07:18:12 | <koz_> | (as in, this specific case) |
| 2021-03-03 07:18:54 | <edwardk> | iirc not unless you change the Applicative of (Compose g f) |
| 2021-03-03 07:19:26 | × | nineonine quits (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) (Ping timeout: 240 seconds) |
| 2021-03-03 07:19:57 | <edwardk> | in general you don't want both part of the Compose to be Applicative |
| 2021-03-03 07:19:57 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-03 07:20:05 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 07:20:57 | <edwardk> | http://web.cecs.pdx.edu/~mpj/pubs/RR-1004.pdf is a nice paper (from 1993!) where Mark P Jones of hugs fame and Luc Duponcheel go through a few ways to compose pointed functors with monads to get a monad. |
| 2021-03-03 07:21:03 | → | graf_blutwurst joins (~user@2001:171b:226e:adc0:cc81:8132:7f95:7a39) |
| 2021-03-03 07:21:10 | <edwardk> | this is sort of a precursor to the monad transformer work we got in the end |
| 2021-03-03 07:23:31 | → | toorevitimirp joins (~tooreviti@117.182.182.60) |
| 2021-03-03 07:25:12 | <mananamenos> | hi, in ghci repl I input `1` or `Nothing` and get this warning *<interactive>:10:1: warning: [-Wtype-defaults]..*. I tried to do `:set -Wtype-defaults` and it hasn't help. The warning still pops up everytime before printing the defaulted type value |
| 2021-03-03 07:25:29 | <koz_> | mananamenos: It's because both '1' and 'Nothing' can range in type. |
| 2021-03-03 07:25:31 | <koz_> | :t 1 |
| 2021-03-03 07:25:33 | <lambdabot> | Num p => p |
| 2021-03-03 07:25:39 | <koz_> | So we dunno what p you want. |
| 2021-03-03 07:25:42 | <koz_> | Likewise. |
| 2021-03-03 07:25:44 | <koz_> | :t Nothing |
| 2021-03-03 07:25:46 | <lambdabot> | Maybe a |
| 2021-03-03 07:25:51 | <koz_> | So we dunno what 'a' you want. |
| 2021-03-03 07:26:02 | <koz_> | Normally this would come from context. |
| 2021-03-03 07:26:05 | <koz_> | Here you have none. |
| 2021-03-03 07:26:10 | <koz_> | So this is why you get that warning. |
| 2021-03-03 07:26:18 | <koz_> | As opposed to, say |
| 2021-03-03 07:26:21 | <koz_> | :t 1 :: Float |
| 2021-03-03 07:26:23 | <lambdabot> | Float |
| 2021-03-03 07:26:25 | <koz_> | Or |
| 2021-03-03 07:26:30 | <koz_> | :t Nothing :: Maybe Bool |
| 2021-03-03 07:26:32 | <lambdabot> | Maybe Bool |
| 2021-03-03 07:26:48 | <koz_> | I have to specify signatures here because there's no context to inform me. |
| 2021-03-03 07:26:49 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-03 07:26:55 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Remote host closed the connection) |
| 2021-03-03 07:26:59 | <mananamenos> | koz_, oh right, with Maybe case im wrong, but with 1 i thought that with that :set something-default i can force the ghci to default to Int or whatever that :set something-default decides |
| 2021-03-03 07:27:10 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 07:27:10 | <koz_> | It already does this anyway. |
| 2021-03-03 07:27:29 | <koz_> | I _believe_ the default for whole-number literals is Integer? |
| 2021-03-03 07:27:44 | <koz_> | But I'd say this is not a behaviour you should rely on. |
| 2021-03-03 07:27:58 | <mananamenos> | yes, id does but first printing that 5 lines warning :) which is why im asking if it's posible to remove it at least for the ghci session time |
| 2021-03-03 07:28:22 | × | cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Read error: Connection reset by peer) |
| 2021-03-03 07:28:23 | <koz_> | You wanna do -Wno-type-defaults |
| 2021-03-03 07:28:26 | × | neiluj quits (~jco@unaffiliated/neiluj) (Remote host closed the connection) |
| 2021-03-03 07:28:34 | <koz_> | For -Wfoo, you turn it off with -Wno-foo |
| 2021-03-03 07:29:10 | <koz_> | . o O (so if we had -Wno-do-this-thing, to turn it off would be -Wno-no-do-this-thing?) |
| 2021-03-03 07:30:05 | → | neiluj joins (~jco@91-167-203-101.subs.proxad.net) |
| 2021-03-03 07:30:10 | × | neiluj quits (~jco@91-167-203-101.subs.proxad.net) (Changing host) |
| 2021-03-03 07:30:10 | → | neiluj joins (~jco@unaffiliated/neiluj) |
| 2021-03-03 07:30:54 | → | dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) |
| 2021-03-03 07:31:04 | <mananamenos> | koz_, thank you! |
| 2021-03-03 07:31:11 | <koz_> | mananamenos: No worries. |
| 2021-03-03 07:33:12 | → | kenran joins (~kenran@b2b-37-24-119-190.unitymedia.biz) |
| 2021-03-03 07:33:48 | → | tsaka__ joins (~torstein@athedsl-258913.home.otenet.gr) |
| 2021-03-03 07:35:21 | × | deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 264 seconds) |
| 2021-03-03 07:36:28 | → | bobiusbillius joins (~bobiusbil@2a00:23c7:9909:5b01:909a:85aa:703a:457c) |
| 2021-03-03 07:37:19 | × | dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 256 seconds) |
| 2021-03-03 07:40:24 | × | Tarutaev quits (~Tarutaev@90.200.185.163) (Ping timeout: 246 seconds) |
| 2021-03-03 07:40:24 | × | emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer) |
| 2021-03-03 07:40:45 | → | emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) |
| 2021-03-03 07:43:45 | × | kam1 quits (~kam1@5.125.82.63) (Ping timeout: 264 seconds) |
| 2021-03-03 07:46:03 | → | dhouthoo joins (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be) |
| 2021-03-03 07:46:19 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 245 seconds) |
| 2021-03-03 07:46:49 | → | Varis joins (~Tadas@unaffiliated/varis) |
| 2021-03-03 07:46:54 | → | chele joins (~chele@ip5b40237d.dynamic.kabel-deutschland.de) |
| 2021-03-03 07:47:22 | → | deviantfero joins (~deviantfe@190.150.27.58) |
| 2021-03-03 07:49:11 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-03-03 07:49:52 | × | graf_blutwurst quits (~user@2001:171b:226e:adc0:cc81:8132:7f95:7a39) (Remote host closed the connection) |
| 2021-03-03 07:49:54 | → | Zivert joins (~Zivert@90.200.185.163) |
| 2021-03-03 07:49:56 | × | tsaka__ quits (~torstein@athedsl-258913.home.otenet.gr) (Ping timeout: 265 seconds) |
| 2021-03-03 07:50:11 | → | graf_blutwurst joins (~user@adsl-178-38-234-220.adslplus.ch) |
| 2021-03-03 07:50:25 | → | Aquazi joins (uid312403@gateway/web/irccloud.com/x-tgakpwzpocvqwkje) |
| 2021-03-03 07:51:43 | × | deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 245 seconds) |
| 2021-03-03 07:52:50 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-03-03 07:52:51 | → | nineonine joins (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) |
| 2021-03-03 07:53:49 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 245 seconds) |
| 2021-03-03 07:54:38 | × | nineonine quits (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) (Remote host closed the connection) |
| 2021-03-03 07:55:33 | → | coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) |
| 2021-03-03 07:55:40 | → | nineonine joins (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) |
| 2021-03-03 07:56:11 | × | mananamenos quits (~mananamen@193.red-88-11-66.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 2021-03-03 07:56:38 | → | mananamenos joins (~mananamen@193.red-88-11-66.dynamicip.rima-tde.net) |
| 2021-03-03 07:57:34 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 245 seconds) |
| 2021-03-03 08:00:04 | × | nineonine quits (~nineonine@2604:3d08:7785:9600:2076:7626:28f5:58b2) (Ping timeout: 258 seconds) |
| 2021-03-03 08:00:06 | × | danso quits (~dan@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Quit: WeeChat 3.0) |
| 2021-03-03 08:02:57 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 264 seconds) |
| 2021-03-03 08:04:13 | × | kjak quits (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 260 seconds) |
| 2021-03-03 08:04:47 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 2021-03-03 08:05:54 | → | kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) |
All times are in UTC.