2024-09-08 00:04:24 +0200 | <dpren_> | I'd like to extend a big thanks to this group. My pitch-extractor is back on it's game scraping the depths of youtube for weird musical samples to be performed by me next week. |
2024-09-08 00:04:50 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 00:05:29 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-09-08 00:09:54 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-09-08 00:13:29 +0200 | <haskellbridge> | <sm> hurrah! |
2024-09-08 00:17:24 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-09-08 00:20:37 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 00:23:55 +0200 | JuanDaugherty | (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
2024-09-08 00:25:25 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-09-08 00:29:15 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-09-08 00:29:35 +0200 | neuroevolutus | (~neuroevol@37.19.200.135) (Quit: Client closed) |
2024-09-08 00:31:46 +0200 | hgolden | (~hgolden@146.70.173.165) |
2024-09-08 00:39:32 +0200 | gentauro | (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
2024-09-08 00:39:56 +0200 | gentauro | (~gentauro@user/gentauro) |
2024-09-08 00:50:01 +0200 | causal | (~eric@50.35.88.207) (Quit: WeeChat 4.3.1) |
2024-09-08 00:52:12 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 00:52:57 +0200 | spew | (~spew@201.141.99.170) |
2024-09-08 00:53:51 +0200 | vhs | (~vhs@82-209-143-233.cust.bredband2.com) |
2024-09-08 00:53:59 +0200 | vhsconnect | (~vhs@82-209-143-233.cust.bredband2.com) |
2024-09-08 00:57:03 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 00:59:22 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 272 seconds) |
2024-09-08 01:00:16 +0200 | vhsconnect | (~vhs@82-209-143-233.cust.bredband2.com) (Quit: Leaving) |
2024-09-08 01:00:16 +0200 | vhs | (~vhs@82-209-143-233.cust.bredband2.com) (Quit: Leaving) |
2024-09-08 01:03:58 +0200 | spew | (~spew@201.141.99.170) (Quit: spew) |
2024-09-08 01:05:11 +0200 | Alleria | (~Alleria@user/alleria) |
2024-09-08 01:07:57 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:12:42 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-09-08 01:13:25 +0200 | Alleria | (~Alleria@user/alleria) (Ping timeout: 248 seconds) |
2024-09-08 01:21:36 +0200 | weary-traveler | (~user@user/user363627) |
2024-09-08 01:23:44 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:27:14 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 244 seconds) |
2024-09-08 01:28:33 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 01:28:43 +0200 | Inst | (~Inst@user/Inst) (Remote host closed the connection) |
2024-09-08 01:29:03 +0200 | Inst | (~Inst@user/Inst) |
2024-09-08 01:35:28 +0200 | xal | (~xal@mx1.xal.systems) (Quit: bye) |
2024-09-08 01:36:07 +0200 | xal | (~xal@mx1.xal.systems) |
2024-09-08 01:39:32 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 01:44:17 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-09-08 01:47:47 +0200 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2024-09-08 01:55:19 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:00:03 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 02:00:16 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) (Remote host closed the connection) |
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:03:34 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) |
2024-09-08 02:05:52 +0200 | acidjnk_new | (~acidjnk@p200300d6e72cfb079527f265a4c52d61.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
2024-09-08 02:11:06 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:15:48 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds) |
2024-09-08 02:21:01 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
2024-09-08 02:21:53 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-09-08 02:22:18 +0200 | lambdaRule | (~lambdaRul@node-1w7jr9phpv011s6crr0owcb3v.ipv6.telus.net) |
2024-09-08 02:24:14 +0200 | <lambdaRule> | how to understand this list comprehension? |
2024-09-08 02:24:14 +0200 | <lambdaRule> | arbitrary :: Arbitrary a => Gen a |
2024-09-08 02:24:15 +0200 | <lambdaRule> | vector :: Arbitrary a => Int -> Gen [a] |
2024-09-08 02:24:15 +0200 | <lambdaRule> | vector n = sequence [ arbitrary | i <- [1..n] ] |
2024-09-08 02:24:29 +0200 | <lambdaRule> | what's the purpose of i? |
2024-09-08 02:26:44 +0200 | justsomeguy | (~justsomeg@user/justsomeguy) |
2024-09-08 02:26:53 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:27:35 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-09-08 02:28:01 +0200 | sayola | (~sayola@2a00:20:d307:80d8:cc05:636b:e7c8:3824) |
2024-09-08 02:28:16 +0200 | <dmj`> | vector n = replicateM n arbitrary |
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:29:16 +0200 | <monochrom> | > [() | i <- [1..10]] |
2024-09-08 02:29:18 +0200 | <lambdabot> | [(),(),(),(),(),(),(),(),(),()] |
2024-09-08 02:30:22 +0200 | <geekosaur> | yeh, I'd've used replicateM instead of the list comprehension |
2024-09-08 02:30:47 +0200 | <geekosaur> | > [() | _ <- [1..10]] |
2024-09-08 02:30:49 +0200 | <lambdabot> | [(),(),(),(),(),(),(),(),(),()] |
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:31:33 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-08 02:31:39 +0200 | <geekosaur> | @index replicateM |
2024-09-08 02:31:39 +0200 | <lambdabot> | Control.Monad, Data.Sequence |
2024-09-08 02:32:07 +0200 | <dmj`> | @src replicateM |
2024-09-08 02:32:07 +0200 | <lambdabot> | replicateM n x = sequence (replicate n x) |
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: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:35:06 +0200 | <geekosaur> | (or sequence, as in your given code) |
2024-09-08 02:36:25 +0200 | <geekosaur> | for that matter, it doesn't even avoid an import since they have to use sequence instead |
2024-09-08 02:36:43 +0200 | <lambdaRule> | thanks for all the info. I searched list comprehension syntax but I haven't found anything. What should I have searched? |
2024-09-08 02:37:15 +0200 | <lambdaRule> | this is some very old code that I |
2024-09-08 02:37:25 +0200 | <lambdaRule> | reading, from QuickCheck |
2024-09-08 02:37:29 +0200 | <geekosaur> | "Haskell list comprehension" (if you don't specify the language, you probably get Python's) |
2024-09-08 02:40:49 +0200 | <geekosaur> | if you got a lot of "x for i in …" then you got Python's list comprehensions, which aren't quite as elaborate as Haskell's but do roughly the same thing |
2024-09-08 02:42:41 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 02:43:24 +0200 | <dmj`> | :t enumFromTo |
2024-09-08 02:43:25 +0200 | <lambdabot> | Enum a => a -> a -> [a] |
2024-09-08 02:45:53 +0200 | spew | (~spew@201.141.99.170) |
2024-09-08 02:47:59 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-09-08 02:57:37 +0200 | troojg | (~troojg@user/troojg) |
2024-09-08 02:58:28 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 03:03:24 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-09-08 03:06:42 +0200 | jrm | (~jrm@user/jrm) (Quit: ciao) |
2024-09-08 03:08:12 +0200 | jrm | (~jrm@user/jrm) |
2024-09-08 03:08:40 +0200 | <justsomeguy> | Is there some trick for getting used to point-free syntax? It's been a few years and it still throws me off. |
2024-09-08 03:09:09 +0200 | <EvanR> | if it makes no sense just don't do it |
2024-09-08 03:09:21 +0200 | <justsomeguy> | I'm reading it in other peoples code. |
2024-09-08 03:09:30 +0200 | <EvanR> | if it's more complicated than f 0 x . g "ok" . h, I'm out |
2024-09-08 03:09:58 +0200 | abrar | (~abrar@pool-72-78-199-167.phlapa.fios.verizon.net) (Quit: WeeChat 4.2.2) |
2024-09-08 03:10:06 +0200 | <justsomeguy> | Yeah, there are things like (sequence .) . fmap in this book I'm reading. |
2024-09-08 03:10:11 +0200 | <EvanR> | gross |
2024-09-08 03:10:22 +0200 | <geekosaur> | that's past the point where I throw in the towel, yeh |
2024-09-08 03:10:30 +0200 | <EvanR> | @unpl (f .) . g |
2024-09-08 03:10:30 +0200 | abrar | (~abrar@pool-72-78-199-167.phlapa.fios.verizon.net) |
2024-09-08 03:10:30 +0200 | <lambdabot> | (\ x x0 -> f (g x x0)) |
2024-09-08 03:10:33 +0200 | <geekosaur> | "too dotty" |
2024-09-08 03:10:59 +0200 | <EvanR> | \x y -> sequence (fmap x y) |
2024-09-08 03:11:04 +0200 | <justsomeguy> | I wonder if I can get that unpointfree in my IDE somehow. It's probably possible with the LSP. |
2024-09-08 03:11:35 +0200 | <justsomeguy> | Hey, that rhymed! |
2024-09-08 03:11:38 +0200 | <geekosaur> | someone would have to contribute a plugin based on the pointfree package |
2024-09-08 03:12:10 +0200 | <geekosaur> | the main work is already done, just need to hook it in to HLS |
2024-09-08 03:14:15 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-08 03:15:38 +0200 | <justsomeguy> | I'd like to look into writing that once I get out of the "can't code himself out of a wet paper bag" phase. |
2024-09-08 03:19:12 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-09-08 03:23:58 +0200 | emmanuelux | (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer) |
2024-09-08 03:27:19 +0200 | <EvanR> | :t (.).(.) |
2024-09-08 03:27:19 +0200 | <lambdabot> | (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c |
2024-09-08 03:27:46 +0200 | <EvanR> | :t \f g x y -> (f .) . g |
2024-09-08 03:27:46 +0200 | <lambdabot> | (b -> c) -> (a1 -> a2 -> b) -> p1 -> p2 -> a1 -> a2 -> c |
2024-09-08 03:28:06 +0200 | <EvanR> | :t \x y f g -> (f .) . g |
2024-09-08 03:28:06 +0200 | <lambdabot> | p1 -> p2 -> (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c |
2024-09-08 03:28:12 +0200 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
2024-09-08 03:28:21 +0200 | <EvanR> | brain broke |
2024-09-08 03:29:04 +0200 | <EvanR> | ok it's the same thing |
2024-09-08 03:29:53 +0200 | yin | (~z@user/zero) (Ping timeout: 248 seconds) |
2024-09-08 03:30:02 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |