2025/02/11

Newest at the top

2025-02-11 13:44:37 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
2025-02-11 13:40:23 +0100tri(~tri@ool-44c70bcb.dyn.optonline.net)
2025-02-11 13:40:19 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-02-11 13:38:21 +0100 <dminuoso> `viewP l = getConst . runUpStar (l (UpStar Const))` of course.
2025-02-11 13:38:10 +0100 <dminuoso> Oh
2025-02-11 13:37:57 +0100 <dminuoso> `viewL l = runConst . l Const` and `viewP l = getConst . (l (UpStar Const))`
2025-02-11 13:37:25 +0100 <bwe> alexfmpe, akegalj, ski: thanks, I've gone for alexfmpe's approach, solves my requirement.
2025-02-11 13:35:01 +0100 <dminuoso> In this particular example, the profunctor representation is just vastly more generalized.
2025-02-11 13:34:21 +0100 <dminuoso> So a simple way to run a LensP would be to just turn it into a LensVL by just picking :=> ~ UpStar
2025-02-11 13:33:19 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
2025-02-11 13:32:58 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 265 seconds)
2025-02-11 13:32:46 +0100 <dminuoso> type LensVL s t a b = forall f . Functor f => (a -> f b) -> s -> f t
2025-02-11 13:32:40 +0100 <dminuoso> type LensP s t a b = forall (:=>). Strong (:=>) => (a :=> b) -> s :=> t
2025-02-11 13:31:12 +0100 <dminuoso> If we write `p` in an infix position with a nice operator instead, the similarity becomes more obvious:
2025-02-11 13:30:33 +0100 <dminuoso> So `type LensP s t a b = forall p. Strong p => p a b -> p s t`
2025-02-11 13:30:22 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
2025-02-11 13:30:21 +0100 <dminuoso> Where type Optic p s t a b = p a b -> p s t
2025-02-11 13:29:55 +0100 <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`
2025-02-11 13:28:26 +0100tavare(~tavare@user/tavare) tavare
2025-02-11 13:28:21 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-11 13:28:12 +0100 <dminuoso> Similarly to how in VL representation you pick a particular functor to "use" it
2025-02-11 13:28:02 +0100tavare(~tavare@user/tavare) (Remote host closed the connection)
2025-02-11 13:27:38 +0100 <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
2025-02-11 13:27:00 +0100jespada(~jespada@2800:a4:2211:9c00:4cb1:4c0:c141:d649) jespada
2025-02-11 13:24:06 +0100sprotte24(~sprotte24@p200300d16f05dc007daaf3d6dd12202b.dip0.t-ipconnect.de)
2025-02-11 13:22:42 +0100 <dminuoso> thirdofmay18081814goya: Roughly, the way you "run" a lens does not differ too wildly between all three variants (VL, mixed and profunctor).
2025-02-11 13:22:09 +0100chele_(~chele@user/chele) (Ping timeout: 248 seconds)
2025-02-11 13:20:30 +0100chele(~chele@user/chele) (Ping timeout: 276 seconds)
2025-02-11 13:19:40 +0100chele__(~chele@user/chele) chele
2025-02-11 13:18:42 +0100wootehfoot(~wootehfoo@user/wootehfoot) wootehfoot
2025-02-11 13:18:25 +0100picnoir(~picnoir@about/aquilenet/vodoo/NinjaTrappeur) NinjaTrappeur
2025-02-11 13:17:49 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
2025-02-11 13:17:13 +0100chele_(~chele@user/chele) chele
2025-02-11 13:17:01 +0100picnoir(~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Quit: WeeChat 4.5.1)
2025-02-11 13:12:39 +0100merijn(~merijn@77.242.116.146) merijn
2025-02-11 13:11:20 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
2025-02-11 13:07:47 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3) (Read error: Connection reset by peer)
2025-02-11 13:06:06 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 246 seconds)
2025-02-11 13:02:30 +0100akegalj(~akegalj@78-3-100-82.adsl.net.t-com.hr) (Ping timeout: 252 seconds)
2025-02-11 13:02:11 +0100caconym(~caconym@user/caconym) caconym
2025-02-11 13:00:11 +0100JeremyB99(~JeremyB99@2607:ac80:407:7:b132:8d6d:8d5:36a3)
2025-02-11 13:00:04 +0100caconym(~caconym@user/caconym) (Quit: bye)
2025-02-11 13:00:02 +0100JeremyB99(~JeremyB99@dhcp-251-168.resnet.purdue.edu) (Remote host closed the connection)
2025-02-11 12:59:33 +0100merijn(~merijn@77.242.116.146) merijn
2025-02-11 12:57:23 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 244 seconds)
2025-02-11 12:53:02 +0100Akshat(~Akshat@2409:40d0:11e1:cd05:62b2:b7f8:bf3f:70d) (Quit: Client closed)
2025-02-11 12:52:30 +0100CalimeroTeknik(~calimero@ctkarch.org)
2025-02-11 12:49:30 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en
2025-02-11 12:44:49 +0100 <haskellbridge> <alexfmpe> bwe: fromMaybe defaultValue $ asum $ fmap ($ input) [fun1, fun2,...]
2025-02-11 12:40:14 +0100CalimeroTeknik(~calimero@user/calimeroteknik) (Ping timeout: 260 seconds)