2024-05-11 00:02:09 +0200 | <EvanR> | > 1.797e308 |
2024-05-11 00:02:11 +0200 | <lambdabot> | 1.797e308 |
2024-05-11 00:02:20 +0200 | <EvanR> | heh |
2024-05-11 00:05:39 +0200 | <EvanR> | > encodeFloat (2^52 - 1) (1024 - 52) |
2024-05-11 00:05:40 +0200 | <lambdabot> | 1.7976931348623155e308 |
2024-05-11 00:06:43 +0200 | <mauke> | > succ 1e16 > 1e16 |
2024-05-11 00:06:44 +0200 | <lambdabot> | False |
2024-05-11 00:08:10 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-05-11 00:09:28 +0200 | son0p | (~ff@152.203.77.121) |
2024-05-11 00:09:33 +0200 | mankanor | (~mankanor@2001:4455:20b:1d00:2153:5fb:f743:bfa3) |
2024-05-11 00:09:34 +0200 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-05-11 00:10:28 +0200 | mankanor | (~mankanor@2001:4455:20b:1d00:2153:5fb:f743:bfa3) (Read error: Connection reset by peer) |
2024-05-11 00:15:56 +0200 | mikess | (~mikess@user/mikess) |
2024-05-11 00:16:26 +0200 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2024-05-11 00:17:13 +0200 | Feuermagier | (~Feuermagi@user/feuermagier) |
2024-05-11 00:22:47 +0200 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 264 seconds) |
2024-05-11 00:23:07 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-05-11 00:36:37 +0200 | philopsos | (~caecilius@user/philopsos) (Ping timeout: 256 seconds) |
2024-05-11 01:08:11 +0200 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2024-05-11 01:15:56 +0200 | Ryan86 | (~Ryan@2601:602:8b00:b0f0:8dcb:b30d:2976:cb47) |
2024-05-11 01:16:08 +0200 | <Ryan86> | Hey all, was trying to get some help on a small project I've been using generic-lenses for. Mainly to understand a type signature: So I created a helper operator ?. for usage similar to Kotlins ?. for nested nullable access. So If I have a data structure like Foo { bar = Maybe (Baz { biz = Maybe Int } ) } I could do something like foo ^? bar ?. |
2024-05-11 01:16:08 +0200 | <Ryan86> | baz. I'm using the haskell language server in neovim, and the resulting type signature of the equation "lens1 ?. lens2 = lens1 . _Just . lens2" is "(?.) :: (Choice p, Applicative f) => (p (Maybe a1) (f (Maybe b)) -> c) -> (a2 -> p a1 (f b)) -> a2 -> c". I've been trying to parse this out for a while now so hopefully I can rewrite it using the Lens' |
2024-05-11 01:16:09 +0200 | <Ryan86> | and Prism' type aliases to make it a little easier to understand what's going on. Anybody have any experience with this? |
2024-05-11 01:19:40 +0200 | <c_wraith> | Ryan86: what's you're implementation? roughly like this? \x y -> x . _Just . y |
2024-05-11 01:20:13 +0200 | <Ryan86> | Yes exactly, what I have written is "lens1 ?. lens2 = lens1 . _Just . lens2" |
2024-05-11 01:20:27 +0200 | <ncf> | Ryan86: you could try something like ATraversal' a (Maybe b) -> ATraversal' b c -> Traversal' a c and complexify if needed |
2024-05-11 01:21:09 +0200 | <Ryan86> | Ah, so I should be using ATraversal' instead of Prism'. Let me plug that in. |
2024-05-11 01:21:14 +0200 | <ncf> | hmm that doesn't quite work |
2024-05-11 01:22:11 +0200 | <ncf> | just Traversal' works |
2024-05-11 01:26:31 +0200 | <Ryan86> | Ah looks like that's it. Any clue why Prism' a (Maybe b) -> Prism' b c -> Prism' a c wouldn't work the same? |
2024-05-11 01:27:51 +0200 | <ncf> | i mean that type checks, but you want to use it on non-Prisms |
2024-05-11 01:28:06 +0200 | <ncf> | like bar and baz |
2024-05-11 01:28:10 +0200 | <c_wraith> | Yeah, the problem is that it's asking too much from its arguments |
2024-05-11 01:29:15 +0200 | <c_wraith> | Also, you might want to modify the types to allow type-changing use. |
2024-05-11 01:30:14 +0200 | <c_wraith> | the definition allows type-changing, if you make the types a bit more general |
2024-05-11 01:31:29 +0200 | <ncf> | i can never remember what ATraversal & friends are for |
2024-05-11 01:31:39 +0200 | <ncf> | is it for when you don't have rank-2 types? |
2024-05-11 01:31:52 +0200 | <c_wraith> | They're for allowing you to accept a Traversal (or whatever) and use it with multiple types for f. |
2024-05-11 01:32:25 +0200 | <ncf> | isn't that like the opposite of what it does |
2024-05-11 01:32:32 +0200 | <ncf> | it specialises f to Bazaar |
2024-05-11 01:32:46 +0200 | <ncf> | or Baazar |
2024-05-11 01:32:53 +0200 | <c_wraith> | but then you have the various clone* functions to restore |
2024-05-11 01:33:17 +0200 | <ncf> | ok but what do you gain over just taking a Traversal? |
2024-05-11 01:33:56 +0200 | <c_wraith> | not using higher-rank types or a polymorphic wrapping type |
2024-05-11 01:34:17 +0200 | <ncf> | why wouldn't you want to use higher-rank types? |
2024-05-11 01:35:53 +0200 | <c_wraith> | some people are afraid of extensions. |
2024-05-11 01:36:01 +0200 | <dolio> | Inference, or putting them in containers. |
2024-05-11 01:36:13 +0200 | mima | (~mmh@aftr-62-216-211-22.dynamic.mnet-online.de) |
2024-05-11 01:38:25 +0200 | <ncf> | right, inference |
2024-05-11 01:38:51 +0200 | acidjnk_new | (~acidjnk@p200300d6e714dc66380a62904c39c61d.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
2024-05-11 01:40:55 +0200 | <ncf> | so to get the ATraversal version to work you could do cloneTraversal a . _Just . cloneTraversal b |
2024-05-11 01:40:58 +0200 | <ncf> | seems inefficien |
2024-05-11 01:40:59 +0200 | <ncf> | t |
2024-05-11 01:45:41 +0200 | kayvank | (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Ping timeout: 240 seconds) |
2024-05-11 01:45:52 +0200 | <c_wraith> | Honestly, I'd just do what lens itself does with a lot of these |
2024-05-11 01:46:04 +0200 | szkl | (uid110435@id-110435.uxbridge.irccloud.com) |
2024-05-11 01:46:20 +0200 | dolio | (~dolio@130.44.134.54) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-05-11 01:46:21 +0200 | <c_wraith> | Leave the checked type as the mess, then document it with "You can think of this as having this type" using the aliases |
2024-05-11 01:46:38 +0200 | <ncf> | yeah |
2024-05-11 01:46:41 +0200 | <c_wraith> | Then you don't need to worry about higher-rank types, because f scopes over the whole definition |
2024-05-11 01:48:15 +0200 | phma_ | (phma@2001:5b0:211f:3048:948d:80d2:e152:3a7b) |
2024-05-11 01:49:08 +0200 | <c_wraith> | well. it's in the type. declaration, not definition |
2024-05-11 01:49:53 +0200 | dolio | (~dolio@130.44.134.54) |
2024-05-11 01:50:32 +0200 | dolio | (~dolio@130.44.134.54) (Client Quit) |
2024-05-11 01:50:44 +0200 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-05-11 01:51:55 +0200 | phma | (phma@2001:5b0:211f:3048:6a1a:6f68:3864:d84f) (Ping timeout: 255 seconds) |
2024-05-11 01:53:42 +0200 | dolio | (~dolio@130.44.134.54) |
2024-05-11 01:57:14 +0200 | phma_ | phma |
2024-05-11 02:01:34 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-05-11 02:10:05 +0200 | tzh_ | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
2024-05-11 02:12:49 +0200 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) (Ping timeout: 256 seconds) |
2024-05-11 02:35:25 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 246 seconds) |
2024-05-11 02:47:16 +0200 | oo_miguel | (~Thunderbi@78-11-181-16.static.ip.netia.com.pl) (Ping timeout: 255 seconds) |
2024-05-11 02:59:30 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Quit: WeeChat 4.1.2) |
2024-05-11 03:01:07 +0200 | xff0x | (~xff0x@2405:6580:b080:900:b7f1:8627:ae1f:1fb0) (Ping timeout: 256 seconds) |
2024-05-11 03:02:07 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-05-11 03:04:59 +0200 | talismanick | (~user@2601:644:937c:ed10::ae5) (Ping timeout: 260 seconds) |
2024-05-11 03:05:16 +0200 | foul_owl | (~kerry@185.216.231.180) (Ping timeout: 255 seconds) |
2024-05-11 03:15:56 +0200 | otto_s | (~user@p4ff273b9.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2024-05-11 03:17:19 +0200 | otto_s | (~user@p5de2f4b0.dip0.t-ipconnect.de) |
2024-05-11 03:17:48 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 260 seconds) |
2024-05-11 03:19:29 +0200 | foul_owl | (~kerry@71.212.149.206) |
2024-05-11 03:23:45 +0200 | xff0x | (~xff0x@2405:6580:b080:900:b7f1:8627:ae1f:1fb0) |
2024-05-11 03:34:25 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 256 seconds) |
2024-05-11 03:47:07 +0200 | Ryan86 | (~Ryan@2601:602:8b00:b0f0:8dcb:b30d:2976:cb47) (Ping timeout: 250 seconds) |
2024-05-11 03:52:30 +0200 | arahael | (~arahael@119-18-1-21.771201.syd.nbn.aussiebb.net) |
2024-05-11 04:08:15 +0200 | mima | (~mmh@aftr-62-216-211-22.dynamic.mnet-online.de) (Ping timeout: 255 seconds) |
2024-05-11 04:17:23 +0200 | td_ | (~td@i5387091A.versanet.de) (Ping timeout: 252 seconds) |
2024-05-11 04:18:19 +0200 | hippoid | (~hippoid@user/hippoid) (Ping timeout: 268 seconds) |
2024-05-11 04:19:16 +0200 | madariaga | (~madariaga@user/madariaga) |
2024-05-11 04:19:22 +0200 | td_ | (~td@i53870939.versanet.de) |
2024-05-11 04:25:48 +0200 | xdminsy | (~xdminsy@117.147.70.240) |
2024-05-11 04:28:46 +0200 | Garbanzo | (~Garbanzo@2602:304:6eac:dc10::2e) |
2024-05-11 04:29:05 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer) |
2024-05-11 04:30:45 +0200 | foul_owl | (~kerry@71.212.149.206) (Ping timeout: 255 seconds) |
2024-05-11 04:31:37 +0200 | hippoid | (~hippoid@c-98-213-162-40.hsd1.il.comcast.net) |
2024-05-11 04:33:18 +0200 | systemhalted | (~systemhal@130.51.137.77) |
2024-05-11 04:34:51 +0200 | systemhalted | (~systemhal@130.51.137.77) (Remote host closed the connection) |
2024-05-11 04:45:15 +0200 | foul_owl | (~kerry@185.219.141.164) |
2024-05-11 05:58:55 +0200 | aforemny | (~aforemny@2001:9e8:6cd6:3600:97b7:283e:1ab8:36b5) |
2024-05-11 05:59:26 +0200 | tram | (~tram@2a02:586:7e3a:cb96:c7d7:78d4:c6de:913a) (Quit: Leaving.) |
2024-05-11 06:00:12 +0200 | aforemny_ | (~aforemny@2001:9e8:6cf2:cc00:4716:28bd:787d:4b08) (Ping timeout: 260 seconds) |
2024-05-11 06:36:32 +0200 | gawen | (~gawen@user/gawen) (Quit: cya) |
2024-05-11 06:37:55 +0200 | gawen | (~gawen@user/gawen) |
2024-05-11 06:51:23 +0200 | B-J | (~BenziJuni@232-148-209-31.dynamic.hringdu.is) (Ping timeout: 252 seconds) |
2024-05-11 06:53:08 +0200 | Benzi-Junior | (~BenziJuni@232-148-209-31.dynamic.hringdu.is) |
2024-05-11 06:55:55 +0200 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-05-11 06:57:25 +0200 | jle` | (~jle`@2603:8001:3b02:84d4:55f8:739e:3296:6d3) (Ping timeout: 268 seconds) |
2024-05-11 06:58:20 +0200 | mei | (~mei@user/mei) |