Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 932 933 934 935 936 937 938 939 940 941 942 .. 5022
502,152 events total
2020-10-29 12:08:57 hackage mmsyn4 0.5.0.0 - The "glue" between electronic tables and GraphViz https://hackage.haskell.org/package/mmsyn4-0.5.0.0 (OleksandrZhabenko)
2020-10-29 12:09:50 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-10-29 12:09:57 hackage mmsyn5 0.5.0.0 - Various additional operations on lists (some with intermediate Monads) https://hackage.haskell.org/package/mmsyn5-0.5.0.0 (OleksandrZhabenko)
2020-10-29 12:10:27 christo joins (~chris@81.96.113.213)
2020-10-29 12:12:09 p8m joins (p8m@gateway/vpn/protonvpn/p8m)
2020-10-29 12:12:46 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
2020-10-29 12:12:56 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
2020-10-29 12:13:05 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-10-29 12:13:06 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
2020-10-29 12:13:06 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
2020-10-29 12:13:06 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-29 12:13:18 christo joins (~chris@81.96.113.213)
2020-10-29 12:13:55 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-olrayksqtbhbbqvo) (Quit: Connection closed for inactivity)
2020-10-29 12:15:17 <thblt> Is it abuse to use the state monad to design a sort of imperative dsl?
2020-10-29 12:15:45 FreeBirdLjj joins (~freebirdl@101.228.42.108)
2020-10-29 12:15:51 <opqdonut> that's what it's meant for
2020-10-29 12:15:59 <thblt> thanks :)
2020-10-29 12:16:45 × kish quits (~oracle@unaffiliated/oracle) (Ping timeout: 240 seconds)
2020-10-29 12:17:01 <dminuoso> Okay, this is starting to confuse me. How could `f :: _` alter type inference?
2020-10-29 12:17:18 Sheilong joins (uid293653@gateway/web/irccloud.com/x-pbjplvzzdhgivsky)
2020-10-29 12:17:41 <dminuoso> If I add a `f :: _`, GHC produces a type error on the call site to f (in addition to the typed hole error), if I remove it, all compiles.
2020-10-29 12:17:42 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-10-29 12:18:15 kish joins (~oracle@unaffiliated/oracle)
2020-10-29 12:18:43 <hpc> and the error says what type f has?
2020-10-29 12:19:32 <dminuoso> hpc: https://gist.github.com/dminuoso/6318be2a36b5428c1ac62def6163aaf9
2020-10-29 12:19:44 <dminuoso> Behind the scenes, that error is implemented as:
2020-10-29 12:19:56 × p8m quits (p8m@gateway/vpn/protonvpn/p8m) (Ping timeout: 268 seconds)
2020-10-29 12:20:17 <dminuoso> instance {-# OVERLAPPABLE #-} TypeError (...) => Is k l where implies _ = error "unreachable"
2020-10-29 12:20:18 × FreeBirdLjj quits (~freebirdl@101.228.42.108) (Ping timeout: 260 seconds)
2020-10-29 12:20:32 <hpc> so, valid programs have all their holes filled
2020-10-29 12:21:13 <hpc> when you don't have f :: _, it infers the type that the error says and it's all fine
2020-10-29 12:21:33 <hpc> when you put the hole there, you're communicating to ghc that you want to write a type signature but don't know what it should be
2020-10-29 12:21:42 <hpc> so it produces an error with what it should be, for you to fill in
2020-10-29 12:22:15 idhugo joins (~idhugo@users-1190.st.net.au.dk)
2020-10-29 12:22:31 nbloomf joins (~nbloomf@2600:1700:ad14:3020:d1d4:d989:c09d:31fa)
2020-10-29 12:22:32 <dminuoso> hpc: except, the inferred type is less polymorphic
2020-10-29 12:22:47 <dminuoso> Roughly, what I'd expect is:
2020-10-29 12:23:04 <dminuoso> attrDefThru :: forall k is. (Is k A_Setter) => Optic' k is DictFile AttrMap -> Parser ()
2020-10-29 12:23:29 nschoe joins (~quassel@2a01:e0a:3c4:c7b0:c945:6e87:b509:d89a)
2020-10-29 12:23:33 alp_ joins (~alp@2a01:e0a:58b:4920:a87d:80a:3e2c:6a69)
2020-10-29 12:23:36 <dminuoso> But adding a typed hole gives me a *much* less polymorphic type:
2020-10-29 12:23:50 <lortabac> it looks like a bug or at least an implementation wart
2020-10-29 12:23:52 <dminuoso> attrDefThru :: Optic A_Lens js ... -> ...
2020-10-29 12:23:55 Jonkimi727406120 joins (~Jonkimi@223.213.166.96)
2020-10-29 12:24:02 <dminuoso> See how it monomorphized on the lens type k?
2020-10-29 12:24:07 <hpc> ah
2020-10-29 12:24:38 × dhil quits (~dhil@195.213.192.122) (Ping timeout: 264 seconds)
2020-10-29 12:24:41 <hpc> does it still work if you add that type signature in place of the hole?
2020-10-29 12:25:04 <dminuoso> Amusingly *no*
2020-10-29 12:25:08 <dminuoso> It errors out with yet another type error
2020-10-29 12:25:15 <dminuoso> Im completely baffled here
2020-10-29 12:25:31 <dminuoso> no type signature, it compiles. adding the correct type signature, I get overlapping instance errors
2020-10-29 12:25:39 fendor joins (~fendor@178.165.128.1.wireless.dyn.drei.com)
2020-10-29 12:25:45 <dminuoso> adding a typed hole I get an incorrect instance selection triggering the diagnostic
2020-10-29 12:26:34 <dminuoso> My first instinct was this was some weird interaction with MMR, but I disabled that too
2020-10-29 12:26:39 <hpc> with no type signature, what does :t tell you?
2020-10-29 12:26:50 × akad_ quits (~akad@109107030050.radomsko.vectranet.pl) (Ping timeout: 256 seconds)
2020-10-29 12:27:29 brisbin joins (~patrick@pool-173-49-158-4.phlapa.fios.verizon.net)
2020-10-29 12:27:57 × kish quits (~oracle@unaffiliated/oracle) (Ping timeout: 268 seconds)
2020-10-29 12:28:28 × Jonkimi727406120 quits (~Jonkimi@223.213.166.96) (Ping timeout: 260 seconds)
2020-10-29 12:30:28 xerox_ joins (~xerox@unaffiliated/xerox)
2020-10-29 12:30:45 <dminuoso> attrDefThru :: (Is (Join A_Lens l) A_Setter, Is l (Join A_Lens l), Is A_Lens (Join A_Lens l)) => Optic' l js DictF\ile AttrMap -> Parser ()
2020-10-29 12:30:50 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Remote host closed the connection)
2020-10-29 12:30:56 <dminuoso> (I did some manual cleanup)
2020-10-29 12:32:26 × mirrorbird quits (~psutcliff@2a00:801:42b:7891:16b1:e53f:55b2:15e1) (Ping timeout: 264 seconds)
2020-10-29 12:33:37 <hpc> there's something in the definition of attrDefThru that's making it too specific for the type you want, i suspect
2020-10-29 12:34:10 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-10-29 12:34:19 <dminuoso> Yeah I suppose
2020-10-29 12:34:21 <dminuoso> (%) :: (Is k m, Is l m, m ~ Join k l, ks ~ Append is js) => Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b infixl 9
2020-10-29 12:34:27 <dminuoso> It's time to start chasing tyfams now..
2020-10-29 12:34:27 <hpc> that, or something else that's definitely beyond me :P
2020-10-29 12:34:36 <dminuoso> Well Im dead sure it's that one
2020-10-29 12:34:44 <dminuoso> (Based on how I triggered all of this)
2020-10-29 12:35:07 <dminuoso> Im starting to think this could be an optics bug
2020-10-29 12:35:27 <hpc> since you're certain on the type of attrDefThru, you can leave the type signature you want and use value-level holes
2020-10-29 12:35:27 <dminuoso> The reason is
2020-10-29 12:35:32 <dminuoso> mmm
2020-10-29 12:37:05 <dminuoso> hpc: Ahhh!
2020-10-29 12:37:10 <dminuoso> I understand what's going on.
2020-10-29 12:37:22 dhil joins (~dhil@openvpn-125-1027.inf.ed.ac.uk)
2020-10-29 12:37:46 × GyroW quits (~GyroW@unaffiliated/gyrow) (Remote host closed the connection)
2020-10-29 12:37:51 <hpc> that makes one of us :D
2020-10-29 12:38:06 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
2020-10-29 12:38:06 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
2020-10-29 12:38:06 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-29 12:38:22 <dminuoso> The above type signature is right.
2020-10-29 12:38:25 p8m joins (p8m@gateway/vpn/protonvpn/p8m)
2020-10-29 12:38:43 <dminuoso> (Which still leaves that GHC thwart of typed holes not doing the right thing)
2020-10-29 12:40:31 geekosaur joins (ac3a3eac@172.58.62.172)
2020-10-29 12:41:04 × motherfsck quits (~motherfsc@unaffiliated/motherfsck) (Read error: Connection reset by peer)
2020-10-29 12:41:40 motherfsck joins (~motherfsc@unaffiliated/motherfsck)
2020-10-29 12:42:01 <dminuoso> hpc: Hah indeed! I expected the subtyping in optics to play well with type inference.
2020-10-29 12:42:10 <dminuoso> Seems I was wrong and I need to manually cast them
2020-10-29 12:42:45 × machinedgod quits (~machinedg@142.169.78.88) (Ping timeout: 268 seconds)
2020-10-29 12:42:57 hackage mmsyn6ukr 0.8.3.0 - A musical instrument synthesizer or a tool for Ukrainian language listening https://hackage.haskell.org/package/mmsyn6ukr-0.8.3.0 (OleksandrZhabenko)
2020-10-29 12:43:51 ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net)
2020-10-29 12:43:58 <hpc> nice
2020-10-29 12:47:48 mirrorbird joins (~psutcliff@2a00:801:42b:7891:16b1:e53f:55b2:15e1)
2020-10-29 12:48:38 × cfricke quits (~cfricke@unaffiliated/cfricke) (Ping timeout: 264 seconds)
2020-10-29 12:48:55 × alp_ quits (~alp@2a01:e0a:58b:4920:a87d:80a:3e2c:6a69) (Ping timeout: 268 seconds)

All times are in UTC.