Newest at the top
2024-09-02 03:42:14 +0200 | <weary-traveler> | yeah, perhaps the lack of explicitly mentioning laziness was the missing piece |
2024-09-02 03:41:06 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
2024-09-02 03:40:51 +0200 | <geekosaur> | (lists are lazy) |
2024-09-02 03:40:42 +0200 | <geekosaur> | you can do it in multiple steps, you know. if you `takeWhile whatever (fmap …)` the fmap will stop automatically when takeWhile does |
2024-09-02 03:37:06 +0200 | <albet70> | athan , reduce the list to something is already filter |
2024-09-02 03:36:25 +0200 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) |
2024-09-02 03:36:13 +0200 | <weary-traveler> | heh |
2024-09-02 03:36:06 +0200 | <geekosaur> | rip your sanity |
2024-09-02 03:35:23 +0200 | <yahb2> | 2 ; 4 ; 6 ; 8 ; 10 ; 12 ; 14 ; 16 ; 18 ; 20 ; 22 ; 24 ; 26 ; 28 ; 30 ; 32 ; 34 ; 36 ; 38 ; 40 ; 42 |
2024-09-02 03:35:23 +0200 | <probie> | % (`runContT` pure) $ callCC $ \break -> forM_ [1..100] $ \i -> do { when (even i) $ lift $ print i; when (i == 42) $ break() } |
2024-09-02 03:35:07 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-09-02 03:32:45 +0200 | <athan> | I forgot about takeWhile, that's a better choice |
2024-09-02 03:32:09 +0200 | <athan> | albet70 this is usually done with a fold rather than a uniform mapping or something that's guarateed to affect all cases. If you're "looking" for something, maybe `findIndex` would work. But if you're trying to "do something to everything until a condition is met", I'd reduce the list to something that represents the data you want to manage, then apply your map or what have you. |
2024-09-02 03:31:55 +0200 | <albet70> | lets assum filter on a list, filter (> 0) [1..22] when the matching item is above five, stop filter the rest, return immediatly |
2024-09-02 03:31:30 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Excess Flood) |
2024-09-02 03:31:29 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-02 03:30:33 +0200 | <lambdabot> | [0,2,4] |
2024-09-02 03:30:31 +0200 | <weary-traveler> | > takeWhile even [0,2,4,5,6,8,10] |
2024-09-02 03:30:28 +0200 | <weary-traveler> | albet70: something like takeWhile ? |
2024-09-02 03:27:43 +0200 | <probie> | What does it mean to `break` in a functional language? |
2024-09-02 03:27:39 +0200 | <probie> | <bad joke>just call `error` and thiings will break</bad joke> |
2024-09-02 03:26:08 +0200 | athan | (~athan@syn-098-153-145-140.biz.spectrum.com) |
2024-09-02 03:25:44 +0200 | athan | (~athan@syn-098-153-145-140.biz.spectrum.com) (Ping timeout: 272 seconds) |
2024-09-02 03:22:25 +0200 | tt123109783243 | (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) |
2024-09-02 03:21:53 +0200 | tt123109783243 | (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) (Quit: The Lounge - https://thelounge.chat) |
2024-09-02 03:21:18 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
2024-09-02 03:19:58 +0200 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2024-09-02 03:16:02 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-02 03:15:38 +0200 | <albet70> | break can break the for loop in python, is there something can break in fmap or filter? |
2024-09-02 03:07:15 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-09-02 03:02:40 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-02 02:52:10 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
2024-09-02 02:47:14 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-02 02:42:28 +0200 | JuanDaugherty | (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
2024-09-02 02:38:17 +0200 | Mateon2 | Mateon1 |
2024-09-02 02:36:44 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-09-02 02:35:59 +0200 | Mateon2 | (~Thunderbi@user/meow/Mateon1) |
2024-09-02 02:35:48 +0200 | Mateon1 | (~Thunderbi@user/meow/Mateon1) (Ping timeout: 252 seconds) |
2024-09-02 02:35:36 +0200 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) (Client Quit) |
2024-09-02 02:35:31 +0200 | <jackdk> | IIRC laziness means that applicative parsers can do a bit more than parse CFGs but I don't recall the details |
2024-09-02 02:32:41 +0200 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) |
2024-09-02 02:31:48 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-02 02:31:17 +0200 | tomboy64 | (~tomboy64@user/tomboy64) |
2024-09-02 02:31:05 +0200 | <hololeap> | I think it was the chomsky hierarchy |
2024-09-02 02:27:34 +0200 | <hololeap> | I seem to remember a hierarchy of parsers that roughly correlates to parsing that can be done exclusively with Applicative vs parsing that requires Monad. does anyone know what I'm thinking of? |
2024-09-02 02:26:15 +0200 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in) |
2024-09-02 02:20:46 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-09-02 02:18:43 +0200 | tomboy64 | (~tomboy64@user/tomboy64) (Ping timeout: 264 seconds) |
2024-09-02 02:16:07 +0200 | Guest21 | (~Guest75@2600:387:15:1511::c) (Client Quit) |
2024-09-02 02:15:23 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |