Logs: liberachat/#haskell
| 2026-01-22 01:42:55 | × | FANTOM quits (~fantom@87.75.185.177) (Ping timeout: 240 seconds) |
| 2026-01-22 01:44:10 | → | FANTOM joins (~fantom@87.75.185.177) |
| 2026-01-22 01:44:14 | × | connrs quits (~connrs@user/connrs) (Ping timeout: 244 seconds) |
| 2026-01-22 01:44:53 | → | omidmash1 joins (~omidmash@user/omidmash) |
| 2026-01-22 01:45:14 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds) |
| 2026-01-22 01:46:49 | × | omidmash quits (~omidmash@user/omidmash) (Ping timeout: 244 seconds) |
| 2026-01-22 01:46:49 | omidmash1 | is now known as omidmash |
| 2026-01-22 01:51:20 | → | typedfern_ joins (~Typedfern@192.red-83-37-37.dynamicip.rima-tde.net) |
| 2026-01-22 01:56:10 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 01:59:05 | → | connrs joins (~connrs@user/connrs) |
| 2026-01-22 02:00:52 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2026-01-22 02:05:41 | <haskellbridge> | <iqubic (she/her)> So, this is breaking my brain... How the heck is this the same as "liftA2" for lists: "cross f xs ys = foldr (\x rec -> (map (f x) ys) ++ rec) [] xs" |
| 2026-01-22 02:06:03 | × | vidak quits (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) (Read error: Connection reset by peer) |
| 2026-01-22 02:06:11 | <haskellbridge> | <iqubic (she/her)> cross is the same as liftA2 if you work on lists and I have no clue why!!! |
| 2026-01-22 02:07:00 | → | vidak joins (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) |
| 2026-01-22 02:07:42 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 2026-01-22 02:08:23 | <monochrom> | Convert foldr back to your own recursion to see. |
| 2026-01-22 02:08:47 | <ncf> | convert foldr to concatMap and remember how the list monad works |
| 2026-01-22 02:08:48 | <monochrom> | Alterantively convert your own recursion to foldr to see. :) |
| 2026-01-22 02:09:16 | <monochrom> | Or yeah, that. |
| 2026-01-22 02:09:21 | <haskellbridge> | <iqubic (she/her)> Yeah, that makes sense... |
| 2026-01-22 02:09:34 | <ncf> | cross f xs ys = xs >>= \x -> map (f x) ys = xs >>= \x -> ys >>= \y -> [f x y] = f <$> xs <*> ys |
| 2026-01-22 02:11:47 | <monochrom> | The reason I prefer functional programming is that I just do algebra and see how two programs do the same thing. As opposed to what most people do for imperative programming: talk in "English" "intuition (read: mince and bend words) and call that "understanding". (LLMs proved that it is not understanding.) |
| 2026-01-22 02:11:58 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 02:13:45 | × | vidak quits (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) (Read error: Connection reset by peer) |
| 2026-01-22 02:14:35 | × | FANTOM quits (~fantom@87.75.185.177) (Ping timeout: 240 seconds) |
| 2026-01-22 02:14:58 | → | vidak joins (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) |
| 2026-01-22 02:16:07 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2026-01-22 02:21:43 | <haskellbridge> | <iqubic (she/her)> I see... |
| 2026-01-22 02:21:55 | × | vidak quits (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) (Ping timeout: 264 seconds) |
| 2026-01-22 02:22:08 | → | vidak joins (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) |
| 2026-01-22 02:22:27 | <haskellbridge> | <iqubic (she/her)> for lists "sequenceA" is "foldr (liftA2 (:)) [[]]" |
| 2026-01-22 02:22:32 | <haskellbridge> | <iqubic (she/her)> Huh?!?!? How does that work? |
| 2026-01-22 02:23:27 | <haskellbridge> | <iqubic (she/her)> sequenceA [[11,12], [21,22]] = [[11,21],[11,22],[12,21],[12,22]] |
| 2026-01-22 02:23:49 | <haskellbridge> | <iqubic (she/her)> And "foldr (liftA2 (:)) [[]]" does the same thing. |
| 2026-01-22 02:25:17 | <monochrom> | I might rewrite "[[]]" as "pure []". |
| 2026-01-22 02:26:47 | × | vidak quits (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) (Remote host closed the connection) |
| 2026-01-22 02:27:20 | <haskellbridge> | <iqubic (she/her)> I see... that's very similar to "foldr (:) []", but with applicative actions. |
| 2026-01-22 02:27:21 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 02:28:17 | <haskellbridge> | <iqubic (she/her)> How does that compute a Cartesian product though? |
| 2026-01-22 02:29:06 | <haskellbridge> | <iqubic (she/her)> "cart [[11,12], [21,22]]" is "[[11,21,22],[12,21,22]]" |
| 2026-01-22 02:29:58 | <haskellbridge> | <iqubic (she/her)> Erm... not that. It's late and I'm tired. |
| 2026-01-22 02:30:44 | <haskellbridge> | <iqubic (she/her)> But sequenceA "foldr (liftA2 (:)) (pure [])" is a Cartesian product, and I'm not sure why. |
| 2026-01-22 02:31:58 | → | vidak joins (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) |
| 2026-01-22 02:32:13 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
| 2026-01-22 02:43:08 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 02:45:49 | <geekosaur> | list monad with no actions is Cartesian product. maybe you'd find the list comprehension version easier to interpret? |
| 2026-01-22 02:47:40 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection) |
| 2026-01-22 02:48:44 | <haskellbridge> | <iqubic (she/her)> What's the list comprehension version? |
| 2026-01-22 02:48:56 | × | tremon quits (~tremon@83.80.159.219) (Quit: getting boxed in) |
| 2026-01-22 02:49:20 | × | Inline quits (~User@2001-4dd6-dd24-0-41c1-f819-9bd9-d884.ipv6dyn.netcologne.de) (Ping timeout: 244 seconds) |
| 2026-01-22 02:49:51 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2026-01-22 02:49:51 | × | typedfern_ quits (~Typedfern@192.red-83-37-37.dynamicip.rima-tde.net) (Ping timeout: 244 seconds) |
| 2026-01-22 02:49:55 | <haskellbridge> | <iqubic (she/her)> Why isn't this compiling? https://paste.tomsmeding.com/7dBnZHnU |
| 2026-01-22 02:52:47 | <haskellbridge> | <iqubic (she/her)> I want a function that computes all the ways to drop a single element from a list. |
| 2026-01-22 02:53:04 | <haskellbridge> | <iqubic (she/her)> drop1 [1,2,3] -> [[2,3], [1,3], [1,2]] |
| 2026-01-22 02:53:46 | <geekosaur> | xs is [a], drop1 xs is [[a]], map's result type will be the same as its input type as (x:) simply prepends to the inner lists |
| 2026-01-22 02:56:20 | <haskellbridge> | <iqubic (she/her)> I have "map (x:) (drop1 xs)" |
| 2026-01-22 02:56:36 | × | vidak quits (~vidak@2407:e400:7800:2c01:d0be:76f8:cc84:bd4a) (Remote host closed the connection) |
| 2026-01-22 02:56:57 | <haskellbridge> | <iqubic (she/her)> (x:) :: [a] -> [a] |
| 2026-01-22 02:57:30 | <haskellbridge> | <iqubic (she/her)> (drop1 xs) :: [[a]] |
| 2026-01-22 02:57:35 | <haskellbridge> | <iqubic (she/her)> I fail to see the issue here. |
| 2026-01-22 02:57:56 | <geekosaur> | xxs is only [a], not [[a]] |
| 2026-01-22 02:58:20 | <haskellbridge> | <iqubic (she/her)> xxs? |
| 2026-01-22 02:58:32 | <geekosaur> | rename the one in map, maybe it'll be a bit clearer (its "[a]" unifies with the "[[a]]" from drop1) |
| 2026-01-22 02:58:56 | <haskellbridge> | <Nguyễn Trọng Cường> I have a really stupid question: Is the very first GHC executable written in C? I analysed some modern GHC programs by Detect It Easy and all of them are flagged as "C" and "MinGW" |
| 2026-01-22 02:58:59 | <haskellbridge> | <iqubic (she/her)> I'm trying to use the head of the iinput. |
| 2026-01-22 02:59:25 | <haskellbridge> | <iqubic (she/her)> I'm so lost here... What am I missing? |
| 2026-01-22 03:01:10 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 03:01:25 | <geekosaur> | ghc was originally written in HBC, a now lost compiler which was itself written in Lazy ML |
| 2026-01-22 03:02:29 | → | Inline joins (~User@2001-4dd6-dd24-0-288a-d894-752e-65cf.ipv6dyn.netcologne.de) |
| 2026-01-22 03:02:54 | <geekosaur> | I think there's an ancient i386 binary for HBC somewhere, but no source and no guarantee the binary would run on modern systems |
| 2026-01-22 03:03:14 | <haskellbridge> | <iqubic (she/her)> geekosaur: Am I missing something obvious here? |
| 2026-01-22 03:03:19 | <haskellbridge> | <iqubic (she/her)> drop1 (x:xs) = xs ++ map (x:) (drop1 xs) |
| 2026-01-22 03:03:43 | <EvanR> | and lazy ML was written in |
| 2026-01-22 03:03:49 | <geekosaur> | drop1 :: [a] -> [[a]] |
| 2026-01-22 03:03:50 | <EvanR> | rather the compiler for it |
| 2026-01-22 03:04:09 | <EvanR> | (unlikely to still be available and functioning) |
| 2026-01-22 03:04:10 | <geekosaur> | map (x:) (drop1 xs) :: [[a]] -> [[a]] |
| 2026-01-22 03:04:15 | <geekosaur> | xs :: [a] |
| 2026-01-22 03:04:55 | × | Raito_Bezarius quits (~Raito@libera/contributor/wireguard.tunneler.raito-bezarius) (Ping timeout: 245 seconds) |
| 2026-01-22 03:05:06 | <geekosaur> | yeh, I have no clue about LML |
| 2026-01-22 03:05:33 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
| 2026-01-22 03:05:36 | <haskellbridge> | <iqubic (she/her)> How can I fix my code here? |
| 2026-01-22 03:06:55 | <geekosaur> | I'm not quite sure what you're trying to do, to be honest. (in part because my focus is all over the place, I'm working on cabal atm and chasing around various housework things…) |
| 2026-01-22 03:07:04 | <haskellbridge> | <iqubic (she/her)> I see.... |
| 2026-01-22 03:07:21 | <haskellbridge> | <iqubic (she/her)> I want a function that computes all the ways to remove a single element from a list. |
| 2026-01-22 03:07:28 | <haskellbridge> | <iqubic (she/her)> drop1 [1,2,3] -> [[2,3], [1,3], [1,2]] |
| 2026-01-22 03:10:35 | × | qqq quits (~qqq@185.54.21.105) (Quit: Lost terminal) |
| 2026-01-22 03:11:11 | <haskellbridge> | <iqubic (she/her)> drop1 (x:xs) = xs : map (\ys -> x:ys) (drop1 xs) |
| 2026-01-22 03:11:15 | <haskellbridge> | <iqubic (she/her)> That's what I wanted. |
| 2026-01-22 03:12:52 | <haskellbridge> | <iqubic (she/her)> I feel like there should be a way to rewrite this with a foldr: https://paste.tomsmeding.com/nV162kId |
| 2026-01-22 03:15:10 | <haskellbridge> | <iqubic (she/her)> Or, if not a fold, something else that factors out the manual recursion |
| 2026-01-22 03:16:30 | <Leary> | > (zipWith (++) . inits <*> tail . tails) [1,2,3] |
| 2026-01-22 03:16:32 | <lambdabot> | [[2,3],[1,3],[1,2]] |
| 2026-01-22 03:16:32 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-01-22 03:17:14 | <haskellbridge> | <iqubic (she/her)> I don't need that specific ordering, but those are the sets I want. |
| 2026-01-22 03:17:22 | <haskellbridge> | <iqubic (she/her)> If shuffling the ordering is better, feel free to do it. |
| 2026-01-22 03:17:53 | <haskellbridge> | <iqubic (she/her)> I want each list to contain N-1 elements of the input list, in some order. |
| 2026-01-22 03:18:03 | → | Raito_Bezarius joins (~Raito@libera/contributor/wireguard.tunneler.raito-bezarius) |
All times are in UTC.