Logs: liberachat/#haskell
| 2021-07-16 17:48:21 | × | s_ quits (~s@50.34.81.185) (Quit: Leaving) |
| 2021-07-16 17:51:18 | <dsal> | lechner: iterateM_ is "straight recursion" it just has a name. |
| 2021-07-16 17:52:00 | <lechner> | dsal: thanks! |
| 2021-07-16 17:52:33 | × | derelict quits (~derelict@user/derelict) (Ping timeout: 250 seconds) |
| 2021-07-16 17:52:41 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 2021-07-16 17:52:54 | <dsal> | i.e., if you just needed this one thing, I wouldn't bring in monad-loops, but that implementation is trivial, so adding it and using common names is nice. `go` and `loop` and such are common mechanisms as well. There's nothing super wrong here. |
| 2021-07-16 17:53:06 | <dsal> | > iterate succ 0 |
| 2021-07-16 17:53:08 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2... |
| 2021-07-16 17:57:53 | × | guest61 quits (~xxx@47.245.54.240) (Remote host closed the connection) |
| 2021-07-16 17:58:00 | → | robot_el_gato joins (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) |
| 2021-07-16 17:58:34 | <lechner> | dsal: could i use 'iterate' as well? |
| 2021-07-16 17:59:00 | → | guest61 joins (~xxx@47.245.54.240) |
| 2021-07-16 17:59:22 | <dsal> | No, iterate`M` means it's monadic and iterateM`_` means it doesn't return the accumulated list. |
| 2021-07-16 17:59:30 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-16 17:59:43 | <lechner> | i see |
| 2021-07-16 18:00:16 | <dsal> | So `iterateM_` is exactly what you're asking for in the sense that you can pass in a counter and return a new counter value from your action, but doesn't accumulate all the counter values. |
| 2021-07-16 18:00:17 | <dsal> | :t iterate |
| 2021-07-16 18:00:18 | <lambdabot> | (a -> a) -> a -> [a] |
| 2021-07-16 18:00:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-16 18:01:01 | <dsal> | Iterate is great if you want to generate a list of generations of things where each is derived from the previous. |
| 2021-07-16 18:03:36 | <dsal> | You could make an even more specific thing such as `MonadIO m => (Int -> m ()) -> m ()` That does something like `iterateM_ (\x -> a x >> pure (x +1) 0` |
| 2021-07-16 18:03:53 | × | guest61 quits (~xxx@47.245.54.240) (Remote host closed the connection) |
| 2021-07-16 18:04:47 | <maerwald> | can you have distinct Readers via 'capability'? |
| 2021-07-16 18:05:00 | → | guest61 joins (~xxx@47.245.54.240) |
| 2021-07-16 18:05:37 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-16 18:06:51 | × | azeem quits (~azeem@dynamic-adsl-94-34-31-95.clienti.tiscali.it) (Ping timeout: 250 seconds) |
| 2021-07-16 18:07:27 | <zzz> | @hoogle iterateM |
| 2021-07-16 18:07:27 | <lambdabot> | Streaming.Prelude iterateM :: Monad m => (a -> m a) -> m a -> Stream (Of a) m r |
| 2021-07-16 18:07:27 | <lambdabot> | Util iterateM :: Monad m => Natural -> (a -> m a) -> a -> m (NonEmpty a) |
| 2021-07-16 18:07:27 | <lambdabot> | Streamly.Internal.Data.Stream.StreamD iterateM :: Monad m => (a -> m a) -> m a -> Stream m a |
| 2021-07-16 18:07:30 | × | peterhil quits (~peterhil@mobile-access-bceec8-93.dhcp.inet.fi) (Ping timeout: 268 seconds) |
| 2021-07-16 18:09:28 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-16 18:09:36 | → | azeem joins (~azeem@176.200.202.21) |
| 2021-07-16 18:12:21 | → | silverwhitefish joins (~hidden@47.202.102.10) |
| 2021-07-16 18:12:54 | × | wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-16 18:14:17 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 268 seconds) |
| 2021-07-16 18:14:18 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 2021-07-16 18:14:42 | → | hiruji joins (~hiruji@user/hiruji) |
| 2021-07-16 18:15:25 | → | peterhil joins (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) |
| 2021-07-16 18:17:05 | × | azeem quits (~azeem@176.200.202.21) (Read error: Connection reset by peer) |
| 2021-07-16 18:17:16 | × | retroid_ quits (~retro@97e2ba5d.skybroadband.com) (Read error: Connection reset by peer) |
| 2021-07-16 18:17:59 | → | retroid_ joins (~retro@97e2ba5d.skybroadband.com) |
| 2021-07-16 18:19:23 | → | azeem joins (~azeem@dynamic-adsl-94-34-31-95.clienti.tiscali.it) |
| 2021-07-16 18:20:51 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-16 18:21:54 | × | burnsidesLlama quits (~burnsides@dhcp168-025.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-07-16 18:24:09 | × | cheater quits (~Username@user/cheater) (Ping timeout: 268 seconds) |
| 2021-07-16 18:24:51 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-07-16 18:25:59 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-16 18:26:43 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-16 18:26:52 | → | cheater joins (~Username@84-115-12-132.cable.dynamic.surfer.at) |
| 2021-07-16 18:27:35 | → | krz3si joins (~quassel@2a02:a31c:853b:b780:96f1:ff36:4051:20c7) |
| 2021-07-16 18:27:47 | × | robot_el_gato quits (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) (Quit: Ping timeout (120 seconds)) |
| 2021-07-16 18:28:57 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-07-16 18:29:51 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 255 seconds) |
| 2021-07-16 18:30:43 | × | Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving) |
| 2021-07-16 18:34:06 | × | shutdown_-h_now quits (~arjan@82-75-187-100.cable.dynamic.v4.ziggo.nl) (Ping timeout: 265 seconds) |
| 2021-07-16 18:41:00 | → | shutdown_-h_now joins (~arjan@82-75-187-100.cable.dynamic.v4.ziggo.nl) |
| 2021-07-16 18:42:03 | × | mcglk_ quits (~mcglk@131.191.49.120) (Read error: Connection reset by peer) |
| 2021-07-16 18:42:30 | → | mcglk joins (~mcglk@131.191.49.120) |
| 2021-07-16 18:43:08 | → | robot_el_gato joins (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) |
| 2021-07-16 18:43:17 | → | __xor joins (~xor@74.215.232.67) |
| 2021-07-16 18:43:36 | × | _xor quits (~xor@74.215.232.67) (Read error: Connection reset by peer) |
| 2021-07-16 18:43:45 | × | Null_A quits (~null_a@2601:645:8700:2290:f84f:8a6f:2960:e8a4) (Remote host closed the connection) |
| 2021-07-16 18:44:27 | → | Null_A joins (~null_a@2601:645:8700:2290:f84f:8a6f:2960:e8a4) |
| 2021-07-16 18:44:29 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 2021-07-16 18:48:20 | × | __xor quits (~xor@74.215.232.67) (Read error: Connection reset by peer) |
| 2021-07-16 18:48:53 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 250 seconds) |
| 2021-07-16 18:49:36 | → | __xor joins (~xor@74.215.232.67) |
| 2021-07-16 18:51:54 | × | mikoto-chan quits (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) (Ping timeout: 268 seconds) |
| 2021-07-16 18:54:46 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-16 18:55:29 | → | zebrag joins (~chris@user/zebrag) |
| 2021-07-16 18:57:11 | → | burnsidesLlama joins (~burnsides@dhcp168-025.wadham.ox.ac.uk) |
| 2021-07-16 18:57:49 | × | Null_A quits (~null_a@2601:645:8700:2290:f84f:8a6f:2960:e8a4) (Remote host closed the connection) |
| 2021-07-16 18:57:55 | × | robot_el_gato quits (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) (Ping timeout: 246 seconds) |
| 2021-07-16 18:58:05 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.0.1) |
| 2021-07-16 18:58:06 | → | Null_A joins (~null_a@2601:645:8700:2290:f84f:8a6f:2960:e8a4) |
| 2021-07-16 19:01:07 | → | derelict joins (~derelict@user/derelict) |
| 2021-07-16 19:01:46 | × | burnsidesLlama quits (~burnsides@dhcp168-025.wadham.ox.ac.uk) (Ping timeout: 268 seconds) |
| 2021-07-16 19:01:53 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-16 19:02:58 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-16 19:04:50 | → | hexfive joins (~eric@50.35.83.177) |
| 2021-07-16 19:14:40 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-16 19:15:26 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-07-16 19:20:08 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-16 19:24:09 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-16 19:24:54 | → | robot_el_gato joins (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) |
| 2021-07-16 19:24:59 | × | robot_el_gato quits (~robot_el_@2600:1700:7df0:4f30:19da:dcae:83bc:1622) (Client Quit) |
| 2021-07-16 19:27:32 | × | fendor quits (~fendor@77.119.213.12.wireless.dyn.drei.com) (Remote host closed the connection) |
| 2021-07-16 19:28:06 | → | wallymathieu joins (~wallymath@81-234-151-21-no94.tbcn.telia.com) |
| 2021-07-16 19:29:29 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 2021-07-16 19:30:52 | → | fendor joins (~fendor@77.119.213.12.wireless.dyn.drei.com) |
| 2021-07-16 19:32:46 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-07-16 19:35:42 | <lechner> | Hi, do most people here prefer Data.Text over String when appropriate? |
| 2021-07-16 19:36:58 | <Rembane> | lechner: Yes! |
| 2021-07-16 19:38:11 | × | Guest9 quits (~Guest9@103.249.234.210) (Quit: Connection closed) |
| 2021-07-16 19:39:25 | <janus> | what was typical example with a 'read' blowing up with a long string? |
| 2021-07-16 19:41:44 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 2021-07-16 19:42:23 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: Lost terminal) |
| 2021-07-16 19:46:10 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds) |
| 2021-07-16 19:46:56 | → | Guest98 joins (~Guest98@187.83.249.216.dyn.smithville.net) |
All times are in UTC.