Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-18 19:24:53 <mastarija> if I do something like this:
2020-11-18 19:25:15 <mastarija> instance ( Selector s , EncOpaque' v ) => EncOpaque' ( S1 s v ) where
2020-11-18 19:25:47 <mastarija> then i can't match instance to specific case where s is 'MetaSel ( 'Just f ) x y z
2020-11-18 19:25:58 <jle`> i would recommend trying to avoid overlappable instances if possible
2020-11-18 19:26:10 <jle`> but in your case it looks like you just need a Selector ('MetaSel ('Just f) x y z) constraint
2020-11-18 19:26:23 kritzefitz joins (~kritzefit@212.86.56.80)
2020-11-18 19:26:28 <mastarija> oh
2020-11-18 19:26:31 <mastarija> I'm an idiot
2020-11-18 19:26:50 <mastarija> I was trying things like ( Selector s , s ~ ( 'MetaSel ( 'Just f ) x y z ) , EncOpaque' v )
2020-11-18 19:26:51 <glguy> You could avoid the overlap by expanding the other instance to match on Nothing
2020-11-18 19:27:01 acidjnk_new joins (~acidjnk@p200300d0c719ff57608036dc958592ad.dip0.t-ipconnect.de)
2020-11-18 19:27:05 <jle`> yeah, or enumerate whatever you would want to exclude
2020-11-18 19:27:24 <mastarija> glguy, yes that was the next step but I had a brain freeze on this problem
2020-11-18 19:27:30 <mastarija> thanks
2020-11-18 19:27:36 Jonno_FTW joins (~come@api.carswap.me)
2020-11-18 19:28:03 <jle`> np :)
2020-11-18 19:28:19 <jle`> hm, why is there no type family to compare Type's :'(
2020-11-18 19:28:24 <jle`> there is an Ord instance for TypeRep
2020-11-18 19:28:27 <jle`> so it should be possible
2020-11-18 19:29:30 hackage bank-holidays-england 0.2.0.6 - Calculation of bank holidays in England and Wales https://hackage.haskell.org/package/bank-holidays-england-0.2.0.6 (dten)
2020-11-18 19:30:01 × Lycurgus quits (~niemand@cpe-45-46-142-188.buffalo.res.rr.com) (Quit: Exeunt)
2020-11-18 19:30:07 × Yumasi quits (~guillaume@2a01cb09b06b29ea21daa97718c35c9f.ipv6.abo.wanadoo.fr) (Ping timeout: 272 seconds)
2020-11-18 19:30:13 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
2020-11-18 19:31:12 justan0theruser joins (~justanoth@unaffiliated/justanotheruser)
2020-11-18 19:31:39 <mastarija> jle`, quick question, with your suggested solution I'm getting a simplifiable constraint warning
2020-11-18 19:32:23 <jle`> what's the warning?
2020-11-18 19:32:30 <mastarija> The constraint `Selector ('MetaSel ('Just f) x y z)' matches instance (SingI mn, SingI su, SingI ss, SingI ds) => Selector ('MetaSel mn su ss ds
2020-11-18 19:32:54 <mastarija> jle`, SingI is not exported from Generics module so I can't use it
2020-11-18 19:33:04 <jle`> hm, that's interseting. i guess it's saying that you can use those constraints instead of Selector
2020-11-18 19:33:08 <jle`> is it from the singletons library, maybe?
2020-11-18 19:33:17 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 272 seconds)
2020-11-18 19:33:22 <mastarija> No, I think it's something ad hoc from Generics module
2020-11-18 19:33:47 <mastarija> I also thought it's from singletons, but generics defines its own SingI class
2020-11-18 19:33:49 <jle`> whoops
2020-11-18 19:33:57 <jle`> then yeah, you can't really do anything about that
2020-11-18 19:34:02 <jle`> that i know of
2020-11-18 19:34:05 <mastarija> :D
2020-11-18 19:34:12 <mastarija> thanks anyway
2020-11-18 19:34:31 <jle`> np D:
2020-11-18 19:36:42 <glguy> mastarija: just merge the two instances into one
2020-11-18 19:36:43 <mastarija> jle`, when I enable GADTs (and MonoLocalBinds) the warning goes away
2020-11-18 19:36:46 st8less joins (~st8less@2603:a060:11fd:0:9539:fd10:c1ca:1d78)
2020-11-18 19:36:52 <jle`> oh nice
2020-11-18 19:37:09 <glguy> Check if selName is "" and branch on that
2020-11-18 19:37:57 <mastarija> glguy, I was thinking about it, but it kind of seemed messy and I'd had to do a lot of extra work in other instances
2020-11-18 19:38:03 <mastarija> Dunno, will think about it
2020-11-18 19:38:10 × invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 246 seconds)
2020-11-18 19:38:40 hidedagger joins (~nate@unaffiliated/hidedagger)
2020-11-18 19:38:57 texasmynsted joins (~texasmyns@212.102.45.121)
2020-11-18 19:39:13 codecaveman joins (58deaa27@88.222.170.39)
2020-11-18 19:40:05 × hidedagger quits (~nate@unaffiliated/hidedagger) (Client Quit)
2020-11-18 19:40:15 × alp quits (~alp@2a01:e0a:58b:4920:61ca:7518:9e8a:5ce1) (Ping timeout: 272 seconds)
2020-11-18 19:40:46 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2020-11-18 19:41:20 × cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: cosimone)
2020-11-18 19:42:06 borne joins (~fritjof@200116b864880600f1dc39039d201adf.dip.versatel-1u1.de)
2020-11-18 19:42:25 conal_ joins (~conal@64.71.133.70)
2020-11-18 19:42:46 jakob_ joins (~textual@p200300f49f162200756a589588d5c172.dip0.t-ipconnect.de)
2020-11-18 19:44:37 <gehmehgeh> Am I correct in that Data.Map doesn't have a function to see whether or not a Data.Map is empty? Meaning, you *have* to compare with an empty Data.Map?
2020-11-18 19:44:46 <merijn> It does
2020-11-18 19:44:55 <gehmehgeh> ah?
2020-11-18 19:44:57 × raichoo quits (~raichoo@dslb-178-001-021-225.178.001.pools.vodafone-ip.de) (Quit: Lost terminal)
2020-11-18 19:44:58 <merijn> Probably "null"?
2020-11-18 19:45:01 <merijn> :t M.null
2020-11-18 19:45:06 <lambdabot> M.Map k a -> Bool
2020-11-18 19:45:08 <gehmehgeh> ah!
2020-11-18 19:45:11 <gehmehgeh> Thank you!
2020-11-18 19:45:18 <gehmehgeh> (Sorry, I was a bit confused)
2020-11-18 19:45:48 <gehmehgeh> I *did* look at https://hackage.haskell.org/package/containers-0.3.0.0/docs/Data-Map.html, but missed it somehow..
2020-11-18 19:45:53 <gehmehgeh> Thanks :)
2020-11-18 19:45:56 <davean> gehmehgeh: Is there something that could have made that more obvious?
2020-11-18 19:45:59 Guest42 joins (56ca6780@gateway/web/cgi-irc/kiwiirc.com/ip.86.202.103.128)
2020-11-18 19:46:01 × conal_ quits (~conal@64.71.133.70) (Client Quit)
2020-11-18 19:46:03 <merijn> gehmehgeh: Note the "module Data.Map.Lazy" line there
2020-11-18 19:46:15 <merijn> gehmehgeh: That indicates a re-export of stuff from Data.Map.Lazy
2020-11-18 19:46:37 <merijn> gehmehgeh: There's some work in haddock to make re-exports more obvious, but it's not done yet, I think?
2020-11-18 19:47:05 <merijn> gehmehgeh: So most of the actualy API of Map is Data.Map.Lazy and Data.Map.Strict
2020-11-18 19:47:12 <gehmehgeh> davean: no, it was my fault. I simply overlooked the word "empty" in one instance of the website. THis normally doesn't happen to me ;)
2020-11-18 19:47:35 kritzefitz_ joins (~kritzefit@212.86.56.80)
2020-11-18 19:47:35 SanchayanMaity joins (~Sanchayan@106.201.35.233)
2020-11-18 19:47:56 <gehmehgeh> It even says: "O(1). Is the map empty?"
2020-11-18 19:48:22 <merijn> gehmehgeh: Comparing with == would be bad, because that doesn't work if your values aren't an instance of Eq :)
2020-11-18 19:48:23 <glguy> davean: naming it isEmpty instead of null could help
2020-11-18 19:48:31 <gehmehgeh> merijn: That's exactly right.
2020-11-18 19:48:38 <gehmehgeh> merijn: This is actually why I asked.
2020-11-18 19:48:55 <merijn> glguy: On the one hand, yes. On the other hand "null" is consistent across a whole bunch of packages and Foldable currently
2020-11-18 19:49:05 × kritzefitz quits (~kritzefit@212.86.56.80) (Ping timeout: 240 seconds)
2020-11-18 19:49:36 <glguy> Yeah, it's a shame we got stuck with that name due to inertia
2020-11-18 19:49:43 × codecaveman quits (58deaa27@88.222.170.39) (Remote host closed the connection)
2020-11-18 19:49:53 <merijn> It's a shame that we're stuck with lots of things due to inertia :)
2020-11-18 19:50:12 <monochrom> One of the rare instances when Scheme is admirable because it allows the name to be "null?"
2020-11-18 19:50:40 <dolio> Yeah, I wish we could put question marks in names.
2020-11-18 19:50:50 <merijn> Braindead specification of Enum, god awful Enum instance for Double, lack of API for safely handling over-/underflow in numerical conversions
2020-11-18 19:51:09 <dminuoso> Given `f :: a -> (Word32 -> P -> b) -> b`, I wanted to move `(Word32 -> P -> b) -> b` into a type alias, but that suddenly requires RankNTypes, is there a different route without demanding that extension everywhere?
2020-11-18 19:51:14 <davean> ∅?
2020-11-18 19:51:16 <merijn> The inability to mix qualified imports and import lists
2020-11-18 19:51:18 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2020-11-18 19:51:40 <merijn> dminuoso: "add a type variable to the alias"?
2020-11-18 19:51:40 × raehik1 quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Read error: Connection reset by peer)
2020-11-18 19:51:45 <dolio> You can mix those, I think.
2020-11-18 19:51:48 mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com)

All times are in UTC.