Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 880 881 882 883 884 885 886 887 888 889 890 .. 5022
502,152 events total
2020-10-26 21:05:15 <dminuoso> Yes
2020-10-26 21:05:24 <dminuoso> they belong together semantically
2020-10-26 21:05:40 <dminuoso> the split was done because Semigroup is a "weaker/stronger" (depending on your perspective) version of Monoid
2020-10-26 21:05:49 <dminuoso> There's thing that have an associative operation, but no identity
2020-10-26 21:05:53 <dminuoso> (Thus they are Semigroup but not Monoid)
2020-10-26 21:06:29 <monsterchrom> for example Integer and max
2020-10-26 21:06:44 justHaunted joins (~justache@unaffiliated/justache)
2020-10-26 21:06:59 <noname234234> there's no mappend anymore in `monoid`?
2020-10-26 21:07:22 <dminuoso> noname234234: Well there is, but it defaults to (<>)
2020-10-26 21:07:28 <Uniaika> noname234234: it's inherited from Semigroup
2020-10-26 21:07:40 <dminuoso> Uniaika: No, its part of Monoid
2020-10-26 21:08:31 <tomsmeding> dminuoso: fascinating read, that issue :p
2020-10-26 21:08:58 <tomsmeding> though you're still using an OVERLAPS pragma, so I'm not yet convinced one can write incoherent code without those pragmas :p
2020-10-26 21:09:05 × danvet_ quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Remote host closed the connection)
2020-10-26 21:09:07 <dminuoso> noname234234: These are unfortunate things, over the years we've had a few breaking changes like that (to make a cleaner language), but resources frequently fail to be updated.
2020-10-26 21:09:19 <dminuoso> tomsmeding: you can easily if you use multiple packages.
2020-10-26 21:09:26 <dminuoso> I have a git repo ready for you...
2020-10-26 21:09:30 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds)
2020-10-26 21:09:37 danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
2020-10-26 21:09:39 <Uniaika> dminuoso: oh, okay
2020-10-26 21:09:45 <noname234234> It's alright It happens to every resource about programming languages. So far this has been the first though one.
2020-10-26 21:09:49 tomsmeding becomes scared
2020-10-26 21:10:40 <monsterchrom> This Halloween, instances overlap to torment you. Spooky resolution at a distance. >:)
2020-10-26 21:11:00 <tomsmeding> ö
2020-10-26 21:11:03 notnatebtw joins (~nate@125.161.130.165)
2020-10-26 21:11:39 <noname234234> so if `semigroup` is superclass of `monoid` why can't I define `mappend` under `monoid?`
2020-10-26 21:11:40 <dminuoso> tomsmeding: hold on, I might need to retract that comment. Ill get back to you tomorrow on this.
2020-10-26 21:11:52 Kolkrabe joins (~user@unaffiliated/siracusa)
2020-10-26 21:12:47 britva joins (~britva@2a02:aa13:7240:2980:b0bb:4de0:a28f:1dc2)
2020-10-26 21:12:50 <tomsmeding> don't sweat, was just curious :p
2020-10-26 21:13:06 <tomsmeding> only if you wanted to do it anyway
2020-10-26 21:13:43 <tomsmeding> noname234234: you can, but to write an instance of Monoid, you also have to provide an instance of Semigroup
2020-10-26 21:14:15 hekkaidekapus_ joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
2020-10-26 21:14:19 <tomsmeding> and then if you do, you can leave out the explicit definition of `mappend`, because it will take the definition of <> by default
2020-10-26 21:14:34 <monsterchrom> Oh, "superclass" doesn't mean implement all methods under one instance declaration.
2020-10-26 21:15:08 <tomsmeding> ah yes, that's a difference with c++/java and friends
2020-10-26 21:15:32 <tomsmeding> (one of the many differences, but this one is relevant here :p)
2020-10-26 21:15:51 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-26 21:15:52 <monsterchrom> Really, "superclass" only means if I write my function type signature "f :: (Semigroup a, Monoid a) => ..." I can omit "Semigroup a".
2020-10-26 21:16:10 <monsterchrom> NO OTHER BENEFIT.
2020-10-26 21:16:32 son0p joins (~son0p@181.136.122.143)
2020-10-26 21:17:12 mirko11 joins (bc6b92b2@dslb-188-107-146-178.188.107.pools.vodafone-ip.de)
2020-10-26 21:17:13 <noname234234> but in the example code works even though no semigroup definition is made
2020-10-26 21:17:23 × hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds)
2020-10-26 21:17:43 <noname234234> https://paste.tomsmeding.com/wUUmo0KG
2020-10-26 21:17:44 <noname234234> this code
2020-10-26 21:17:47 mirko11 parts (bc6b92b2@dslb-188-107-146-178.188.107.pools.vodafone-ip.de) ()
2020-10-26 21:18:10 <aldessa> Is there a monad~thing that keeps track of an rng, logging and a state?
2020-10-26 21:18:22 × damianfral3 quits (~damianfra@174.red-37-13-187.dynamicip.rima-tde.net) (Ping timeout: 272 seconds)
2020-10-26 21:19:24 damianfral3 joins (~damianfra@174.red-37-13-187.dynamicip.rima-tde.net)
2020-10-26 21:19:25 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Ping timeout: 240 seconds)
2020-10-26 21:19:27 × nuncanada quits (~dude@179.235.160.168) (Read error: Connection reset by peer)
2020-10-26 21:19:38 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-26 21:19:41 <monsterchrom> old compiler?
2020-10-26 21:19:51 <monsterchrom> Certainly doesn't "work" for me.
2020-10-26 21:20:43 <noname234234> wait, it doesnt work for me too..
2020-10-26 21:20:49 <noname234234> I think in my laptop I have old compiler
2020-10-26 21:20:53 <noname234234> On PC right now
2020-10-26 21:21:12 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
2020-10-26 21:21:46 <dminuoso> tomsmeding: Anyhow, OVERLAP* pragmas are not the cause behind incoherence.
2020-10-26 21:21:57 <dminuoso> Overlap would either always result int
2020-10-26 21:22:01 <dminuoso> 1) a deterministic instance choice
2020-10-26 21:22:03 <dminuoso> 2) a diagnostic
2020-10-26 21:22:51 conal joins (~conal@2600:380:4427:fc40:197b:568a:a0da:5bcb)
2020-10-26 21:23:10 × justHaunted quits (~justache@unaffiliated/justache) (Remote host closed the connection)
2020-10-26 21:23:18 <tomsmeding> has the real incoherence case got to do with defining functions where only some of the instances are in scope?
2020-10-26 21:23:34 <dminuoso> you mean in the issue?
2020-10-26 21:23:41 <dminuoso> or in case of FlexibleInstances?
2020-10-26 21:23:43 <dsal> aldessa: transformers?
2020-10-26 21:23:48 × damianfral3 quits (~damianfra@174.red-37-13-187.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
2020-10-26 21:24:18 justHaunted joins (~justache@unaffiliated/justache)
2020-10-26 21:24:29 <justsomeguy> Is there an editor feature or plugin that will let me press a key and replace a function with its definition for Haskell code?
2020-10-26 21:24:35 <tomsmeding> FlexibleInstances dminuoso
2020-10-26 21:24:57 <tomsmeding> justsomeguy: how do you imagine that works with something like
2020-10-26 21:24:58 <tomsmeding> @src map
2020-10-26 21:24:58 <lambdabot> map _ [] = []
2020-10-26 21:24:58 <lambdabot> map f (x:xs) = f x : map f xs
2020-10-26 21:25:23 <noname234234> ok I have finally did this example. I was feeling defeated on this one for two days. Thank you guys
2020-10-26 21:25:38 <tomsmeding> noname234234: 🎉
2020-10-26 21:25:47 <dminuoso> tomsmeding: Yes. All incoherent examples rely on not all instances being in scope
2020-10-26 21:25:58 <dminuoso> Otherwise GHC would produce a diagnostic
2020-10-26 21:26:01 <tomsmeding> ah
2020-10-26 21:26:14 <dminuoso> (Unless of course you're tripping into undocumented behavior like in my issue)
2020-10-26 21:26:26 <dminuoso> In which case GHC does something non-obvious instead of erroring out
2020-10-26 21:26:37 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
2020-10-26 21:26:40 × GyroW quits (~GyroW@unaffiliated/gyrow) (Remote host closed the connection)
2020-10-26 21:26:46 <dminuoso> disclaimer: unless IncoherentInstances was enabled of course
2020-10-26 21:26:48 <dminuoso> ;)
2020-10-26 21:26:50 GyroW joins (~GyroW@d54C03E98.access.telenet.be)
2020-10-26 21:26:50 <tomsmeding> do you also need orphans, or can you do it with -Werror=orphans?
2020-10-26 21:26:50 × GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
2020-10-26 21:26:50 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-26 21:27:03 <tomsmeding> sure :p
2020-10-26 21:27:05 <dminuoso> orphans are one way that is actually quite possible
2020-10-26 21:27:10 thblt parts (~thblt@unaffiliated/thblt) ("ERC (IRC client for Emacs 27.1)")
2020-10-26 21:27:12 <dminuoso> even without any other extensions
2020-10-26 21:27:23 <dminuoso> The FlexibleInstances works without orphans
2020-10-26 21:27:25 <tomsmeding> because I know that orphans are dangerous for this reason
2020-10-26 21:27:28 <tomsmeding> ah
2020-10-26 21:27:40 Varis joins (~Tadas@unaffiliated/varis)

All times are in UTC.