Newest at the top
2025-09-26 04:51:49 +0200 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
2025-09-26 04:49:43 +0200 | vanishingideal | (~vanishing@user/vanishingideal) (Ping timeout: 240 seconds) |
2025-09-26 04:44:43 +0200 | <Leary> | It can still be a fine one-liner: `_singular = prism pure \case{ [x] -> Right x; xs -> Left xs }` |
2025-09-26 04:38:09 +0200 | <dcpagan> | Would have been nice to generically compose my prism with _Cons and _Empty; I thought I was clever with that one-liner. |
2025-09-26 04:36:50 +0200 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
2025-09-26 04:35:06 +0200 | vanishing | (~vanishing@user/vanishingideal) (Ping timeout: 248 seconds) |
2025-09-26 04:32:50 +0200 | <dibblego> | you can review [Review, Prism, Iso, Equality] |
2025-09-26 04:32:22 +0200 | <dibblego> | i.e. Traversal is not Review |
2025-09-26 04:32:02 +0200 | <dibblego> | no, you cannot review a traversal, which can be seen in this diagram: https://hackage.haskell.org/package/lens |
2025-09-26 04:30:49 +0200 | <dibblego> | ok yes that works on the head of a single-element list |
2025-09-26 04:29:18 +0200 | <dcpagan> | So I can't review Traversals? |
2025-09-26 04:28:54 +0200 | <dcpagan> | h:t -> if null t then Right h else Left (h:t) |
2025-09-26 04:28:52 +0200 | <dcpagan> | [] -> Left [] |
2025-09-26 04:28:50 +0200 | <dcpagan> | _singular = prism (:[]) $ \case |
2025-09-26 04:28:48 +0200 | <dcpagan> | _singular :: Prism' [a] a |
2025-09-26 04:28:46 +0200 | <dcpagan> | This works: |
2025-09-26 04:26:27 +0200 | <dibblego> | you could use preview, but it will always return Nothing, by single element do you mean the head of the list? You cannot have that Prism, but you can have the Traversal |
2025-09-26 04:24:04 +0200 | jrm | (~jrm@user/jrm) jrm |
2025-09-26 04:23:48 +0200 | jrm | (~jrm@user/jrm) (Quit: ciao) |
2025-09-26 04:22:49 +0200 | Square2 | (~Square@user/square) (Ping timeout: 264 seconds) |
2025-09-26 04:21:12 +0200 | astroanax | (~astroanax@2001:19f0:7402:f82:5400:1ff:fec4:f7d7) (Ping timeout: 256 seconds) |
2025-09-26 04:21:01 +0200 | peterbecich | (~Thunderbi@syn-172-222-149-049.res.spectrum.com) (Ping timeout: 264 seconds) |
2025-09-26 04:19:42 +0200 | arandombit | (~arandombi@user/arandombit) arandombit |
2025-09-26 04:19:42 +0200 | arandombit | (~arandombi@2603:7000:4600:ffbe:ddc9:88a6:9e65:4919) (Changing host) |
2025-09-26 04:19:41 +0200 | arandombit | (~arandombi@2603:7000:4600:ffbe:ddc9:88a6:9e65:4919) |
2025-09-26 04:19:23 +0200 | inline | (~inline@ip-005-146-196-132.um05.pools.vodafone-ip.de) (Ping timeout: 265 seconds) |
2025-09-26 04:18:56 +0200 | annamalai | (~annamalai@2409:4042:d8e:423e::9e8a:bb11) annamalai |
2025-09-26 04:16:39 +0200 | Square2 | (~Square@user/square) Square |
2025-09-26 04:15:46 +0200 | <dcpagan> | How does review work with prisms? |
2025-09-26 04:15:22 +0200 | <dcpagan> | `_single # 1` does not work. |
2025-09-26 04:14:57 +0200 | <dcpagan> | However, I cannot review on it. |
2025-09-26 04:14:48 +0200 | <dcpagan> | It works on my code: It works on my code: https://github.com/DCPagan/Exercism-Haskell/blob/master/go-counting/src/Counting.hs#L57-L58 |
2025-09-26 04:13:56 +0200 | inline | (~inline@ip-005-146-196-132.um05.pools.vodafone-ip.de) Inline |
2025-09-26 04:13:33 +0200 | <dcpagan> | _single = _Cons . aside _Empty . _1 |
2025-09-26 04:13:31 +0200 | <dcpagan> | _single :: (Cons s s a a, AsEmpty s) => Traversal' s a |
2025-09-26 04:13:15 +0200 | <dcpagan> | I want to define a prism that matches a list with a single element, and then get that element. |
2025-09-26 04:03:40 +0200 | arandombit | (~arandombi@user/arandombit) (Ping timeout: 244 seconds) |
2025-09-26 04:02:31 +0200 | peterbecich | (~Thunderbi@syn-172-222-149-049.res.spectrum.com) peterbecich |
2025-09-26 03:59:23 +0200 | arandombit | (~arandombi@user/arandombit) arandombit |
2025-09-26 03:59:23 +0200 | arandombit | (~arandombi@2603:7000:4600:ffbe:ddc9:88a6:9e65:4919) (Changing host) |
2025-09-26 03:59:23 +0200 | arandombit | (~arandombi@2603:7000:4600:ffbe:ddc9:88a6:9e65:4919) |
2025-09-26 03:57:33 +0200 | qqe | (~qqq@185.54.23.100) |
2025-09-26 03:56:28 +0200 | arandombit | (~arandombi@user/arandombit) (Ping timeout: 255 seconds) |
2025-09-26 03:41:07 +0200 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) humasect |
2025-09-26 03:35:43 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
2025-09-26 03:33:35 +0200 | ChanServ | +v haskellbridge |
2025-09-26 03:33:35 +0200 | haskellbridge | (~hackager@syn-096-028-224-214.res.spectrum.com) hackager |
2025-09-26 03:32:27 +0200 | haskellbridge | (~hackager@syn-096-028-224-214.res.spectrum.com) (Remote host closed the connection) |
2025-09-26 03:30:59 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-09-26 03:25:36 +0200 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |