Newest at the top
| 2025-12-03 16:31:10 +0100 | <__monty__> | Yeah, that works. |
| 2025-12-03 16:30:47 +0100 | Googulator88 | (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-12-03 16:29:14 +0100 | Square2 | (~Square4@user/square) (Ping timeout: 260 seconds) |
| 2025-12-03 16:28:37 +0100 | merijn | (~merijn@77.242.116.146) (Ping timeout: 265 seconds) |
| 2025-12-03 16:27:54 +0100 | <lambdabot> | [2,4,6,8,10,12,14,16,18,20] |
| 2025-12-03 16:27:51 +0100 | <kuribas`> | > foldr (\(x:xs) xs2 -> if False then (x:xs) else (x*2) : xs2) [] (init $ tails [1..10]) -- __monty__ |
| 2025-12-03 16:27:23 +0100 | <__monty__> | Yes, already mentioned that. |
| 2025-12-03 16:26:09 +0100 | akegalj | (~akegalj@141-138-27-206.dsl.iskon.hr) (Quit: leaving) |
| 2025-12-03 16:22:58 +0100 | st_aldini | (~Thunderbi@2605:a601:a07c:7400:6e26:f360:f11d:472c) st_aldini |
| 2025-12-03 16:22:30 +0100 | st_aldini | (~Thunderbi@2605:a601:a07c:7400:6e26:f360:f11d:472c) (Quit: st_aldini) |
| 2025-12-03 16:21:12 +0100 | aljazmc | (~aljazmc@user/aljazmc) aljazmc |
| 2025-12-03 16:16:54 +0100 | <lucabtz> | yep |
| 2025-12-03 16:16:46 +0100 | <lambdabot> | [2,4,6,8,10,6,7,8,9,10] |
| 2025-12-03 16:16:43 +0100 | <kuribas`> | > let (xs, ys) = break (> 5) [1..10] in map (*2) xs ++ ys |
| 2025-12-03 16:16:26 +0100 | bitdex_ | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 2025-12-03 16:15:59 +0100 | <kuribas`> | sure |
| 2025-12-03 16:15:40 +0100 | <lucabtz> | or span |
| 2025-12-03 16:15:27 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) sord937 |
| 2025-12-03 16:15:15 +0100 | <kuribas`> | break? |
| 2025-12-03 16:15:02 +0100 | <lucabtz> | kuribas` if there is no state can't you just use break |
| 2025-12-03 16:14:07 +0100 | califax_ | califax |
| 2025-12-03 16:14:06 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Ping timeout: 272 seconds) |
| 2025-12-03 16:14:06 +0100 | califax | (~califax@user/califx) (Ping timeout: 272 seconds) |
| 2025-12-03 16:14:06 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 272 seconds) |
| 2025-12-03 16:13:49 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) chexum |
| 2025-12-03 16:12:22 +0100 | califax_ | (~califax@user/califx) califx |
| 2025-12-03 16:11:00 +0100 | <lambdabot> | [2,4,6,8,5,6,7,8,9,10] |
| 2025-12-03 16:11:00 +0100 | <__monty__> | But the idea works. |
| 2025-12-03 16:10:56 +0100 | <kuribas`> | > foldr (\(x:xs) cont s -> if (s > 7) then (x:xs) else (x*2) : cont (s+x)) (const []) (tails [1..10]) 0 |
| 2025-12-03 16:10:56 +0100 | spew | (~spew@user/spew) spew |
| 2025-12-03 16:10:44 +0100 | <__monty__> | This is the missing case analysis I was referring to. |
| 2025-12-03 16:10:39 +0100 | spew | (~spew@user/spew) (Quit: nyaa~) |
| 2025-12-03 16:10:30 +0100 | <lambdabot> | [2,4,6,8,10,12,14,16,18,20*Exception: <interactive>:3:8-59: Non-exhaustive p... |
| 2025-12-03 16:10:27 +0100 | <__monty__> | > foldr (\(x:xs) xs2 -> if False then (x:xs) else (x*2) : xs2) [] (tails [1..10]) |
| 2025-12-03 16:10:08 +0100 | gawen | (~gawen@user/gawen) gawen |
| 2025-12-03 16:09:40 +0100 | wbooze | (~inline@cgn-195-14-221-120.nc.de) (Quit: Leaving) |
| 2025-12-03 16:09:08 +0100 | <kuribas`> | You can use the continuation if you need to pass some state. |
| 2025-12-03 16:08:44 +0100 | <lambdabot> | [2,4,6,8,10,6,7,8,9,10] |
| 2025-12-03 16:08:41 +0100 | <kuribas`> | > foldr (\(x:xs) xs2 -> if (x > 5) then (x:xs) else (x*2) : xs2) [] (tails [1..10]) |
| 2025-12-03 16:08:38 +0100 | <kuribas`> | Actually, this doesn't use the continuation ... |
| 2025-12-03 16:07:41 +0100 | <__monty__> | Hmm, no the span/break would need to carry state forward. |
| 2025-12-03 16:07:06 +0100 | <__monty__> | Feels a lot like span/break and folding the fst. |
| 2025-12-03 16:05:52 +0100 | <__monty__> | Only shortcoming is if the condition is never fulfilled, needs more case analysis. |
| 2025-12-03 16:05:29 +0100 | lucabtz | (~lucabtz@user/lucabtz) lucabtz |
| 2025-12-03 16:04:45 +0100 | amadaluzia | (~amadaluzi@user/amadaluzia) amadaluzia |
| 2025-12-03 16:04:39 +0100 | <kuribas`> | --proof that it doesn't visit the tail :) |
| 2025-12-03 16:04:26 +0100 | <lambdabot> | [2,4,6,8,10,6,7,8,9,10] |
| 2025-12-03 16:04:23 +0100 | <kuribas`> | > take 10 $ foldr (\(x:xs) cont -> \xs2 -> if (x > 5) then (x:xs) else (x*2) : cont xs) id (tails [1..]) [] |
| 2025-12-03 16:03:03 +0100 | spew | (~spew@user/spew) spew |
| 2025-12-03 16:02:40 +0100 | lucabtz | (~lucabtz@user/lucabtz) (Remote host closed the connection) |