Newest at the top
2024-09-08 02:35:06 +0200 | <geekosaur> | (or sequence, as in your given code) |
2024-09-08 02:34:05 +0200 | <geekosaur> | also note that these examples are a little too oversimplified, since replicate is sufficient for them. but arbitrary requires replicateM, I think |
2024-09-08 02:32:37 +0200 | <geekosaur> | I guess the only reason to use the list comp is to avoid the import. it doesn't even avoid a dependency, since Control.Monad is in base |
2024-09-08 02:32:07 +0200 | <lambdabot> | replicateM n x = sequence (replicate n x) |
2024-09-08 02:32:07 +0200 | <dmj`> | @src replicateM |
2024-09-08 02:31:39 +0200 | <lambdabot> | Control.Monad, Data.Sequence |
2024-09-08 02:31:39 +0200 | <geekosaur> | @index replicateM |
2024-09-08 02:31:33 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 02:30:51 +0200 | CiaoSen | (~Jura@2a05:5800:459:6700:ca4b:d6ff:fec1:99da) (Ping timeout: 246 seconds) |
2024-09-08 02:30:49 +0200 | <lambdabot> | [(),(),(),(),(),(),(),(),(),()] |
2024-09-08 02:30:47 +0200 | <geekosaur> | > [() | _ <- [1..10]] |
2024-09-08 02:30:22 +0200 | <geekosaur> | yeh, I'd've used replicateM instead of the list comprehension |
2024-09-08 02:29:18 +0200 | <lambdabot> | [(),(),(),(),(),(),(),(),(),()] |
2024-09-08 02:29:16 +0200 | <monochrom> | > [() | i <- [1..10]] |
2024-09-08 02:29:07 +0200 | <monochrom> | Yeah, i is "unused", but [1..n] causes the list to have length n. |
2024-09-08 02:28:16 +0200 | <dmj`> | vector n = replicateM n arbitrary |
2024-09-08 02:28:01 +0200 | sayola | (~sayola@2a00:20:d307:80d8:cc05:636b:e7c8:3824) |
2024-09-08 02:27:35 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-09-08 02:26:53 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:26:44 +0200 | justsomeguy | (~justsomeg@user/justsomeguy) |
2024-09-08 02:24:29 +0200 | <lambdaRule> | what's the purpose of i? |
2024-09-08 02:24:15 +0200 | <lambdaRule> | vector n = sequence [ arbitrary | i <- [1..n] ] |
2024-09-08 02:24:15 +0200 | <lambdaRule> | vector :: Arbitrary a => Int -> Gen [a] |
2024-09-08 02:24:14 +0200 | <lambdaRule> | arbitrary :: Arbitrary a => Gen a |
2024-09-08 02:24:14 +0200 | <lambdaRule> | how to understand this list comprehension? |
2024-09-08 02:22:18 +0200 | lambdaRule | (~lambdaRul@node-1w7jr9phpv011s6crr0owcb3v.ipv6.telus.net) |
2024-09-08 02:21:53 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-09-08 02:21:01 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
2024-09-08 02:15:48 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds) |
2024-09-08 02:11:06 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:05:52 +0200 | acidjnk_new | (~acidjnk@p200300d6e72cfb079527f265a4c52d61.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
2024-09-08 02:03:34 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) |
2024-09-08 02:02:06 +0200 | alexherbo2 | (~alexherbo@2a02-8440-3114-792e-ddff-112f-809e-f52d.rev.sfr.net) (Remote host closed the connection) |
2024-09-08 02:00:16 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) (Remote host closed the connection) |
2024-09-08 02:00:03 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 01:55:19 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:47:47 +0200 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2024-09-08 01:44:17 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-09-08 01:39:32 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:36:07 +0200 | xal | (~xal@mx1.xal.systems) |
2024-09-08 01:35:28 +0200 | xal | (~xal@mx1.xal.systems) (Quit: bye) |
2024-09-08 01:29:03 +0200 | Inst | (~Inst@user/Inst) |
2024-09-08 01:28:43 +0200 | Inst | (~Inst@user/Inst) (Remote host closed the connection) |
2024-09-08 01:28:33 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 01:27:14 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 244 seconds) |
2024-09-08 01:23:44 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:21:36 +0200 | weary-traveler | (~user@user/user363627) |
2024-09-08 01:13:25 +0200 | Alleria | (~Alleria@user/alleria) (Ping timeout: 248 seconds) |
2024-09-08 01:12:42 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-09-08 01:07:57 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |