Home liberachat/#haskell: Logs Calendar

Logs on 2025-02-11 (liberachat/#haskell)

00:07:21 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
00:10:17 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:13:13 athan joins (~athan@syn-173-042-095-241.biz.spectrum.com)
00:14:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
00:15:03 alfiee joins (~alfiee@user/alfiee)
00:16:54 <lyxia> I somehow need existential newtypes in Haskell... are there any workarounds (or have they been implemented already)?
00:17:47 ljdarj1 joins (~Thunderbi@user/ljdarj)
00:19:06 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 246 seconds)
00:19:58 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 272 seconds)
00:19:58 ljdarj1 is now known as ljdarj
00:21:51 <Leary> lyxia: You can use a smart constructor that secretly `unsafeCoerce`s the hidden type to `Any`, then provide a Rank2 `withFoo` for unwrapping. See `Data.Some.Newtype` for an example in the wild.
00:22:39 × athan quits (~athan@syn-173-042-095-241.biz.spectrum.com) (Quit: Konversation terminated!)
00:25:39 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:27:49 <Leary> There's also a similar trick to give the constructor a constraint, so long as any runtime data can be computed from the argument: https://gist.github.com/LSLeary/ef0f75468938fa6ff505331171bb011c
00:32:26 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
00:35:15 <lyxia> Very cursed, thank you :)
00:43:18 × acidjnk_new3 quits (~acidjnk@p200300d6e7283f999088022741b454a0.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
00:43:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:48:12 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
00:58:39 × hammond quits (proscan@gateway04.insomnia247.nl) (Ping timeout: 246 seconds)
00:59:04 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:02:01 × sprotte24 quits (~sprotte24@p200300d16f01b7005c77723fc43a3702.dip0.t-ipconnect.de) (Quit: Leaving)
01:03:28 alfiee joins (~alfiee@user/alfiee)
01:03:49 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
01:04:53 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
01:07:33 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
01:09:39 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
01:14:00 neto joins (~Netnet@143-208-42-129.users.certto.com.br)
01:14:26 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:19:29 × euouae quits (~euouae@user/euouae) (Remote host closed the connection)
01:19:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
01:19:50 × neto quits (~Netnet@143-208-42-129.users.certto.com.br) (Remote host closed the connection)
01:20:08 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 272 seconds)
01:20:41 hammond joins (proscan@gateway04.insomnia247.nl)
01:24:35 L29Ah joins (~L29Ah@wikipedia/L29Ah)
01:25:23 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds)
01:29:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:34:24 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
01:38:21 <lisbeths> bash_macros(){ while read -r i; do eval "$( printf "%s" "$i" | awk "$1" ; )" ; done ; } ;
01:39:54 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
01:43:56 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds)
01:45:11 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:49:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
01:52:33 alfiee joins (~alfiee@user/alfiee)
01:57:12 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds)
02:00:35 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:07:49 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
02:12:50 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
02:13:33 × robobub quits (uid248673@id-248673.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
02:17:18 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
02:17:45 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
02:18:36 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:23:03 × pikajude quits (~jude@2001:19f0:ac01:373:5400:2ff:fe86:3274) (Quit: ZNC 1.8.2 - https://znc.in)
02:23:06 × pounce quits (~pounce@user/cute/pounce) (Read error: Connection reset by peer)
02:23:13 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
02:23:14 × Vajb quits (~Vajb@n84e9ei03jkqt6rm3ev-1.v6.elisa-mobile.fi) (Ping timeout: 248 seconds)
02:23:19 pounce joins (~pounce@user/cute/pounce)
02:23:23 pikajude joins (~jude@149.28.207.64)
02:23:40 × andreas303 quits (andreas303@is.drunk.and.ready-to.party) (Quit: fBNC - https://bnc4free.com)
02:24:02 × berberman quits (~berberman@user/berberman) (Quit: ZNC 1.8.2 - https://znc.in)
02:24:15 berberman joins (~berberman@user/berberman)
02:24:18 andreas303 joins (andreas303@is.drunk.and.ready-to.party)
02:24:21 × bryanv quits (~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10) (Quit: No Ping reply in 180 seconds.)
02:25:34 bryanv joins (~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10)
02:25:54 × ggVGc quits (~ggVGc@a.lowtech.earth) (Ping timeout: 248 seconds)
02:25:54 × [_________] quits (~oos95GWG@user/oos95GWG) (Ping timeout: 248 seconds)
02:26:46 ggVGc joins (~ggVGc@a.lowtech.earth)
02:26:47 [_________] joins (~oos95GWG@user/oos95GWG)
02:28:21 Axma24393 is now known as Axman6
02:29:36 <haskellbridge> <thirdofmay18081814goya> Where is lens' Fold composition defined?
02:29:41 yegorc parts (~yegorc@user/yegorc) (Leaving)
02:33:58 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:35:10 <c_wraith> a Fold is still a function of shape `(a -> f b) -> s -> f t', so they compose with (.) like every other optic
02:35:46 <c_wraith> The only thing special about a Fold is that they add a Contravariant constraint to f
02:36:49 <c_wraith> which when combined with the Applicative constraint means that you can't use them with any choice of f that would actually contain a t
02:39:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
02:40:39 alfiee joins (~alfiee@user/alfiee)
02:45:14 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds)
02:49:21 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:53:55 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
02:53:56 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 268 seconds)
02:58:16 <haskellbridge> <thirdofmay18081814goya> ah right ok I see, ty!
02:58:41 Square3 joins (~Square@user/square)
02:59:48 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
03:00:14 Square3 is now known as Square
03:01:05 × chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection)
03:01:47 chiselfuse joins (~chiselfus@user/chiselfuse)
03:04:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:09:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
03:20:05 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:21:28 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
03:23:14 vanishingideal joins (~vanishing@user/vanishingideal)
03:24:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
03:28:38 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Remote host closed the connection)
03:30:55 alfiee joins (~alfiee@user/alfiee)
03:33:34 m5zs7k joins (aquares@web10.mydevil.net)
03:35:02 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
03:35:02 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
03:35:28 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:42:12 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
03:43:34 × manwithluck` quits (~manwithlu@2a09:bac1:5be0:20::49:de) (Remote host closed the connection)
03:47:19 hattckory joins (~hattckry@user/hattckory)
03:51:30 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 244 seconds)
03:53:20 vanishingideal joins (~vanishing@user/vanishingideal)
03:53:31 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:53:48 hattckory is now known as attk
03:57:53 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
03:57:54 tavare joins (~tavare@user/tavare)
04:04:17 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:08:52 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:13:37 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
04:18:08 × Googulator28 quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
04:18:23 Googulator28 joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
04:18:58 alfiee joins (~alfiee@user/alfiee)
04:21:52 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:23:26 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
04:24:16 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:28:42 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
04:33:48 × infinity0 quits (~infinity0@pwned.gg) (Ping timeout: 252 seconds)
04:34:03 × attk quits (~hattckry@user/hattckory) (Quit: attk)
04:35:32 × foul_owl quits (~kerry@193.42.0.122) (Ping timeout: 252 seconds)
04:38:09 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds)
04:39:39 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:43:58 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
04:48:10 lol_ joins (~lol@2603:3016:1e01:b9c0:f7:4b70:33ec:27a0)
04:48:17 foul_owl joins (~kerry@193.42.0.122)
04:51:03 × aforemny quits (~aforemny@2001:9e8:6cfe:5000:87c7:acaa:b551:71f7) (Ping timeout: 246 seconds)
04:51:46 aforemny joins (~aforemny@i59F4C4A3.versanet.de)
04:52:39 × jcarpenter2 quits (~lol@2603:3016:1e01:b9c0:41a0:c194:66be:75a1) (Ping timeout: 276 seconds)
04:54:10 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 248 seconds)
04:54:36 infinity0 joins (~infinity0@pwned.gg)
04:55:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:58:53 m5zs7k joins (aquares@web10.mydevil.net)
04:59:16 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:59:29 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:07:22 alfiee joins (~alfiee@user/alfiee)
05:10:25 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:11:44 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
05:14:02 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir)
05:14:24 × mrmr155334346318 quits (~mrmr@user/mrmr) (Ping timeout: 252 seconds)
05:17:05 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:23:54 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Remote host closed the connection)
05:24:33 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 248 seconds)
05:24:41 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
05:26:26 vanishingideal joins (~vanishing@user/vanishingideal)
05:28:28 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:29:21 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
05:32:27 attk joins (~attk@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
05:33:05 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:35:09 <haskellbridge> <thirdofmay18081814goya> does anyone have examples of transformations that are particularly clearly expressed using profunctor optics?
05:35:40 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
05:38:14 × foul_owl quits (~kerry@193.42.0.122) (Ping timeout: 252 seconds)
05:39:13 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
05:43:30 fmira joins (~user@user/fmira)
05:43:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:48:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
05:50:54 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Remote host closed the connection)
05:52:16 Square2 joins (~Square4@user/square)
05:52:42 foul_owl joins (~kerry@174-21-138-88.tukw.qwest.net)
05:53:16 × Square quits (~Square@user/square) (Ping timeout: 252 seconds)
05:55:26 alfiee joins (~alfiee@user/alfiee)
05:57:35 × lunitur quits (~lunitur@86.33.73.151) (Ping timeout: 265 seconds)
05:59:13 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:59:45 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
06:02:56 × hgolden quits (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Remote host closed the connection)
06:03:29 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
06:04:02 hattckory joins (~hattckory@user/hattckory)
06:08:22 hgolden joins (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363)
06:09:18 michalz joins (~michalz@185.246.207.200)
06:13:30 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:16:22 JeremyB99 joins (~JeremyB99@dhcp-251-168.resnet.purdue.edu)
06:16:27 Googulator31 joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
06:17:25 takuan joins (~takuan@d8D86B601.access.telenet.be)
06:17:53 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
06:18:08 × Googulator28 quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
06:18:34 lunitur joins (~lunitur@86.33.95.148)
06:28:04 × hattckory quits (~hattckory@user/hattckory) (Remote host closed the connection)
06:28:19 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
06:28:52 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:29:43 misterfish joins (~misterfis@84.53.85.146)
06:32:52 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
06:33:09 tnt1 joins (~Thunderbi@user/tnt1)
06:33:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
06:33:57 mrmr155334346318 joins (~mrmr@user/mrmr)
06:34:37 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
06:38:33 × mrmr155334346318 quits (~mrmr@user/mrmr) (Read error: Connection reset by peer)
06:38:54 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 244 seconds)
06:39:53 <dminuoso> thirdofmay18081814goya: What do you mean by transformations?
06:40:29 × mange quits (~user@user/mange) (Quit: Quittin' time!)
06:40:55 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:43:11 alfiee joins (~alfiee@user/alfiee)
06:44:53 <haskellbridge> <thirdofmay18081814goya> dminuoso: the applying of a lens and an action to a datatype
06:45:09 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
06:45:17 <dminuoso> They dont differ from van laarhoven or the mixed (van laarhoven + profunctor-style) in that sense.
06:45:25 <dminuoso> Profunctors are an implementation detail here.
06:46:14 <haskellbridge> <thirdofmay18081814goya> we'd expect composition to be easier when using a higher abstraction no?
06:46:29 <haskellbridge> <Bowuigi> thirdofmay18081814goya cleanly wrt VL lenses or in general?
06:47:13 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
06:47:18 <haskellbridge> <thirdofmay18081814goya> Bowuigi: in general
06:47:57 <haskellbridge> <thirdofmay18081814goya> it's not a rigorous question tbh, I'm just looking for personal opinions of instructive usages of the profunctor encoding
06:49:21 <haskellbridge> <Bowuigi> Ah, the nice part of the profunctor encoding is that you have access to the profunctor API. But since arrows are profunctors it doesn't make much of a difference wrt VL lenses
06:49:40 × ft quits (~ft@p4fc2a610.dip0.t-ipconnect.de) (Quit: leaving)
06:51:06 <haskellbridge> <Bowuigi> But switching the underlying profunctor that you use in a combined VL/profunctor optic could help yeah
06:51:53 <haskellbridge> <Bowuigi> Like, to get effectful lenses over Kleisli or something like that
06:52:26 <haskellbridge> <thirdofmay18081814goya> hm I see
06:59:09 <haskellbridge> <Bowuigi> I had a "type Optic p f s t a b = p a (f b) -> p s (f t)" sitting around my projects
06:59:56 <haskellbridge> <Bowuigi> Oddly enough the definition on profunctor-optics is "type Optic p s t a b = p a b -> p s t", which is equivalent
07:04:10 <haskellbridge> <Bowuigi> Namely, "Optic1 p f s t a b = Optic2 (\x y -> p x (f y)) s t a b" and "Optic2 p s t a b = Optic1 p Identity s t a b"
07:06:16 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:06:26 <haskellbridge> <thirdofmay18081814goya> huh I haven't encountered a case where "f" is not the identity functor yet
07:06:30 <haskellbridge> <thirdofmay18081814goya> what did you use it for?
07:08:21 × sabathan quits (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Read error: Connection reset by peer)
07:08:26 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
07:08:27 tnt2 joins (~Thunderbi@user/tnt1)
07:09:19 <haskellbridge> <Bowuigi> It's a bit nicer to write VL lenses with it. For example, the usual Lens (not generalizing over the profunctor) is just "forall f. Functor f => Optic (->) f s t a b"
07:09:36 polykernel_ joins (~polykerne@user/polykernel)
07:10:41 <haskellbridge> <Bowuigi> Similar syntax can be achieved for the rest of the hierarchy using constraints, like how lens does it but with much less type aliases
07:10:42 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:10:44 tnt2 is now known as tnt1
07:11:53 sabathan joins (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr)
07:12:20 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:12:34 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:13:28 × polykernel quits (~polykerne@user/polykernel) (Ping timeout: 265 seconds)
07:13:29 polykernel_ is now known as polykernel
07:14:41 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:15:01 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:15:09 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:15:34 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:17:34 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
07:20:10 × polykernel quits (~polykerne@user/polykernel) (Ping timeout: 252 seconds)
07:21:27 tnt1 joins (~Thunderbi@user/tnt1)
07:21:48 <haskellbridge> <thirdofmay18081814goya> oh cool
07:22:26 <dminuoso> One should say, that VL lenses themselves are an ancient construct that is not used by `lens` either.
07:22:38 <dminuoso> Lens uses an encoding that is a mixture of VL and profunctor.
07:23:10 CiaoSen joins (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922)
07:23:28 <dminuoso> thirdofmay18081814goya: The big advantage of the profunctor encoding is that the implementation becomes completely uniform, there's no weird encodings depending on the type of optic.
07:23:36 <dminuoso> Like `lens` has.
07:26:06 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:26:21 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:27:00 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:27:16 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:28:47 akegalj joins (~akegalj@78-3-100-82.adsl.net.t-com.hr)
07:30:40 <energizer> am i missing anything relevant? https://bpa.st/CF7A
07:30:53 alfiee joins (~alfiee@user/alfiee)
07:31:47 <haskellbridge> <thirdofmay18081814goya> dminuoso: ah that's nice
07:35:13 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
07:35:26 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:35:40 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:36:05 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:36:28 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:36:48 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:36:58 × CiaoSen quits (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922) (Ping timeout: 272 seconds)
07:37:02 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:38:35 CiaoSen joins (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922)
07:40:06 sawilagar joins (~sawilagar@user/sawilagar)
07:44:49 × CiaoSen quits (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922) (Ping timeout: 248 seconds)
07:47:09 CiaoSen joins (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de)
07:52:35 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
07:55:54 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:57:03 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 245 seconds)
07:58:00 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
07:58:34 × dtman34 quits (~dtman34@c-75-72-179-251.hsd1.mn.comcast.net) (Ping timeout: 268 seconds)
07:58:45 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
07:58:48 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
07:58:53 sord937 joins (~sord937@gateway/tor-sasl/sord937)
07:58:59 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:00:01 × caconym quits (~caconym@user/caconym) (Quit: bye)
08:00:33 dtman34 joins (~dtman34@2601:447:d000:1f5e:74c2:4ec:de8d:13d3)
08:00:40 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
08:00:50 caconym joins (~caconym@user/caconym)
08:00:51 <ski> energizer : occasionally `(<*>>) :: f (a -> f b) -> f a -> f b' is useful (`frob <$> foo <*> bar <*> baz <*>> quux')
08:02:07 <energizer> ski: i don't see that on hoogle. is that a recognized thing?
08:02:21 <ski> custom think i define, at times
08:03:38 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 244 seconds)
08:04:21 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:04:21 <ski> imagine (with `Monad f') `frob :: a -> b -> c -> d -> f e', `foo :: f a', `bar :: f b', `baz :: f c', `quux :: f d', and then `frob <$> foo <*> bar <*> baz <*>> quux :: f e'
08:04:35 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:04:59 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:05:07 <ski> allows you to use the idiomatic/applicative combinators with an occasional monadic `join' effect
08:05:13 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:06:51 <energizer> interesting
08:06:54 <dminuoso> thirdofmay18081814goya: For instance, consider type IndexedFold i s a = forall p f. (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> s -> f s
08:07:02 <ski> @hoogle (a -> f b) -> f (a -> b)
08:07:02 <lambdabot> No results found
08:08:15 <ski> energizer : because it can get annoying, cluttered, to have to write `join (frob <$> foo <*> bar <*> baz <*> quux)'
08:08:17 <haskellbridge> <thirdofmay18081814goya> dminuoso: any chance you know of an example?
08:08:33 <dminuoso> Just gave you one.
08:08:47 <haskellbridge> <thirdofmay18081814goya> I meant a particular action on it
08:10:05 <ski> (that `(a -> f b) -> f (a -> b)' would be kinda opposite of `(??) :: f (a -> b) -> a -> f b'. would only work for quite special `f's)
08:10:14 <haskellbridge> <thirdofmay18081814goya> dminuoso: but yeah you're right, that is a simpler type than some of the other ones
08:14:28 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
08:14:52 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:15:06 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:15:13 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:16:02 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:16:42 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:16:59 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:18:17 JuanDaugherty joins (~juan@user/JuanDaugherty)
08:19:15 merijn joins (~merijn@77.242.116.146)
08:20:31 alfiee joins (~alfiee@user/alfiee)
08:21:34 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:21:48 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:22:16 × gmg quits (~user@user/gehmehgeh) (Quit: Leaving)
08:24:49 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
08:25:56 gmg joins (~user@user/gehmehgeh)
08:28:50 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:29:06 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
08:29:07 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:30:36 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
08:30:51 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
08:39:53 × Googulator31 quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
08:40:03 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
08:42:45 × talismanick quits (~user@2601:644:937c:ed10::ae5) (Ping timeout: 276 seconds)
08:43:24 merijn joins (~merijn@77.242.116.146)
08:44:51 × dtman34 quits (~dtman34@2601:447:d000:1f5e:74c2:4ec:de8d:13d3) (Ping timeout: 246 seconds)
08:45:23 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:48:31 × mulk quits (~mulk@pd95141d7.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
08:48:58 mulk joins (~mulk@p5b2dc995.dip0.t-ipconnect.de)
08:52:03 acidjnk_new3 joins (~acidjnk@p200300d6e7283f949088022741b454a0.dip0.t-ipconnect.de)
08:56:15 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
08:59:55 chele joins (~chele@user/chele)
09:00:33 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
09:07:16 alfiee joins (~alfiee@user/alfiee)
09:10:07 × tnt1 quits (~Thunderbi@user/tnt1) (Read error: Connection reset by peer)
09:11:38 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
09:13:06 tabaqui1 joins (~root@87.200.129.102)
09:17:11 lxsameer joins (~lxsameer@Serene/lxsameer)
09:24:29 × divya quits (divya@140.238.251.170) (Remote host closed the connection)
09:24:52 tnt1 joins (~Thunderbi@user/tnt1)
09:25:27 dysfigured joins (~dfg@dfg.rocks)
09:26:24 × dfg quits (~dfg@user/dfg) (Ping timeout: 252 seconds)
09:27:18 divya joins (divya@140.238.251.170)
09:28:58 tnt2 joins (~Thunderbi@user/tnt1)
09:29:34 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
09:29:36 <mniip> ski, nowadays I recognize it as more of a crutch for not having proper idiom brackets :P
09:31:47 <ski> yea .. this got me thinking (again) on my ideas for something better than idiom brackets
09:32:20 tnt1 joins (~Thunderbi@user/tnt1)
09:32:55 <ski> (why i was thinking about `(a -> f b) -> f (a -> b)')
09:33:32 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 268 seconds)
09:33:39 × tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
09:35:08 vanishingideal joins (~vanishing@user/vanishingideal)
09:35:58 <ski> iirc, `forall a b. (a,f b) -> f (a,b)', alternatively `forall a b. f (a -> b) -> (a -> f b)', are sometimes known as "strength". i'm wondering whether there's a traditional name for `forall a b. (a -> f b) -> f (a -> b)', and what reasonable laws would be
09:36:56 × lunitur quits (~lunitur@86.33.95.148) (Ping timeout: 252 seconds)
09:39:54 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 260 seconds)
09:40:32 tnt2 joins (~Thunderbi@user/tnt1)
09:41:06 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds)
09:43:59 tnt1 joins (~Thunderbi@user/tnt1)
09:45:22 × tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds)
09:45:37 otbergsten joins (~otbergste@user/otbergsten)
09:46:10 <mniip> ski, have you seen what lean has in store?
09:46:45 <mniip> do <- frob (<- foo) (<- bar) (<- baz) (<- quux)
09:47:14 merijn joins (~merijn@77.242.116.146)
09:48:26 <ski> hm, not that i recall atm
09:51:13 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
09:55:41 <ski> mhm, seems to be documented at <https://lean-lang.org/doc/reference/latest/Functors___-Monads-and--do--Notation/Syntax/#do-notation>
09:56:00 alfiee joins (~alfiee@user/alfiee)
09:57:41 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
10:00:24 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
10:02:14 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
10:03:19 × JamesMowery quits (~JamesMowe@ip68-228-212-232.ph.ph.cox.net) (Ping timeout: 252 seconds)
10:04:28 <mauke> :t \x -> fmap ($ x)
10:04:29 <lambdabot> Functor f => a -> f (a -> b) -> f b
10:06:08 <ski> yes
10:11:28 × CiaoSen quits (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 244 seconds)
10:14:37 <mauke> hmm, flipping arrows but not products to sums
10:21:59 × aniketd quits (32aa4844cd@2a03:6000:1812:100::dcb) (Remote host closed the connection)
10:21:59 × shreyasminocha quits (51fdc93eda@user/shreyasminocha) (Remote host closed the connection)
10:21:59 × cpli quits (77fc530071@2a03:6000:1812:100::252) (Remote host closed the connection)
10:21:59 × duncan quits (c6181279e3@user/meow/duncan) (Remote host closed the connection)
10:21:59 × bheesham quits (3aa22d8375@2a03:6000:1812:100::e40) (Remote host closed the connection)
10:21:59 × jmcantrell quits (644f1bed9a@user/jmcantrell) (Remote host closed the connection)
10:21:59 × whereiseveryone quits (206ba86c98@2a03:6000:1812:100::2e4) (Remote host closed the connection)
10:21:59 × smiesner quits (b0cf5acf8c@user/smiesner) (Remote host closed the connection)
10:21:59 × bsima1 quits (9d7e39c8ad@2a03:6000:1812:100::dd) (Remote host closed the connection)
10:21:59 × fvr quits (ef3e56ca8b@2a03:6000:1812:100::3c4) (Remote host closed the connection)
10:21:59 × jleightcap quits (7bc4014b62@user/jleightcap) (Remote host closed the connection)
10:21:59 × bgtdsword quits (b968c1779f@2a03:6000:1812:100::1460) (Remote host closed the connection)
10:21:59 × arcadewise quits (52968ed80d@2a03:6000:1812:100::3df) (Remote host closed the connection)
10:21:59 × b0o quits (0e4a0bf4c9@2a03:6000:1812:100::1bf) (Remote host closed the connection)
10:21:59 × evanrelf quits (3addc196af@2a03:6000:1812:100::f0) (Remote host closed the connection)
10:21:59 × raghavgururajan quits (ea769b8000@user/raghavgururajan) (Remote host closed the connection)
10:21:59 × thatonelutenist quits (8216c46202@2a03:6000:1812:100::fb3) (Remote host closed the connection)
10:21:59 × sm2n quits (ae95cb1267@user/sm2n) (Remote host closed the connection)
10:21:59 × fgaz quits (1ff9197ed6@2a03:6000:1812:100::11ea) (Remote host closed the connection)
10:21:59 × filwisher quits (2e6936c793@2a03:6000:1812:100::170) (Remote host closed the connection)
10:22:00 × jakzale quits (6291399afa@user/jakzale) (Remote host closed the connection)
10:22:00 × sus quits (1b7af6299f@user/zeromomentum) (Remote host closed the connection)
10:22:00 × Ankhers quits (e99e97ef8e@2a03:6000:1812:100::2a2) (Remote host closed the connection)
10:22:00 × rselim quits (ce261f06ff@user/milesrout) (Remote host closed the connection)
10:22:00 × simendsjo quits (34b0550437@2a03:6000:1812:100::1441) (Remote host closed the connection)
10:22:00 × samhh quits (7569f027cf@2a03:6000:1812:100::e4) (Remote host closed the connection)
10:22:00 × fn_lumi quits (3d621153a5@2a03:6000:1812:100::df7) (Remote host closed the connection)
10:22:00 × probie quits (cc0b34050a@user/probie) (Remote host closed the connection)
10:22:01 × JoelMcCracken quits (5ea8252fbb@2a03:6000:1812:100::10e3) (Remote host closed the connection)
10:22:01 × eso quits (a0662dfd5e@2a03:6000:1812:100::1266) (Remote host closed the connection)
10:22:01 × pmk quits (6afe4476a1@2a03:6000:1812:100::26d) (Remote host closed the connection)
10:22:01 × ymherklotz quits (cb2c9cfbdd@2a03:6000:1812:100::29a) (Remote host closed the connection)
10:22:01 × lane quits (809450f172@2a03:6000:1812:100::1300) (Remote host closed the connection)
10:22:02 × ggb quits (a62ffbaf4f@2a03:6000:1812:100::3ac) (Write error: Broken pipe)
10:22:02 × lucyy quits (228ee8f0ce@user/lucyy) (Remote host closed the connection)
10:22:02 × akspecs quits (00cc8321af@sourcehut/user/akspecs) (Write error: Broken pipe)
10:22:02 × ursa-major quits (114efe6c39@2a03:6000:1812:100::11f3) (Remote host closed the connection)
10:22:02 × jkoshy quits (99b9359beb@user/jkoshy) (Remote host closed the connection)
10:22:02 × chaitlatte0 quits (ea29c0bb16@user/chaitlatte0) (Remote host closed the connection)
10:23:14 × foul_owl quits (~kerry@174-21-138-88.tukw.qwest.net) (Ping timeout: 248 seconds)
10:24:15 × samhh_ quits (7569f027cf@2a03:6000:1812:100::e4) (Ping timeout: 246 seconds)
10:24:27 × RussetParrotBear quits (45ce440a48@2a03:6000:1812:100::e2) (Read error: Connection reset by peer)
10:24:27 × henrytill quits (e0180937c3@2a03:6000:1812:100::e8c) (Read error: Connection reset by peer)
10:24:27 × lukec quits (9dfd4d094e@2a03:6000:1812:100::10e) (Remote host closed the connection)
10:27:15 × nschoe quits (~nschoe@2a01:e0a:8e:a190:c1a:8d45:26a8:2ec3) (Quit: ZNC 1.8.2 - https://znc.in)
10:27:32 nschoe joins (~nschoe@2a01:e0a:8e:a190:e51:40e8:9bc8:8d19)
10:33:21 × Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 268 seconds)
10:33:23 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 252 seconds)
10:33:51 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
10:34:06 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
10:34:53 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
10:36:12 img joins (~img@user/img)
10:36:35 foul_owl joins (~kerry@193.42.0.124)
10:40:41 <ncf> mauke: what is?
10:42:38 Maxdamantus joins (~Maxdamant@user/maxdamantus)
10:43:12 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
10:43:22 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
10:45:38 alfiee joins (~alfiee@user/alfiee)
10:47:23 CiaoSen joins (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922)
10:49:53 × Square2 quits (~Square4@user/square) (Ping timeout: 248 seconds)
10:50:08 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 272 seconds)
10:58:57 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds)
10:58:58 tnt2 joins (~Thunderbi@user/tnt1)
11:04:04 × tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 272 seconds)
11:07:26 tnt1 joins (~Thunderbi@user/tnt1)
11:13:25 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 248 seconds)
11:18:30 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
11:19:57 haritz is now known as saimazoon
11:20:23 vanishingideal joins (~vanishing@user/vanishingideal)
11:21:10 × CiaoSen quits (~Jura@2a02:8071:64e1:7180:4e50:ddff:fe9b:8922) (Ping timeout: 272 seconds)
11:23:05 CiaoSen joins (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de)
11:24:53 <bwe> I've multiple functions `(a, b) -> Maybe c`. How can I chain them, i. e. if first yields Nothing, second is performed on input etc., if none yields a `Just c`, then I manually define a return value.
11:29:37 Akshat joins (~Akshat@2409:40d0:11e1:cd05:62b2:b7f8:bf3f:70d)
11:30:20 merijn joins (~merijn@77.242.116.146)
11:30:28 × Akshat quits (~Akshat@2409:40d0:11e1:cd05:62b2:b7f8:bf3f:70d) (Client Quit)
11:30:39 Akshat joins (~Akshat@2409:40d0:11e1:cd05:62b2:b7f8:bf3f:70d)
11:34:55 alfiee joins (~alfiee@user/alfiee)
11:35:02 ggb joins (a62ffbaf4f@2a03:6000:1812:100::3ac)
11:35:03 filwisher joins (2e6936c793@2a03:6000:1812:100::170)
11:35:03 bsima1 joins (9d7e39c8ad@2a03:6000:1812:100::dd)
11:35:03 pmk joins (6afe4476a1@2a03:6000:1812:100::26d)
11:35:03 fgaz joins (1ff9197ed6@2a03:6000:1812:100::11ea)
11:35:03 lukec joins (9dfd4d094e@2a03:6000:1812:100::10e)
11:35:03 arcadewise joins (52968ed80d@2a03:6000:1812:100::3df)
11:35:04 bgtdsword joins (b968c1779f@2a03:6000:1812:100::1460)
11:35:04 smiesner joins (b0cf5acf8c@user/smiesner)
11:35:04 samhh joins (7569f027cf@2a03:6000:1812:100::e4)
11:35:04 rselim joins (ce261f06ff@user/milesrout)
11:35:04 lane joins (809450f172@2a03:6000:1812:100::1300)
11:35:05 jkoshy joins (99b9359beb@user/jkoshy)
11:35:05 RussetParrotBear joins (45ce440a48@2a03:6000:1812:100::e2)
11:35:05 evanrelf joins (3addc196af@2a03:6000:1812:100::f0)
11:35:05 ymherklotz joins (cb2c9cfbdd@2a03:6000:1812:100::29a)
11:35:06 thatonelutenist joins (8216c46202@2a03:6000:1812:100::fb3)
11:35:06 chaitlatte0 joins (ea29c0bb16@user/chaitlatte0)
11:35:06 cpli joins (77fc530071@2a03:6000:1812:100::252)
11:35:06 akspecs joins (00cc8321af@sourcehut/user/akspecs)
11:35:06 lucyy joins (228ee8f0ce@user/lucyy)
11:35:06 sus joins (1b7af6299f@user/zeromomentum)
11:35:07 fn_lumi joins (3d621153a5@2a03:6000:1812:100::df7)
11:35:07 jmcantrell joins (644f1bed9a@user/jmcantrell)
11:35:08 jakzale joins (6291399afa@user/jakzale)
11:35:08 probie joins (cc0b34050a@user/probie)
11:35:09 samhh_ joins (7569f027cf@2a03:6000:1812:100::e4)
11:35:09 jleightcap joins (7bc4014b62@user/jleightcap)
11:35:09 raghavgururajan joins (ea769b8000@user/raghavgururajan)
11:35:09 JoelMcCracken joins (5ea8252fbb@2a03:6000:1812:100::10e3)
11:35:10 henrytill joins (e0180937c3@2a03:6000:1812:100::e8c)
11:35:10 shreyasminocha joins (51fdc93eda@user/shreyasminocha)
11:35:10 simendsjo joins (34b0550437@2a03:6000:1812:100::1441)
11:35:10 aniketd joins (32aa4844cd@2a03:6000:1812:100::dcb)
11:35:10 sm2n joins (ae95cb1267@user/sm2n)
11:35:10 b0o joins (0e4a0bf4c9@2a03:6000:1812:100::1bf)
11:35:10 whereiseveryone joins (206ba86c98@2a03:6000:1812:100::2e4)
11:35:10 ursa-major joins (114efe6c39@2a03:6000:1812:100::11f3)
11:35:11 eso joins (a0662dfd5e@2a03:6000:1812:100::1266)
11:35:14 duncan joins (c6181279e3@user/meow/duncan)
11:35:14 fvr joins (ef3e56ca8b@2a03:6000:1812:100::3c4)
11:35:14 bheesham joins (3aa22d8375@2a03:6000:1812:100::e40)
11:35:14 Ankhers joins (e99e97ef8e@2a03:6000:1812:100::2a2)
11:37:14 × CiaoSen quits (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 244 seconds)
11:38:05 <ski> > let foo n | even n = Just (n `div` 2) | otherwise = Nothing; bar 1 = Nothing; bar n = Just (3 * n + 1) in intercalate "," [(maybe "stop" show . getFirst) ((First . foo <> First . bar) n) | n <- [1 .. 8] :: [Integer]] -- hrm ..
11:38:06 <lambdabot> "stop,1,10,2,16,3,22,4"
11:38:46 <akegalj> bwe: I would explicitly chain them (\input -> fun1 input <|> fun2 input <|> fun3 input <|> Just 4) (a,b)
11:39:08 <ski> > let foo n | even n = Just (n `div` 2) | otherwise = Nothing; bar 1 = Nothing; bar n = Just (3 * n + 1) in intercalate "," [maybe "stop" show (foo n <|> bar n) | n <- [1 .. 8] :: [Integer]] -- simpler
11:39:10 <lambdabot> "stop,1,10,2,16,3,22,4"
11:39:18 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
11:40:14 × CalimeroTeknik quits (~calimero@user/calimeroteknik) (Ping timeout: 260 seconds)
11:44:49 <haskellbridge> <alexfmpe> bwe: fromMaybe defaultValue $ asum $ fmap ($ input) [fun1, fun2,...]
11:49:30 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
11:52:30 CalimeroTeknik joins (~calimero@ctkarch.org)
11:53:02 × Akshat quits (~Akshat@2409:40d0:11e1:cd05:62b2:b7f8:bf3f:70d) (Quit: Client closed)
11:57:23 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
11:59:33 merijn joins (~merijn@77.242.116.146)
12:00:02 × JeremyB99 quits (~JeremyB99@dhcp-251-168.resnet.purdue.edu) (Remote host closed the connection)
12:00:04 × caconym quits (~caconym@user/caconym) (Quit: bye)
12:00:11 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
12:02:11 caconym joins (~caconym@user/caconym)
12:02:30 × akegalj quits (~akegalj@78-3-100-82.adsl.net.t-com.hr) (Ping timeout: 252 seconds)
12:06:06 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 246 seconds)
12:07:47 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
12:11:20 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
12:12:39 merijn joins (~merijn@77.242.116.146)
12:17:01 × picnoir quits (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Quit: WeeChat 4.5.1)
12:17:13 chele_ joins (~chele@user/chele)
12:17:49 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
12:18:25 picnoir joins (~picnoir@about/aquilenet/vodoo/NinjaTrappeur)
12:18:42 wootehfoot joins (~wootehfoo@user/wootehfoot)
12:19:40 chele__ joins (~chele@user/chele)
12:20:30 × chele quits (~chele@user/chele) (Ping timeout: 276 seconds)
12:22:09 × chele_ quits (~chele@user/chele) (Ping timeout: 248 seconds)
12:22:42 <dminuoso> thirdofmay18081814goya: Roughly, the way you "run" a lens does not differ too wildly between all three variants (VL, mixed and profunctor).
12:24:06 sprotte24 joins (~sprotte24@p200300d16f05dc007daaf3d6dd12202b.dip0.t-ipconnect.de)
12:27:00 jespada joins (~jespada@2800:a4:2211:9c00:4cb1:4c0:c141:d649)
12:27:38 <dminuoso> thirdofmay18081814goya: The cute trick in profunctor representation that all optics are just profunctor transformer functions, so "using" them amounts to just applying them to a particular choice of a profunctor
12:28:02 × tavare quits (~tavare@user/tavare) (Remote host closed the connection)
12:28:12 <dminuoso> Similarly to how in VL representation you pick a particular functor to "use" it
12:28:21 alfiee joins (~alfiee@user/alfiee)
12:28:26 tavare joins (~tavare@user/tavare)
12:29:55 <dminuoso> Compare `type LensP s t a b = forall p. Strong p => Optic p s t a b` with `type LensVL s t a b = forall f . Functor f => (a -> f b) -> s -> f t`
12:30:21 <dminuoso> Where type Optic p s t a b = p a b -> p s t
12:30:22 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
12:30:33 <dminuoso> So `type LensP s t a b = forall p. Strong p => p a b -> p s t`
12:31:12 <dminuoso> If we write `p` in an infix position with a nice operator instead, the similarity becomes more obvious:
12:32:40 <dminuoso> type LensP s t a b = forall (:=>). Strong (:=>) => (a :=> b) -> s :=> t
12:32:46 <dminuoso> type LensVL s t a b = forall f . Functor f => (a -> f b) -> s -> f t
12:32:58 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds)
12:33:19 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
12:34:21 <dminuoso> So a simple way to run a LensP would be to just turn it into a LensVL by just picking :=> ~ UpStar
12:35:01 <dminuoso> In this particular example, the profunctor representation is just vastly more generalized.
12:37:25 <bwe> alexfmpe, akegalj, ski: thanks, I've gone for alexfmpe's approach, solves my requirement.
12:37:57 <dminuoso> `viewL l = runConst . l Const` and `viewP l = getConst . (l (UpStar Const))`
12:38:10 <dminuoso> Oh
12:38:21 <dminuoso> `viewP l = getConst . runUpStar (l (UpStar Const))` of course.
12:40:19 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
12:40:23 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
12:44:37 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
12:51:49 Square2 joins (~Square4@user/square)
12:53:08 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
12:54:46 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
12:55:19 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
12:59:33 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 248 seconds)
13:01:14 Digitteknohippie joins (~user@user/digit)
13:02:28 × Digit quits (~user@user/digit) (Ping timeout: 245 seconds)
13:10:00 akegalj joins (~akegalj@168-206.dsl.iskon.hr)
13:10:43 CiaoSen joins (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de)
13:11:08 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
13:16:25 alfiee joins (~alfiee@user/alfiee)
13:20:35 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
13:25:40 causal joins (~eric@50.35.84.231)
13:29:08 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
13:30:32 merijn joins (~merijn@77.242.116.146)
13:33:27 SlackCoder joins (~SlackCode@64-94-63-8.ip.weststar.net.ky)
13:37:58 × tavare quits (~tavare@user/tavare) (Remote host closed the connection)
13:40:51 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:41:48 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
13:52:01 Digitteknohippie is now known as Digit
13:57:29 × otbergsten quits (~otbergste@user/otbergsten) (Remote host closed the connection)
13:57:59 weary-traveler joins (~user@user/user363627)
14:03:19 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
14:04:49 alfiee joins (~alfiee@user/alfiee)
14:08:00 comerijn joins (~merijn@77.242.116.146)
14:08:01 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
14:09:24 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
14:10:50 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
14:13:06 JuanDaugherty joins (~juan@user/JuanDaugherty)
14:17:49 <kaol> Is there something more powerful than :r in ghci to recompile a different library in the same cabal file as well? Something I could use instead of restarting ghci itself.
14:21:54 <dminuoso> kaol: Given that the whole business of how libraries end up in GHC is usually managed by cabal-install...
14:22:24 <dminuoso> I suppose you could use `ghcid` with a bit of massage
14:22:35 <dminuoso> It really depends on how you intend to detect "different library"
14:22:47 <dminuoso> Or what you want to use GHCi for
14:26:35 <kaol> I really don't care about ghcid.
14:26:59 <kaol> I'm running my tests in a repl and the library part of my code has a bug.
14:27:52 <kaol> And apparently this is some barrier that requires either copying the module to my test directory or restarting ghci all the time.
14:28:28 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
14:29:39 <kaol> I'm calling my test's main in repl.
14:29:53 × CiaoSen quits (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
14:30:16 weary-traveler joins (~user@user/user363627)
14:30:35 × sprotte24 quits (~sprotte24@p200300d16f05dc007daaf3d6dd12202b.dip0.t-ipconnect.de) (Quit: Leaving)
14:31:05 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
14:31:11 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
14:31:43 <kaol> different library as in my cabal file having two stanzas, one for library and another for test-suite.
14:33:47 <kaol> I guess I can do with just removing the library dependency from the test, copying over any missing build-depends and adding both directories to hs-source-dirs.
14:34:54 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:35:23 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
14:38:57 × comerijn quits (~merijn@77.242.116.146) (Ping timeout: 276 seconds)
14:40:42 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
14:41:23 <kaol> Not a fan of these ergonomics.
14:41:49 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
14:41:53 polykernel joins (~polykerne@user/polykernel)
14:46:17 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
14:46:25 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
14:48:21 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
14:51:00 merijn joins (~merijn@77.242.116.146)
14:53:33 alfiee joins (~alfiee@user/alfiee)
14:54:05 misterfish joins (~misterfis@84.53.85.146)
14:57:58 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds)
15:01:00 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
15:02:21 × son0p quits (~ff@2800:e6:4000:d723:c181:4205:f2b1:437a) (Quit: Leaving)
15:03:19 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
15:03:28 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
15:06:10 <haskellbridge> <sm> kaol: I didn't follow that exactly but it sounds like something stack build --fast --file-watch is good for
15:15:46 × rembo10_ quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
15:16:34 Anushka joins (~Anushka@101.0.63.190)
15:17:12 rembo10 joins (~rembo10@main.remulis.com)
15:20:47 __monty__ joins (~toonn@user/toonn)
15:25:15 <tomsmeding> kaol: I'm fairly sure ghci can only have one component loaded at a time; the others will be used as compiled dependencies. It can only reload the loaded component, so what you want is impossible, currently, I think
15:26:15 <tomsmeding> if you can put your tests in a haskell file instead of running them manually in a repl, then making that an executable/test-suite component of your package allows you to simply use `cabal run` to run the tests, which does have better ergonomics (but perhaps longer roundtrip times)
15:27:50 × todi quits (~todi@p57803331.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
15:28:53 todi joins (~todi@p57803331.dip0.t-ipconnect.de)
15:29:21 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 268 seconds)
15:36:12 <haskellbridge> <sm> oh.. I have a ghci script that uses various ghc options like -i to load from multiple packages into ghci as if they were in one package, for better reloading
15:38:22 <haskellbridge> <sm> https://github.com/simonmichael/hledger/blob/fbbe897133fabbef337f30cd746386a90545f45d/Justfile#L353
15:38:22 <haskellbridge> ... long message truncated: https://kf8nh.com/_heisenbridge/media/kf8nh.com/wEXSVISAROaeFNEYxArasFqE/RCSq550tWp4 (4 lines)
15:39:41 <haskellbridge> <sm> just add the source paths with -i, it seems like
15:40:45 merijn joins (~merijn@77.242.116.146)
15:41:17 alfiee joins (~alfiee@user/alfiee)
15:43:06 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
15:45:32 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
15:47:30 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
15:47:59 euouae joins (~euouae@user/euouae)
15:48:52 <euouae> dminuoso: okay, I reflected a bit on the Vec3 exercise. The <$> f-wraps the constructor, and the <*> applies f-values one by one until it is reduced to an f-value.
15:49:41 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
15:50:30 merijn joins (~merijn@77.242.116.146)
16:00:57 <dminuoso> euouae: Perfect. Now off to the final variantÖ
16:01:25 <dminuoso> Now write a `traverseVec3X` that does the same thing, except it only applies its action to the X component of Vec3. Write variants for Y and Z too.
16:01:33 × Digit quits (~user@user/digit) (Ping timeout: 244 seconds)
16:01:46 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
16:01:46 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 244 seconds)
16:01:54 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
16:03:54 Digit joins (~user@user/digit)
16:08:03 × SlackCoder quits (~SlackCode@64-94-63-8.ip.weststar.net.ky) (Read error: Connection reset by peer)
16:13:36 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
16:14:36 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 264 seconds)
16:15:06 ec joins (~ec@gateway/tor-sasl/ec)
16:18:02 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
16:18:10 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
16:18:38 vanishingideal joins (~vanishing@user/vanishingideal)
16:21:30 × chele__ quits (~chele@user/chele) (Remote host closed the connection)
16:22:22 <euouae> something like: traverseVecX f (Vec3 x y z) = Vec3 <$> f x <*> pure y <*> pure z
16:22:31 <euouae> although now I have to have :: Applicative f => (a -> f a) -> Vec3 a -> f (Vec3 a)
16:22:37 <euouae> i.e. I can't hve it a -> f b anymore.
16:22:58 <euouae> well, what seems to me like is that we have composable setters now
16:24:49 <haskellbridge> <alexfmpe> kaol: cabal repl all --enable-multi-repl
16:24:59 <haskellbridge> <alexfmpe> Need cabal 3.12
16:25:23 <haskellbridge> <alexfmpe> Still a bit rough around the edges but mostly works
16:26:13 × CalimeroTeknik quits (~calimero@ctkarch.org) (Changing host)
16:26:13 CalimeroTeknik joins (~calimero@user/calimeroteknik)
16:28:43 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
16:28:50 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
16:29:21 alfiee joins (~alfiee@user/alfiee)
16:32:53 <tomsmeding> :def is unsupported in multi-mode, lol
16:33:18 <tomsmeding> nor is :m or :set
16:33:42 <euouae> does haskell have a good sql (or otherwise) database
16:33:44 <euouae> library
16:34:00 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 276 seconds)
16:34:20 <euouae> I was using SQLAlchemy on Python and it works nicely, I was able to declaratively put together all the tables of the schema
16:34:26 <euouae> including their relationships
16:34:56 <EvanR> I've used sqlite-simple and postgres-simple
16:35:04 <EvanR> keeping it simple
16:36:24 <euouae> how about db migrations? by hand?
16:36:27 <kaol> hasql is my default choice. Anything that tries to model anything by duplicating table definitions in the source is sure to raise my blood pressure.
16:36:57 <euouae> kaol: ORM in general or just that aspect?
16:37:50 <euouae> I do use PostgreSQL so it's nice that hasql uses it too
16:38:22 <kuribas> euouae: shameless plug, my sql generator library https://hackage.haskell.org/package/hasqlator-mysql-0.2.1
16:38:34 <kuribas> no PostgreSQL yet though...
16:38:51 <kaol> I think much better by writing and thinking in SQL than trying to play ship bottle building game with some other abstraction.
16:39:28 <kuribas> my library tries to be as close as possible to SQL, but remaining composable and type safe.
16:39:32 <kaol> Queries as profunctors is as natural as I've ever seen anything to be.
16:39:45 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 248 seconds)
16:39:47 <kuribas> opaleye?
16:40:44 <kaol> If I'd have a use case for constructing queries dynamically routinely I might consider some other library.
16:41:00 <kaol> Composable is kind of no op if you write the query only once.
16:41:24 <kuribas> Yeah, my library is meant for when you want to compose dynamic queries. If you just need a static query, then *-simple is the easiest way.
16:41:26 vanishingideal joins (~vanishing@user/vanishingideal)
16:41:40 <kaol> Or type safety. It doesn't even solve the whole problem unless you access the DB schema to check it against it too.
16:42:02 <tomsmeding> (please don't make me run a database to compile your code)
16:42:03 <kaol> Or duplicate the schema.
16:42:15 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
16:42:37 <kaol> My dream is something I can just give pg_dump -s and it'd use it for everything.
16:42:46 <kuribas> kaol: you cannot check against the schema without including it as types...
16:42:55 ft joins (~ft@p4fc2a610.dip0.t-ipconnect.de)
16:43:00 gmg joins (~user@user/gehmehgeh)
16:43:00 <euouae> kaol: so from your perspective the best benefit is to learn postgresql/sql as best as one can
16:43:05 <kaol> Feed the schema dump to TH to get types.
16:43:08 × euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.)
16:43:39 <kuribas> kaol: in my library you export the schema to a haskell type, then feed it to TH to get your types.
16:43:54 <kuribas> well, export to a haskell value.
16:44:08 <kuribas> kaol: this way you don't need access to a DB to compile the code.
16:44:12 <kaol> Schema? As in from pg_dump output or some other representation?
16:44:30 <kuribas> kaol: It reads the information schema of the given database.
16:45:26 prasad joins (~Thunderbi@2601:243:c001:3f07::5c)
16:46:15 rvalue- joins (~rvalue@user/rvalue)
16:46:40 × rvalue quits (~rvalue@user/rvalue) (Ping timeout: 252 seconds)
16:47:01 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
16:49:01 <kuribas> You fetch the table info from the connection: https://hackage.haskell.org/package/hasqlator-mysql-0.2.1/docs/Database-MySQL-Hasqlator-Typed-Schema.html#v:fetchTableInfo
16:49:27 <kuribas> Then pretty print it into some module: https://hackage.haskell.org/package/hasqlator-mysql-0.2.1/docs/Database-MySQL-Hasqlator-Typed-Schema.html#v:pprTableInfo
16:52:39 <kuribas> Or if you like, you can put this in a script or a CI/CD pipeline.
16:52:56 rvalue- is now known as rvalue
16:52:57 <kuribas> regen_schemas.sh or something.
16:53:08 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
16:53:41 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
16:55:54 × jespada quits (~jespada@2800:a4:2211:9c00:4cb1:4c0:c141:d649) (Ping timeout: 265 seconds)
16:57:36 jespada joins (~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404)
16:58:02 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
16:58:28 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Remote host closed the connection)
16:58:36 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
16:58:53 × causal quits (~eric@50.35.84.231) (Quit: WeeChat 4.5.1)
16:59:13 euphores joins (~SASL_euph@user/euphores)
17:06:35 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
17:10:22 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2)
17:11:17 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Ping timeout: 248 seconds)
17:12:17 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 248 seconds)
17:12:55 JeremyB99 joins (~JeremyB99@dhcp-248-27.resnet.purdue.edu)
17:12:55 × JeremyB99 quits (~JeremyB99@dhcp-248-27.resnet.purdue.edu) (Read error: Connection reset by peer)
17:13:24 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
17:13:38 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
17:17:36 × gmg quits (~user@user/gehmehgeh) (Ping timeout: 264 seconds)
17:17:36 gehmehgeh joins (~user@user/gehmehgeh)
17:17:55 alfiee joins (~alfiee@user/alfiee)
17:18:30 tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net)
17:21:05 Square joins (~Square@user/square)
17:21:30 × todi quits (~todi@p57803331.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
17:21:40 todi joins (~todi@p57803331.dip0.t-ipconnect.de)
17:22:29 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds)
17:23:04 JeremyB99 joins (~JeremyB99@2607:fb90:a2d0:c4aa:65e5:970a:4d0b:8e34)
17:23:23 × JeremyB99 quits (~JeremyB99@2607:fb90:a2d0:c4aa:65e5:970a:4d0b:8e34) (Read error: Connection reset by peer)
17:24:04 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en)
17:24:26 × Square2 quits (~Square4@user/square) (Ping timeout: 252 seconds)
17:24:44 urdh_ joins (~urdh@user/urdh)
17:25:54 × urdh quits (~urdh@user/urdh) (Ping timeout: 268 seconds)
17:25:54 urdh_ is now known as urdh
17:31:36 JeremyB99 joins (~JeremyB99@pal-210-106-73.itap.purdue.edu)
17:34:49 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
17:35:05 × JeremyB99 quits (~JeremyB99@pal-210-106-73.itap.purdue.edu) (Read error: Connection reset by peer)
17:35:42 wootehfoot joins (~wootehfoo@user/wootehfoot)
17:36:18 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
17:39:53 JeremyB99 joins (~JeremyB99@pal-210-106-73.itap.purdue.edu)
17:42:07 × JeremyB99 quits (~JeremyB99@pal-210-106-73.itap.purdue.edu) (Read error: Connection reset by peer)
17:43:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
17:44:08 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
17:49:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
17:51:12 × polykernel quits (~polykerne@user/polykernel) (Ping timeout: 252 seconds)
17:51:26 polykernel joins (~polykerne@user/polykernel)
17:52:35 JeremyB99 joins (~JeremyB99@pal-210-106-73.itap.purdue.edu)
17:53:12 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
17:58:49 × JeremyB99 quits (~JeremyB99@pal-210-106-73.itap.purdue.edu) (Read error: Connection reset by peer)
17:59:14 × lockywolf quits (~lockywolf@coconut.lockywolf.net) (Ping timeout: 248 seconds)
17:59:38 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds)
18:05:23 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 245 seconds)
18:05:47 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:59 alfiee joins (~alfiee@user/alfiee)
18:07:31 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
18:07:47 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
18:08:50 JeremyB99 joins (~JeremyB99@pal-210-106-73.itap.purdue.edu)
18:10:12 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
18:10:15 × Anushka quits (~Anushka@101.0.63.190) (Quit: Client closed)
18:11:15 × JeremyB99 quits (~JeremyB99@pal-210-106-73.itap.purdue.edu) (Read error: Connection reset by peer)
18:11:35 justsomeguy joins (~justsomeg@user/justsomeguy)
18:12:37 <justsomeguy> Can someone help me understand what Traversable is all about?
18:14:37 <ncf> justsomeguy: did you see https://wiki.haskell.org/Typeclassopedia#Traversable ?
18:15:12 <ncf> or https://en.wikibooks.org/wiki/Haskell/Traversable
18:16:44 × jespada quits (~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404) (Quit: My Mac has gone to sleep. ZZZzzz…)
18:16:54 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
18:17:49 lockywolf joins (~lockywolf@coconut.lockywolf.net)
18:18:05 <EvanR> a generalization of mapM
18:20:19 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
18:21:14 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
18:21:46 <monochrom> If it helps: traverse is impure fmap.
18:22:37 JeremyB99 joins (~JeremyB99@172.59.98.128)
18:23:32 <justsomeguy> At this point the examples make sense, but I'm not sure how they evaluate.
18:23:46 <justsomeguy> Maybe I just have to write it out on paper.
18:23:50 × TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Remote host closed the connection)
18:24:09 × JeremyB99 quits (~JeremyB99@172.59.98.128) (Remote host closed the connection)
18:24:18 JeremyB99 joins (~JeremyB99@2607:fb90:d362:29:704c:ca03:6a71:2d6c)
18:24:48 × lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
18:25:40 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
18:25:48 ljdarj joins (~Thunderbi@user/ljdarj)
18:26:32 <monochrom> If I'm allowed to illustrate sequence instead: sequence [foo, goo, hoo] = liftA2 (:) foo (liftA2 (:) goo (liftA2 (:) hoo (pure [])))))
18:26:52 <monochrom> It may be useful motivate why one would want it.
18:27:04 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
18:27:34 <monochrom> Remember how you can DIY liftA10, liftA11, liftA12 etc by pure and a lot of liftA2?
18:29:13 <haskellbridge> <alexfmpe> Yeah, I'd say sequence is basically folding with applicative, but with a fold function that preserves the original structure.
18:29:15 <haskellbridge> Traverse is fmap followed by sequence, so it's kind of foldMap with applicative
18:29:22 <monochrom> You can then go ambitious and say "but liftA10 is always 10. can I make it variable length?". Answer: sequence accepts an arbitary list so it's variable length. (The compromise is that we only have homogeneous lists, so the input list has to be homogeneous, whereas liftA10 is OK with 10 different types.)
18:29:25 × JeremyB99 quits (~JeremyB99@2607:fb90:d362:29:704c:ca03:6a71:2d6c) (Ping timeout: 268 seconds)
18:29:32 <haskellbridge> <alexfmpe> * suitable combining
18:29:41 <monochrom> If you accept sequence, then traverse is just sequence and fmap.
18:30:30 jespada joins (~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404)
18:30:35 <EvanR> :t sequence
18:30:36 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
18:30:41 <EvanR> :t sequenceA
18:30:42 <lambdabot> (Traversable t, Applicative f) => t (f a) -> f (t a)
18:30:52 <haskellbridge> <alexfmpe> * only works when there's
18:30:53 <monochrom> OK yeah sequenceA.
18:31:30 TheCoffeMaker joins (~TheCoffeM@user/thecoffemaker)
18:31:44 <EvanR> the next in the pattern would be something of the form (Traversable t, Functor f) => t (f a) -> f (t a)
18:32:13 <EvanR> haskell hasn't figured this one out yet
18:32:33 <monochrom> Application: Suppose you want a procedure foo such that foo n reads n lines from stdin and return the list of those n lines. Then it is: sequenceA (replicate n getLine)
18:32:37 <tomsmeding> I'm not sure if a "pattern" is the right way to look at those :P
18:32:41 <EvanR> lol
18:33:01 <monochrom> perhaps s/pattern/generalization/
18:33:34 <monochrom> But I think weakening to functor is impossible.
18:33:41 <euouae> what's a profunctor?
18:34:03 <EvanR> do you know what a contravariant functor is
18:34:18 <euouae> yes
18:34:59 <EvanR> profunctor class is for types which are functor in one parameter and contravariant functor in the other
18:35:42 <euouae> oh I see. hm.. I'll keep it in mind when I encounter it
18:35:58 <ncf> (->) is the canonical example
18:36:40 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
18:37:09 <monochrom> lambda the ultimate goto. (->) the ultimate instance.
18:37:30 <EvanR> (A -> a, A <- b)
18:39:54 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
18:40:48 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
18:41:06 Guest93 joins (~Guest93@pool-96-250-224-152.nycmny.fios.verizon.net)
18:41:18 Lord_of_Life_ is now known as Lord_of_Life
18:41:21 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
18:42:01 × Guest93 quits (~Guest93@pool-96-250-224-152.nycmny.fios.verizon.net) (Client Quit)
18:44:48 × mniip quits (mniip@libera/staff/mniip) (Quit: This page is intentionally left blank)
18:46:41 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds)
18:46:45 <euouae> Thanks
18:49:01 × euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.)
18:52:00 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
18:54:24 × akegalj quits (~akegalj@168-206.dsl.iskon.hr) (Quit: leaving)
18:54:43 alfiee joins (~alfiee@user/alfiee)
18:55:03 euphores joins (~SASL_euph@user/euphores)
18:56:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
18:59:09 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds)
19:04:06 sprotte24 joins (~sprotte24@p200300d16f05dc00448362a75cf21d07.dip0.t-ipconnect.de)
19:05:56 notzmv joins (~umar@user/notzmv)
19:07:24 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
19:11:52 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
19:17:29 <euouae> When I see something like `base:Data.Semigroup.Internal.Endo [a]` in the output of an exported type with `:t`, what exactly does it mean?
19:18:01 <EvanR> Endo [a]
19:18:06 <euouae> I know it's some constriction of some kind placed on [a], but it seems private/implementation?
19:18:09 <euouae> Is it just using GHC features?
19:18:10 <EvanR> just more specific
19:18:36 <euouae> Oh I'm not worried about what this specific type means, just why would it be .Internal exposed to the user of the API
19:18:38 <EvanR> Endo a is a newtype to add Monoid support for a -> a
19:18:46 <int-e> you get it from importing Data.Semigroup or Data.Monoid
19:19:09 <EvanR> modules can reexport stuff defined in an internal module
19:19:31 <euouae> But isn't it finnicky to re export internal stuff? You're tied to something that can blow up at any time
19:19:42 <EvanR> and you never would have known about it if it wasn't for that pesky verbose output and their dog!
19:20:00 <euouae> lol
19:20:07 <mauke> euouae: ?? it's your own implementation details
19:20:09 <EvanR> well whatever is exported is by definition the public API
19:20:11 <EvanR> wherever it came from
19:20:20 <mauke> you're allowed to depend on yourself
19:20:43 <int-e> Endo [a] is usually used as a difference list, to avoid a quadratic slowdown when concatenating many lists
19:20:55 <euouae> Yeah this is a fold
19:20:59 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
19:21:06 <euouae> I guess that's the optimization
19:21:40 <euouae> It's just that... I guess what I'm asking is, if you're a library writer (like lens here) and you dig into GHC internal modules, are you committing a sin? Perhaps GHC documentation says this is okay?
19:22:16 <euouae> I understand that there are be optimizations in lens that are GHC specific, but I hadn't seen anything before, maybe this is my first exposure
19:22:45 <int-e> GHC is the dominant implementation anyway.
19:22:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
19:22:53 <mauke> wait, are you saying lens is using ghc internal modules?
19:23:07 <int-e> I'd be surprised if it didn't
19:23:26 <mauke> because https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-Monoid.html#t:Endo is public
19:23:41 × notzmv quits (~umar@user/notzmv) (Ping timeout: 268 seconds)
19:23:49 <int-e> But yeah I think those two questions are not connected.
19:23:55 <mauke> it's just originally defined in GHC.Internal.Data.Semigroup.Internal
19:24:09 <mauke> but Data.Monoid re-exports it
19:24:31 <int-e> (It's slightly unfortunate that ghci doesn't tell you where to import Endo from but that information is hard to track.)
19:24:46 <euouae> Oh, I see...
19:24:55 <euouae> mauke, I didn't realize it was a public type!
19:25:05 <euouae> I just went with what :t told me
19:25:14 <int-e> euouae: note how my first answer was two modules that you can import it from, maybe you missed it
19:25:46 <euouae> Yeah but you said Endo a, and I thought maybe my type was different
19:25:58 <euouae> I thought Endo might've been public but that base:...Internal thing might've been an optimization
19:26:07 <int-e> No, it was just the unqualified version of the same thing
19:26:32 <euouae> right, makes sense
19:26:35 JeremyB99 joins (~JeremyB99@2607:ac80:407:7:faad:86de:6310:fa61)
19:27:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
19:30:01 × JeremyB99 quits (~JeremyB99@2607:ac80:407:7:faad:86de:6310:fa61) (Remote host closed the connection)
19:36:20 <euouae> is there a good way to look up documentation somehow? maybe from the repl or emacs? I end up searching with control+f on hackage pages
19:36:34 <euouae> e.g. I want to look up `each` from the lens library
19:36:42 × xdej quits (~xdej@quatramaran.salle-s.org) (Ping timeout: 244 seconds)
19:37:10 <euouae> hm -- trying :doc gives me `try recompiling with --haddock`, maybe I need to enable it in the cabal file
19:37:19 <exarkun> if you have lsp you can get some
19:37:40 <exarkun> C-c l h h
19:37:59 <euouae> hmm yeah but first I have to write a valid expression using the identifier
19:38:10 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
19:38:10 <mauke> euouae: on many hackage pages you can hit 's' for an interactive search
19:38:12 <euouae> I can't e.g. do it on `each` if it sits by itself in a random line
19:38:25 <euouae> ah, `s` is nice
19:38:31 <exarkun> if lsp has managed to parse the buffer including it, you can
19:38:45 <exarkun> (+/- some random hls quirks)
19:38:56 <euouae> Yeah exactly, I need to have valid code before I can even look up the symbol :P exarkun
19:39:23 <exarkun> not valid code, just parseable
19:39:43 <euouae> what is the big difference?
19:40:04 <exarkun> each on a line by itself is likely quite parsable, even if it is a type error
19:40:30 <euouae> it's not working
19:40:45 <euouae> What does work is `_ = const 1 each`
19:41:01 <exarkun> is your line in a `where` block? or a `let`?
19:41:09 <euouae> no top-level
19:41:13 <euouae> LSP: no content at point is what I get
19:41:15 <exarkun> oh, ok. sure, or that.
19:41:23 <exarkun> in all those cases, it's a syntax error not to have an =
19:41:25 <euouae> anyway the docs of `each` are empty too lol... heh. maybe I need the -haddock thing
19:41:40 × gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection)
19:42:23 gmg joins (~user@user/gehmehgeh)
19:43:25 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 268 seconds)
19:43:47 alfiee joins (~alfiee@user/alfiee)
19:45:03 vanishingideal joins (~vanishing@user/vanishingideal)
19:45:45 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
19:47:21 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
19:47:52 sixfourtwelve joins (~ethanmorg@82.18.82.103)
19:48:10 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
19:51:08 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
19:51:45 × Katarushisu quits (~Katarushi@finc-20-b2-v4wan-169598-cust1799.vm7.cable.virginm.net) (Ping timeout: 252 seconds)
19:54:00 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:54:59 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
19:55:00 Katarushisu joins (~Katarushi@finc-20-b2-v4wan-169598-cust1799.vm7.cable.virginm.net)
19:55:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
20:00:02 × caconym quits (~caconym@user/caconym) (Quit: bye)
20:00:28 ljdarj1 joins (~Thunderbi@user/ljdarj)
20:00:45 caconym joins (~caconym@user/caconym)
20:01:36 <ash3en> what is Fortan like, from the Haskell perspective?
20:04:17 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 252 seconds)
20:04:17 ljdarj1 is now known as ljdarj
20:06:07 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
20:06:33 <justsomeguy> How does this evaluate: (fmap . fmap) sum Just [1,2,3]? Why does (fmap . fmap) sum Just [1,2,3] == (fmap sum) (Just [1,2,3])?
20:07:09 <mauke> (fmap . fmap) sum = fmap (fmap sum)
20:07:21 <Rembane> \o/ Functor laws \o/
20:07:52 <mauke> fmap f Just = f . Just
20:07:58 <mauke> because of the naked reader instance
20:08:01 Katarushisu3 joins (~Katarushi@finc-20-b2-v4wan-169598-cust1799.vm7.cable.virginm.net)
20:08:04 × Katarushisu quits (~Katarushi@finc-20-b2-v4wan-169598-cust1799.vm7.cable.virginm.net) (Read error: Connection reset by peer)
20:08:04 Katarushisu3 is now known as Katarushisu
20:08:27 <justsomeguy> Wait wait wait...
20:08:32 <mauke> (fmap sum . Just) [1,2,3] = fmap sum (Just [1,2,3])
20:09:08 <mauke> the 1st/3rd things I said are just the definition of (.)
20:09:13 <mauke> the middle thing is where it gets funky
20:10:18 <mauke> > fmap fmap fmap sum Just [1,2,3]
20:10:19 <lambdabot> Just 6
20:10:23 <justsomeguy> How does fmap f Just = f . Just?
20:10:28 <mauke> because fmap = (.)
20:10:35 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
20:10:52 <mauke> instance Functor ((->) e) where fmap = (.)
20:12:52 <mauke> :t fmap
20:12:53 <lambdabot> Functor f => (a -> b) -> f a -> f b
20:12:57 pavonia joins (~user@user/siracusa)
20:14:01 <mauke> let f = ((->) e) in (a -> b) -> f a -> f b ==> (a -> b) -> (->) e a -> (->) e b
20:14:23 <mauke> = (a -> b) -> (e -> a) -> (e -> b)
20:15:51 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:19:17 <justsomeguy> Honestly, I wish I could say that I understood your thoughtful explanation, but I'm so confused.
20:19:50 <mauke> it wasn't very thoughtful :-)
20:19:54 <monochrom> Write your own Functor instance for (->)e, and discover that its fmap is exactly (.)
20:19:56 <mauke> what's the first thing that makes no sense?
20:20:07 <mauke> for example, do you know what (->) e means as a type?
20:21:01 JuanDaugherty joins (~juan@user/JuanDaugherty)
20:21:12 <justsomeguy> I'm not sure. Isn't (->) the type of a function, and e is the type of its first argument?
20:21:21 <monochrom> All true.
20:21:29 <mauke> yes
20:21:29 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
20:21:47 <monochrom> Precisely why all of the above is correct.
20:21:49 <mauke> a -> b = (->) a b = ((->) a) b
20:21:58 <justsomeguy> (By the way, I'm on 7% batter right now.)
20:22:03 <monochrom> BTW [a] = [] a
20:22:04 <mauke> perhaps non-obvious: you can curry type applications
20:22:58 <mauke> which is why you can partially apply a type constructor like (->) and make a Functor instance for it
20:24:00 <mauke> if you're familiar with the Reader monad, (->) is the same thing
20:24:08 <mauke> (or rather, Reader is a newtype wrapper around (->))
20:25:56 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
20:26:17 <justsomeguy> My battery is about to die! I'm going to experiment with this more.
20:26:35 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.6)
20:26:50 <Digit> 20 years since i first got interested in Haskell. i should probably learn how to use it. is there a "learn Haskell while you sleep"? or anything that can be repurposed for such. ... do you think that's even possible? can Haskell be learned in our sleep?
20:27:44 <mauke> doubt it
20:28:28 <EvanR> maybe subliminal messaging to convince yourself you know haskell
20:28:37 <EvanR> maybe that's enough
20:29:24 <Digit> ooh, now you're onto something. could hypnotise myself in my sleep to stop being so lazy and self sabotaging around my Haskell aspirations.
20:31:42 <monochrom> Can you learn anything at all while you sleep?
20:31:52 alfiee joins (~alfiee@user/alfiee)
20:32:11 <EvanR> what counts as learning
20:32:29 <EvanR> is it a mutation in the physical structure of the brain
20:32:41 <EvanR> then yes
20:33:05 <monochrom> Then does brain surgery count as learning, too? >:)
20:33:24 <EvanR> or unlearning
20:33:43 <EvanR> which is handy if you already learned C++ before trying to learn haskell
20:34:09 <monochrom> Learning is Unlearning. Ignorance is Strength. Great. >:)
20:34:32 <mauke> knowledge is costrength
20:35:46 <haskellbridge> <sm> @Digit: skim #haskell IRC/matrix chats in idle moments, it’s not exactly sleeping but you can pick up a lot over time
20:36:01 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
20:36:10 <haskellbridge> <sm> play haskell videos in the background...
20:36:40 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Remote host closed the connection)
20:36:53 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
20:36:55 × jespada quits (~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404) (Quit: My Mac has gone to sleep. ZZZzzz…)
20:37:19 <haskellbridge> <Bowuigi> EvanR Sleeping already mutates the physical structure of your brain, that's why we sleep
20:38:29 <haskellbridge> <Bowuigi> Learning stuff while sleeping is likely possible, but so hard it's not worth it
20:38:47 <EvanR> that's what I was getting at
20:38:55 <haskellbridge> <Bowuigi> You would need to dream about this new topic AND remember your dream later
20:39:22 × sixfourtwelve quits (~ethanmorg@82.18.82.103) (Quit: leaving)
20:39:47 notzmv joins (~umar@user/notzmv)
20:40:31 <haskellbridge> <Bowuigi> AFAIU we have many dreams per night, but we usually don't remember all of them. Even if we do, they kinda blend into a single story, yet another explanation why dreams can be so weird
20:41:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
20:41:21 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 248 seconds)
20:41:24 × gentauro quits (~gentauro@user/gentauro) (Ping timeout: 260 seconds)
20:41:31 <mauke> do dreams live in volatile ram?
20:42:22 <haskellbridge> <Bowuigi> They are kinda just streamed once and gone forever
20:43:18 gentauro joins (~gentauro@user/gentauro)
20:44:16 <haskellbridge> <Bowuigi> But technically, if you had control over most of your dreams you can learn new stuff. Specially since pattern matching becomes easier. Sounds useful for CT
20:46:01 <ski> i've heard some engineers have been able to generate a "real life" model of a design, in front of them, in a lucid dream, being able to move around and view from different angles, adjust and modify things to see how it seems to work out
20:46:25 <mauke> nah, I've tried to read things in dreams (text, diagrams, etc)
20:46:28 <mauke> it doesn't go well
20:46:31 <EvanR> memory palace
20:46:59 <ski> (i've also had dreams pondering programming or math problems. but those (for me) tend to be more abstract, not like you're in a 3D environment at all)
20:47:15 <haskellbridge> <Bowuigi> Also, how we remember a dream changes as time passes. If our brain inserts a generic human somewhere, after waking up it will try to coerce that NPC into someone we know, modifying our memories destructively
20:47:22 <ski> yep, mauke. ditto with mirrors, as well
20:47:33 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
20:47:41 <geekosaur> when I was having lucid dreams due to a prescription I was on, I found that from a distance I could understand what something "said" as a concept, but looking at the individual characters they were essentially random
20:47:52 <ski> (dreaming about chatting IRC is also weird ..)
20:48:55 <haskellbridge> <Bowuigi> Haven't had the text issue tbh
20:49:05 mrmr joins (~mrmr@user/mrmr)
20:49:16 <haskellbridge> <Bowuigi> When my dreams have text (not often at all) it's always readable
20:49:36 <ski> people use that issue with text, and also e.g. watches, as a "reality check", to make it more likely they get a lucid dream
20:49:39 <EvanR> readable but not necessarily legible xD
20:50:28 <ski> (if you get into a habit of doing such checks, you often tend to extend that habit into your dreams. and then you can notice the discrepancy, and realize you're dreaming, and so become lucid)
20:51:38 <haskellbridge> <Bowuigi> Lucid dreaming is pretty cool but doesn't it use extra resources or something? I would like to use my sleeping time to sleep (tho it can be useful)
20:51:40 yegorc joins (~yegorc@user/yegorc)
20:52:15 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
20:52:21 <geekosaur> yes, ime it means your conscious mind isn't fully resting
20:52:34 <geekosaur> frontaltemporal stuff is being "awake"-active
20:53:33 <ski> i wonder how much difference there is, wrt ordinary REM sleep
20:55:11 × sprotte24 quits (~sprotte24@p200300d16f05dc00448362a75cf21d07.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
20:55:22 weary-traveler joins (~user@user/user363627)
20:56:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
21:01:55 × Square quits (~Square@user/square) (Ping timeout: 265 seconds)
21:03:20 sprotte24 joins (~sprotte24@p200300d16f05dc00448362a75cf21d07.dip0.t-ipconnect.de)
21:07:17 × lockywolf quits (~lockywolf@coconut.lockywolf.net) (Ping timeout: 268 seconds)
21:07:39 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:09:31 JuanDaugherty is now known as ColinRobinson
21:12:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
21:14:49 × kimiamania8 quits (~65804703@user/kimiamania) (Quit: PegeLinux)
21:15:58 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:16:51 kimiamania8 joins (~65804703@user/kimiamania)
21:18:31 misterfish joins (~misterfis@84.53.85.146)
21:20:16 alfiee joins (~alfiee@user/alfiee)
21:23:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:24:36 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
21:30:26 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
21:32:38 ChaiTRex joins (~ChaiTRex@user/chaitrex)
21:40:56 × takuan quits (~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection)
21:41:05 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:44:55 AlexNoo_ joins (~AlexNoo@178.34.151.30)
21:44:55 × AlexZenon quits (~alzenon@178.34.151.30) (Read error: Connection reset by peer)
21:45:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
21:45:51 × myme quits (~myme@2a01:799:d5a:d600:3359:17b6:3323:1290) (Ping timeout: 252 seconds)
21:46:35 AlexZenon joins (~alzenon@178.34.151.30)
21:48:08 myme joins (~myme@40.51-175-185.customer.lyse.net)
21:49:15 × AlexNoo quits (~AlexNoo@178.34.151.30) (Ping timeout: 276 seconds)
21:49:29 haskellbridge sm . o O peak #haskell there
21:52:24 AlexNoo_ is now known as AlexNoo
21:56:27 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:00:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
22:06:48 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
22:09:00 alfiee joins (~alfiee@user/alfiee)
22:11:50 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:13:22 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
22:16:17 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
22:16:21 × michalz quits (~michalz@185.246.207.200) (Remote host closed the connection)
22:18:04 × Leary quits (~Leary@user/Leary/x-0910699) (Remote host closed the connection)
22:26:39 <dminuoso> euouae: Have you implemented traverseVec3Y and Z variants too?
22:27:14 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:27:24 dysthesis joins (~dysthesis@user/dysthesis)
22:28:01 <dminuoso> euouae: Also note, you can weaken the constraint to Functor. Try rewriting it to not use `pure`.
22:28:13 <dminuoso> You can either play type tetris or employ the Applicative/Functor laws.
22:30:48 × dysthesis quits (~dysthesis@user/dysthesis) (Remote host closed the connection)
22:31:38 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
22:35:22 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds)
22:36:00 <euouae> dminuoso: for X I used `traverseVecX f (Vec3 x y z) = Vec3 <$> f x <*> pure y <*> pure z` with the obvious modification for Y and Z
22:38:22 <euouae> to do without the pure's I think I'd use something like (\x -> Vec3 x y z) <$> f x
22:39:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:42:11 <euouae> lens are a lot of fun
22:45:12 × fmira quits (~user@user/fmira) (Ping timeout: 264 seconds)
22:45:38 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
22:56:40 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
22:56:47 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:57:24 alfiee joins (~alfiee@user/alfiee)
22:58:12 Leary joins (~Leary@user/Leary/x-0910699)
23:01:30 <dminuoso> euouae: That looks good.
23:01:41 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
23:01:48 mniip joins (mniip@libera/staff/mniip)
23:01:49 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
23:01:51 <dminuoso> euouae: So what you have conjured, is a `Lens (Vec3 a) a`
23:02:12 <dminuoso> That is, that thing that "traverses over a single component using some functor", that is the lens.
23:03:16 <euouae> I see the setter, but not the getter
23:03:17 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
23:03:23 <dminuoso> How do you `set` with that?
23:03:38 <dminuoso> Curious whether you can find out yourself
23:03:42 <euouae> traverseVecX (const v) vec
23:03:57 <dminuoso> Interesting. You are close, but that wont work.
23:04:10 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
23:04:28 <dminuoso> You need to find a choice of `f` here.
23:04:59 <euouae> Identity
23:05:30 <dminuoso> Give it a try.
23:05:38 <dminuoso> Have you peeked into the lens implementation before?
23:06:20 <euouae> Not really I'm just reading the lens book
23:06:27 <euouae> So far it's "how to use this" type of thing
23:06:33 <dminuoso> Fair enough.
23:06:51 <dminuoso> So there are two newtypes that seem rather useless or silly in isolation:
23:06:58 <dminuoso> newtype Const a b = Const { getConst :: a }
23:07:12 <dminuoso> newtype Const a b = Const { getConst :: a }
23:07:15 <dminuoso> newtype Identity a = Identity { runIdentity :: a }
23:07:56 <dminuoso> And both happen to be Functor. And it turns out that if you traverseVecX using those functors, it gives you the exact behavior of either extracting the thing it traverses over, or setting the value in place.
23:09:05 <euouae> I made this work `traverseVecX (const 30) x :: Identity (Vec3 Int)`
23:09:27 <euouae> oh? let me re-read what you said
23:09:59 <dminuoso> euouae: Yeah, that way to "set" with Identity is correct.
23:10:10 <dminuoso> euouae: https://hackage.haskell.org/package/lens-5.3.3/docs/src/Control.Lens.Setter.html#set
23:10:30 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:11:01 <dminuoso> Note that your lens is a simple: Lens' (Vec3 a) a
23:11:08 <euouae> so you're using `traverseVecX getConst vec`?
23:11:35 weary-traveler joins (~user@user/user363627)
23:12:05 <euouae> no, hm...
23:12:35 <dminuoso> You just `traverseVec3 Const`, that's it!
23:12:46 <dminuoso> (Well and getConst to unwrap it)
23:13:32 <dminuoso> https://hackage.haskell.org/package/microlens-0.4.13.1/docs/src/Lens.Micro.Extras.html#view (the lens implementation has a small layer of indirection with `asks`, so this one is a bit easier to look at
23:13:46 <dminuoso> euouae: And here comes the next cool part:
23:13:51 <dminuoso> % :t traverse . traverse
23:13:51 <yahb2> traverse . traverse ; :: (Applicative f, Traversable t1, Traversable t2) => ; (a -> f b) -> t1 (t2 a) -> f (t1 (t2 b))
23:13:54 <dminuoso> % :t traverse . traverse . traverse)
23:13:55 <yahb2> <interactive>:1:31: error: [GHC-58481] parse error on input ‘)’
23:13:56 <dminuoso> % :t traverse . traverse . traverse
23:13:56 <yahb2> traverse . traverse . traverse ; :: (Applicative f, Traversable t1, Traversable t2, ; Traversable t3) => ; (a -> f b) -> t1 (t2 (t3 a)) -> f (t1 (t2 (t3 b)))
23:14:10 <dminuoso> Note how you can just compose these traverse-like functions to traverse over nested structures.
23:14:19 <euouae> I'm not able to get an answer with getConst (traverseVecX Const (Vec3 1 2 3))
23:14:28 <euouae> Maybe because there's no Show?
23:14:35 <dminuoso> What error do you get?
23:14:45 <euouae> I just get `getConst (traverseVecX Const x) :: (Monoid a, Num a) => a` as a type
23:14:50 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:14:58 <euouae> I think it evaluates, I just don't know what it is, it's the repl on haskell-mode in emasc
23:15:02 <dminuoso> euouae: Check your type.
23:15:10 <dminuoso> Did you relax the constraint to Functor?
23:15:17 <euouae> No its still Applicative
23:15:21 <dminuoso> Thats why.
23:15:24 <euouae> Oh, heh
23:15:30 <dminuoso> We can use this to figure out what just happened next.
23:15:35 <dminuoso> So
23:15:57 <dminuoso> Consider your original traverseVec3 that traversed over all components, but needed Applicative
23:16:14 <dminuoso> Use your Const, but instead of using Numbers maybe put strings into your Vec.
23:16:16 <dminuoso> Give it a try.
23:17:31 <dminuoso> And similiarly, try using Identity with that too.
23:17:43 <mauke> "stringsareanicemonoid"
23:18:12 <dminuoso> yada-yada-free-monoid
23:19:52 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
23:21:56 <euouae> I'm going to definitely refactor with just Functor and investigate how Const works, thank you
23:22:04 <euouae> I'll do this tomorrow because there's stuff now to do
23:22:25 <euouae> One thing that trips me up in Haskell is that I don't know if I'm dealing with a class or data whenever I see "Foo"... is this normal?
23:22:37 <dminuoso> You can know.
23:22:58 <euouae> Well if it is in the left of => it's a class?
23:23:09 <dminuoso> A typeclass constraint can only appear in special places, normally not even in type position but only special constraint places.
23:23:31 <euouae> right... just talking about "Const a b" though, you wouldn't know, you'd have to look into it
23:23:32 <dminuoso> In places where values can appear, any identifier starting with an uppercase letter is a constructor of sorts.
23:24:02 <dminuoso> euouae: well I did not mention `Const a b` in isolation.
23:24:06 <euouae> I guess I need to be more conscious about it
23:24:11 <dminuoso> newtype Const a b = Const { getConst :: a }
23:24:21 <dminuoso> Or, with GADTSyntax (which I prefer):
23:24:50 Crypt-Lab joins (NSA@gateway/vpn/protonvpn/commanderbond007)
23:25:05 × CryptLab quits (NSA@gateway/vpn/protonvpn/commanderbond007) (Remote host closed the connection)
23:25:15 <dminuoso> % newtype Const a b where Const :: a -> Const a b
23:25:15 <yahb2> <no output>
23:25:36 ski 'd really prefer various data types to not reuse the exact same name for the data constructor
23:25:50 <dminuoso> euouae: One of the larger sources of confusion for beginners of haskell is the compact dense notation of data, where value-level constructor and types appear to be sitting right next to each other
23:26:23 <dminuoso> ski: Have you worked with languages that have a shared namespace for types and value level constructs?
23:26:39 <ski> dependently typed
23:26:42 <dminuoso> Oh well, I guess in dependent types this would be natural
23:26:44 <dminuoso> Yeah.
23:27:54 <ski> but yea. having seen BNF before, the way `data' declarations work becomes a bit less unfamiliar
23:27:56 <mauke> euouae: right, and with things like constraint types, it's completely ambiguous
23:28:27 <mauke> type Wtf a = (Show a, Num a) -- what even is that
23:28:53 <dminuoso> Wait until I hand you a `Dict Show`
23:29:02 <mauke> that's illegal
23:29:07 <dminuoso> Oh its not.
23:29:20 <ski> `Dict (Show T)'
23:29:41 <dminuoso> Oh I was a bit too quick with that assessment indeed.
23:30:11 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:30:33 <mauke> newtype Identity runIdentity where Identity::a -> Identity a
23:30:55 <ski> heh
23:30:58 <euouae> mauke: I guess it's a restriction on what a can be? is that an extension?
23:31:02 <jackdk> I had some code a while back that went hard on the stuff from package `constraints` to wrangle various `KnownNat` constraints. And then I fixed my design error and it all went away. But it was fun while it lasted.
23:31:23 <dminuoso> euouae: `type ..` introduces just a type alias.
23:31:39 <dminuoso> However...
23:32:15 <mauke> euouae: https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/constraint_kind.html
23:32:37 <dminuoso> I think they were referring to `type Wtf ...`
23:32:43 <dminuoso> % type Wtf a = (Show a, Num a)b
23:32:43 <yahb2> <interactive>:183:29: error: [GHC-76037] ; Not in scope: type variable ‘b’
23:32:45 <dminuoso> % type Wtf a = (Show a, Num a)
23:32:45 <yahb2> <no output>
23:33:31 <dminuoso> % f :: Wtf a => a -> a; f = id
23:33:31 <yahb2> <no output>
23:34:09 <ski> % let foo :: Wtf a => a -> String; foo n = show (show (n + 1)) in foo 42
23:34:10 <yahb2> "\"43\""
23:34:23 × tabaqui1 quits (~root@87.200.129.102) (Ping timeout: 252 seconds)
23:34:27 <euouae> oh it's a type constraint synonym that page says
23:34:44 <euouae> so an intersection of Show and Num
23:34:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:35:08 <ski> it's a compound constraint, consisting of two part constraints
23:35:12 <dminuoso> euouae: This can be useful for situations where you may have a bunch of constraints that you want to repeatedly mention in type signatures.
23:35:19 <euouae> right
23:35:25 <dminuoso> Especially in effect systems like effectful.
23:35:42 <ski> basically, "constraints live at the same level as types"
23:37:06 mange joins (~user@user/mange)
23:37:21 <mauke> newtype Identity runIdentity where Identity :: { runIdentity :: a } -> Identity a
23:37:35 <mauke> had to look up GADT record syntax
23:38:48 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
23:38:48 <dminuoso> % data Dict :: Constraint -> Type where Dict :: a => Dict a
23:38:48 <yahb2> <no output>
23:38:55 <dminuoso> % d = Dict :: Dict (Show Int)
23:38:55 <yahb2> <no output>
23:39:12 <dminuoso> Some portion of these constraints can exist at the value level too!
23:39:42 <dminuoso> Not quite the constraints, but dictionaries of them.
23:40:08 <dminuoso> And we can use them to discharge constraints at will, no longer are we at the whim of the compiler.
23:40:16 <dminuoso> Finally, liberated.
23:41:17 <dminuoso> I tried really hard to find a reason to use `constraints` in one of our projects.. but no matter the mental gymnastics, I couldn't even justify it to myself.
23:42:01 <mauke> % let { foo :: Dict (Show a) -> a -> String; foo Dict x = show x } in foo Dict '?'
23:42:01 <yahb2> "'?'"
23:42:18 <mauke> % let { foo :: Dict (Show a) -> a -> String; foo _ x = show x } in foo Dict '?'
23:42:18 <yahb2> <interactive>:231:54: error: [GHC-39999] ; • No instance for ‘Show a’ arising from a use of ‘show’ ; Possible fix: ; add (Show a) to the context of ; the type signature ...
23:43:31 <dminuoso> % withDict :: Dict a -> (a => r) -> r; withDict d r = case d of Dict -> r
23:43:31 <yahb2> <no output>
23:43:50 <dminuoso> mauke: ^- you must pattern match for the GADT packed dict to discharge the surrounding constraint.
23:44:13 <ski> that's the point, yes
23:44:47 <dminuoso> This machinery lives on not just ConstraintKinds but also GADTs.
23:45:33 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:46:02 <mauke> % let { withDict' :: Dict a -> (a => r) -> r; withDict' Dict = id } in ()
23:46:03 <yahb2> <interactive>:237:62: error: [GHC-91028] ; • Couldn't match type ‘r’ with ‘a => r’ ; Expected: (a => r) -> r ; Actual: r -> r ; Cannot equate type variable ‘r’ ; with ...
23:46:08 alfiee joins (~alfiee@user/alfiee)
23:46:14 <mauke> % let { withDict' :: Dict a -> (a => r) -> r; withDict' Dict r = r } in ()
23:46:14 <yahb2> ()
23:47:03 <dminuoso> Okay I find the diagnostic a bit surprising here.
23:47:05 <mauke> eta reduction: destroyed
23:49:17 <geekosaur> % :set -XDeepSubsumption
23:49:17 <yahb2> <no output>
23:49:38 <geekosaur> % let { withDict'' :: Dict a -> (a => r) -> r; withDict'' Dict = id } in ()
23:49:39 <yahb2> ()
23:49:50 <ski> (s/eta reduction/function extensionality/)
23:50:10 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:50:32 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
23:51:33 <ski> perhaps there should be an explicit syntax for dictionary application ?
23:52:03 <dminuoso> Do we have a suitable syntax for type application, now?
23:52:20 <ski> debatable
23:52:35 <dminuoso> I recall there was a proposal a while ago, but I cant quite remember the name of the extension
23:53:02 ski doesn't think the selection of `@' is great
23:54:02 <dminuoso> % :set -XTypeAbstractions
23:54:02 <yahb2> <no output>
23:54:13 <dminuoso> % id @a x = (x :: a)
23:54:13 <yahb2> <interactive>:263:4: error: [GHC-14964] ; • Invisible type pattern a has no associated forall ; • In an equation for ‘id’: id @a x = (x :: a)
23:54:13 <ski> withShowable (WrapShowable @a x) k = k @a x -- could one write something like this ?
23:54:20 <dminuoso> Hold on.
23:54:37 <dminuoso> Invisible type pattern?
23:54:49 × sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 244 seconds)
23:54:51 <dminuoso> % id :: a -> a; id @a x = (x :: a)
23:54:51 <yahb2> <no output>
23:55:09 <dminuoso> But that has no associated forall either..
23:55:20 <ski> (assuming `data Showable = forall a. Show a => WrapShowable a', and `withShowable :: Showable -> (forall a. Show a => a -> o) -> o')
23:56:31 <dminuoso> Oh well, I think I understand what the diagnostic is really trying to say
23:58:09 <dminuoso> ski: At times I do wish we had a mechanism to just swap out typeclass instances, or have some overlapping ones and then decide which ones I want.
23:58:25 <ski> mm
23:59:03 <dminuoso> The discussions Ive seen over the years consistently bring up coherence issues, but they feel contrived.
23:59:36 <ski> occasionally, i'd like to be able to define types (possibly non-locally depending on tyvars in scope) in `where' and `let', as well as making instances for them there
23:59:56 <dminuoso> Oh, locally scoped instances yes.

All times are in UTC on 2025-02-11.