Logs: freenode/#haskell
| 2020-11-11 06:23:27 | × | noecho quits (~noecho@2a01:4f8:1c0c:80ee::4223) (Quit: ZNC - http://znc.in) |
| 2020-11-11 06:23:27 | → | knupfer joins (~Thunderbi@200116b82c3cbf007840659ab1a6a1ba.dip.versatel-1u1.de) |
| 2020-11-11 06:23:55 | → | noecho joins (~noecho@static.143.42.203.116.clients.your-server.de) |
| 2020-11-11 06:24:00 | <Axman6> | :t _1 Tagged |
| 2020-11-11 06:24:01 | <lambdabot> | error: |
| 2020-11-11 06:24:01 | <lambdabot> | Data constructor not in scope: Tagged :: a0 -> f b0 |
| 2020-11-11 06:24:08 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds) |
| 2020-11-11 06:24:12 | <Axman6> | % :t _1 Tagged |
| 2020-11-11 06:24:13 | <yahb> | Axman6: ; <interactive>:1:4: error: Data constructor not in scope: Tagged :: a0 -> f b0 |
| 2020-11-11 06:24:30 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2020-11-11 06:24:56 | <Axman6> | % import Data.Tagged |
| 2020-11-11 06:24:57 | <yahb> | Axman6: |
| 2020-11-11 06:24:59 | <Axman6> | % :t _1 Tagged |
| 2020-11-11 06:24:59 | <yahb> | Axman6: forall {k} {s1} {t} {b} {s2 :: k}. Field1 s1 t b b => s1 -> Tagged s2 t |
| 2020-11-11 06:25:44 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-11 06:25:44 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2020-11-11 06:27:43 | <bqv> | how do i construct a half-simple prism |
| 2020-11-11 06:27:54 | <Axman6> | "half-simple"? |
| 2020-11-11 06:28:26 | <bqv> | looking for an optic that's a prismatic getter but identity setter |
| 2020-11-11 06:28:51 | <bqv> | i'd suggest the type but i'm not sure on it |
| 2020-11-11 06:28:56 | <Axman6> | sounds like you're out to break some laws bucko |
| 2020-11-11 06:28:58 | <jle`> | what operations would it support? |
| 2020-11-11 06:29:10 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 256 seconds) |
| 2020-11-11 06:29:20 | <bqv> | well, the intention is to compose it with a lens i have already |
| 2020-11-11 06:29:52 | <jle`> | what operations would you want the result of that composition to support? |
| 2020-11-11 06:29:57 | <bqv> | that lens is a Lens (Maybe a) (Maybe b) (f (Maybe a)) (f (Maybe b)) |
| 2020-11-11 06:30:27 | <bqv> | get -> failable retrieval |
| 2020-11-11 06:30:38 | <bqv> | set <- Maybe value |
| 2020-11-11 06:30:58 | <jle`> | get :: Thing' s a -> s -> Maybe a ? |
| 2020-11-11 06:31:02 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-11-11 06:31:07 | <jle`> | set :: ? |
| 2020-11-11 06:31:56 | <bqv> | get :: Thing' s a -> s -> Maybe a, set :: Thing' s a -> Maybe a -> Thing' s a |
| 2020-11-11 06:32:00 | <bqv> | (?) |
| 2020-11-11 06:32:14 | <bqv> | wait |
| 2020-11-11 06:32:36 | <jle`> | remember set for normal lenses is set :: Optic' s a -> a -> s -> s |
| 2020-11-11 06:32:45 | <bqv> | yeah no, that's right. just, my current lens fits that, but the problem i'm trying to solve it getting it to behave sensibly with the ^? family of operations |
| 2020-11-11 06:33:02 | <jle`> | do you have an example of a specific thing you want to do? |
| 2020-11-11 06:33:41 | → | coot joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl) |
| 2020-11-11 06:35:37 | <bqv> | so with my current lens, i'll call it "focus": if i do ``inhabited ^.. focus._Just`` i get a list of one value, if i do ``uninhabited ^.. focus._Just`` i get an empty list. That's the get behaviour i'm after. if i do ``inhabited & focus .~ Just v`` the value is set to v, and if i do ``inhabited & focus .~ Nothing`` the value is cleared. That's the set behaviour i'm after |
| 2020-11-11 06:35:51 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-11 06:36:16 | <bqv> | focus :: IndexedLens' k (w (Maybe (k, a))) (Maybe a) |
| 2020-11-11 06:37:05 | × | bitmapper quits (uid464869@gateway/web/irccloud.com/x-uttamgxxcsffgvha) (Quit: Connection closed for inactivity) |
| 2020-11-11 06:38:02 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-11-11 06:38:19 | × | britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Client Quit) |
| 2020-11-11 06:38:24 | × | knupfer quits (~Thunderbi@200116b82c3cbf007840659ab1a6a1ba.dip.versatel-1u1.de) (Ping timeout: 240 seconds) |
| 2020-11-11 06:38:36 | → | britva joins (~britva@31-10-157-156.cgn.dynamic.upc.ch) |
| 2020-11-11 06:39:19 | <bqv> | my current mental summary of what i want to acheive is lens composition of _Just, but only over the getter |
| 2020-11-11 06:39:40 | <bqv> | that's an asymmetrical lens, but i think it's still a valid one |
| 2020-11-11 06:39:49 | <bqv> | well, valid optic, at least |
| 2020-11-11 06:40:03 | <c_wraith> | aren't you just describing exactly the behavior of at? |
| 2020-11-11 06:40:18 | <bqv> | quite possibly, how would i use that here? |
| 2020-11-11 06:40:34 | <c_wraith> | No idea, it was more that you can use it as a model for your type |
| 2020-11-11 06:40:42 | <c_wraith> | > M.fromList [(1, "a"), (2, "q")] ^.. at 1 . _Just |
| 2020-11-11 06:40:44 | <lambdabot> | ["a"] |
| 2020-11-11 06:40:47 | <c_wraith> | > M.fromList [(1, "a"), (2, "q")] ^.. at 3 . _Just |
| 2020-11-11 06:40:49 | <lambdabot> | [] |
| 2020-11-11 06:41:05 | <c_wraith> | > M.fromList [(1, "a"), (2, "q")] & at 1 .~ Just "hi" |
| 2020-11-11 06:41:07 | <lambdabot> | fromList [(1,"hi"),(2,"q")] |
| 2020-11-11 06:41:11 | <c_wraith> | > M.fromList [(1, "a"), (2, "q")] & at 1 .~ Nothing |
| 2020-11-11 06:41:12 | <lambdabot> | fromList [(2,"q")] |
| 2020-11-11 06:41:14 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 272 seconds) |
| 2020-11-11 06:41:21 | × | Sheilong quits (uid293653@gateway/web/irccloud.com/x-jmssjdeibemlfomz) (Quit: Connection closed for inactivity) |
| 2020-11-11 06:41:22 | <c_wraith> | I mean... that's the properties you want, right? |
| 2020-11-11 06:41:39 | <bqv> | yes... |
| 2020-11-11 06:41:45 | <c_wraith> | :t at |
| 2020-11-11 06:41:46 | <lambdabot> | (At m, Functor f) => Index m -> (Maybe (IxValue m) -> f (Maybe (IxValue m))) -> m -> f m |
| 2020-11-11 06:42:17 | <bqv> | :t at undefined |
| 2020-11-11 06:42:18 | <lambdabot> | (At m, Functor f) => (Maybe (IxValue m) -> f (Maybe (IxValue m))) -> m -> f m |
| 2020-11-11 06:42:44 | <c_wraith> | I mean, the class stuff is making that complicated for no reason |
| 2020-11-11 06:43:02 | <c_wraith> | Strip that away, and you've got a type like Lens s t (Maybe a) (Maybe b) |
| 2020-11-11 06:43:07 | → | thir joins (~thir@p200300f27f0b7e00894576386620b0d0.dip0.t-ipconnect.de) |
| 2020-11-11 06:44:05 | <c_wraith> | or Lens' s (Maybe a) if you can't change types |
| 2020-11-11 06:45:14 | <bqv> | see the frustrating part is that my current lens has that type |
| 2020-11-11 06:45:34 | <bqv> | but then if i try ``inhabited ^.. focus`` i get [Just val] instead of [val] |
| 2020-11-11 06:45:50 | <bqv> | so i feel like there's some constraint applied one functor too high or something |
| 2020-11-11 06:45:52 | <c_wraith> | Oh, you want to skip the _Just part? |
| 2020-11-11 06:45:58 | <c_wraith> | That's not going to work |
| 2020-11-11 06:46:06 | <bqv> | oh |
| 2020-11-11 06:46:27 | → | danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) |
| 2020-11-11 06:47:32 | × | thir quits (~thir@p200300f27f0b7e00894576386620b0d0.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-11-11 06:47:53 | <c_wraith> | the problem there is that you can't have traversal-like behavior (skipping Nothing values with toListOf) at the same time as you have lens-like behavior (setting to Nothing to delete) |
| 2020-11-11 06:48:27 | <c_wraith> | Nothing is either a target or it isn't. You can't have it both ways |
| 2020-11-11 06:48:32 | <bqv> | ack, so this is logically impossible |
| 2020-11-11 06:48:41 | <bqv> | half a day wasted.. |
| 2020-11-11 06:48:52 | <bqv> | so I suppose my best plan would be to separate the getter and setter, then |
| 2020-11-11 06:49:38 | <c_wraith> | Or just use _Just when needed. But yes, separating them is certainly attested. lens has both the Ix and At classes to handle the traversal and lens cases |
| 2020-11-11 06:50:13 | <bqv> | well, the problem is that the indexedlens's index cell is a partial function |
| 2020-11-11 06:50:24 | <bqv> | so in the situation that the value is Nothing, the index is undefined |
| 2020-11-11 06:50:28 | <bqv> | i was trying to avoid that |
| 2020-11-11 06:50:49 | → | shutdown_-h_now joins (~arjan@2001:1c06:2d0b:2312:c3b:76:7192:2636) |
| 2020-11-11 06:56:31 | <bqv> | ok nevermind, got this to with with some other form of type abuse |
| 2020-11-11 06:56:34 | × | da39a3ee5e6b4b0d quits (~da39a3ee5@cm-171-98-69-111.revip7.asianet.co.th) (Ping timeout: 246 seconds) |
| 2020-11-11 06:57:33 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@cm-171-98-69-111.revip7.asianet.co.th) |
| 2020-11-11 06:58:01 | hackage | uniqueness-periods-vector-examples 0.14.4.0 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.14.4.0 (OleksandrZhabenko) |
| 2020-11-11 06:58:05 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-11 07:02:52 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: leaving) |
| 2020-11-11 07:03:49 | → | Feuermagier_ joins (~Feuermagi@213.178.26.41) |
| 2020-11-11 07:05:53 | → | alp joins (~alp@88.126.45.36) |
| 2020-11-11 07:06:19 | × | Feuermagier quits (~Feuermagi@213.178.26.41) (Ping timeout: 265 seconds) |
| 2020-11-11 07:06:32 | → | tenniscp25 joins (~tenniscp2@node-14js.pool-125-25.dynamic.totinternet.net) |
All times are in UTC.