Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 950 951 952 953 954 955 956 957 958 959 960 .. 5022
502,152 events total
2020-10-30 04:20:21 <Axman6> > let digits 0 = []; digits n = case quotRem n 10 of (n',d) -> d : digits n' in digits 12345
2020-10-30 04:20:23 <lambdabot> [5,4,3,2,1]
2020-10-30 04:20:44 <dsal> I don't understand what you're trying to do.
2020-10-30 04:21:01 <Axman6> > let digits 0 = []; digits n = case quotRem n 10 of (n',d) -> d : digits n'; square n = n^n in map square $ digits 12345
2020-10-30 04:21:04 <lambdabot> <hint>:1:77: error:
2020-10-30 04:21:04 <lambdabot> <hint>:1:77: error: Parse error in pattern: square
2020-10-30 04:21:21 <unihernandez22> dsal https://github.com/jabbalaci/SpeedTests
2020-10-30 04:22:19 <dsal> Ah, that's helpful.
2020-10-30 04:23:07 <Axman6> > let digits 0 = []; digits n = case quotRem n 10 of (n',d) -> d : digits n'; ; square n = n^n in map square $ digits 12345
2020-10-30 04:23:09 <lambdabot> <hint>:1:79: error:
2020-10-30 04:23:09 <lambdabot> <hint>:1:79: error: Parse error in pattern: square
2020-10-30 04:23:21 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in map square $ digits 12345
2020-10-30 04:23:24 <lambdabot> [3125,256,27,4,1]
2020-10-30 04:23:33 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in sum $ map square $ digits 12345
2020-10-30 04:23:35 <lambdabot> 3413
2020-10-30 04:24:01 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in map (sum . map square . digits) [1000..]
2020-10-30 04:24:04 <lambdabot> [4,4,7,30,259,3128,46659,823546,16777219,387420492,4,4,7,30,259,3128,46659,8...
2020-10-30 04:24:34 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in filter (\n -> n == sum . map square . digits $ n) [1..]
2020-10-30 04:24:36 <lambdabot> error:
2020-10-30 04:24:36 <lambdabot> • Couldn't match expected type ‘(c -> c) -> Bool’
2020-10-30 04:24:36 <lambdabot> with actual type ‘Bool’
2020-10-30 04:24:47 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in filter (\n -> n == (sum . map square . digits $ n) [1..]
2020-10-30 04:24:50 <lambdabot> <hint>:1:155: error:
2020-10-30 04:24:50 <lambdabot> <hint>:1:155: error:
2020-10-30 04:24:50 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
2020-10-30 04:24:51 <Axman6> > let digits 0 = []; digits n = (case quotRem n 10 of (n',d) -> d : digits n') ; square n = n^n in filter (\n -> n == (sum . map square . digits $ n)) [1..]
2020-10-30 04:24:57 <lambdabot> mueval-core: Time limit exceeded
2020-10-30 04:24:58 <dsal> Doing things on one line is hard. heh
2020-10-30 04:25:23 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
2020-10-30 04:26:11 <Axman6> so an interesting thing about this is that the tail of the result of digits is the same for n and n+1 unless the last digit is 10, which shows there's some caching to be had
2020-10-30 04:26:17 × petersen quits (~petersen@redhat/juhp) (Ping timeout: 260 seconds)
2020-10-30 04:26:36 <int-e> square n = n^n?!
2020-10-30 04:26:45 <Axman6> fight me
2020-10-30 04:26:55 <dsal> dimensionate
2020-10-30 04:27:06 <Axman6> tetrate?
2020-10-30 04:27:28 <unihernandez22> int-e hahaha
2020-10-30 04:28:05 _vaibhavingale_ joins (~Adium@203.188.228.9)
2020-10-30 04:29:32 drbean joins (~drbean@TC210-63-209-96.static.apol.com.tw)
2020-10-30 04:30:32 <unihernandez22> Ok... I'm going to sleep
2020-10-30 04:30:59 <int-e> smurf, frobnicate, foo, bar, baz, xyzzy, barney, fred.
2020-10-30 04:32:24 <Axman6> I thought n ^ n was tetration
2020-10-30 04:32:42 <Axman6> no
2020-10-30 04:32:58 <Axman6> it's smaller than that
2020-10-30 04:33:10 <Axman6> (me calls it pentration)
2020-10-30 04:33:26 <int-e> nah, tetration is something silly like n ^^ m = iterate (n^) n !! m
2020-10-30 04:33:32 <Axman6> yeah
2020-10-30 04:33:50 cabpa joins (~cabpa@110.54.186.150)
2020-10-30 04:34:47 <unihernandez22> selfpow n = n ^ n
2020-10-30 04:35:14 <MarcelineVQ> dupsquare
2020-10-30 04:35:21 <Axman6> > 9 ^ 9
2020-10-30 04:35:24 <lambdabot> 387420489
2020-10-30 04:35:34 <Axman6> join (^)
2020-10-30 04:35:57 <int-e> How about `nendo n` because it counts endomorphisms from an n-element set to itself...
2020-10-30 04:36:30 <Axman6> sounds like a Star Wars character
2020-10-30 04:38:58 <Axman6> unihernandez22: btw, using Vector would make the indexing more efficient, since Arrays allow you to have arbitrary indexes, so there's alwats a conversion between your index and the underlying index into the array. Vector plus uunsafeIndex would be the best once you know it can never index out of bounds
2020-10-30 04:39:00 × cabpa quits (~cabpa@110.54.186.150) (Remote host closed the connection)
2020-10-30 04:39:02 × xff0x_ quits (~fox@2001:1a81:52d0:1400:82e7:d433:290a:90f3) (Ping timeout: 264 seconds)
2020-10-30 04:39:33 xff0x_ joins (~fox@2001:1a81:52d0:1400:3530:ba40:6a60:b17e)
2020-10-30 04:40:48 <unihernandez22> Axman6, but I need it without external packages
2020-10-30 04:41:00 cabpa joins (~cabpa@110.54.186.150)
2020-10-30 04:41:15 nineonine joins (~textual@216-19-190-182.dyn.novuscom.net)
2020-10-30 04:43:03 dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2020-10-30 04:45:42 <unihernandez22> Axman6, I tried directly with a function defined for each digit statically, and the speed doesn't change
2020-10-30 04:46:10 <unihernandez22> So that's not the problem
2020-10-30 04:46:46 <dsal> Yeah, it's unlikely your problem is that exponentiation is slow, but more that you're doing it more than you need to.
2020-10-30 04:47:10 × avoandmayo quits (~textual@122-58-158-238-adsl.sparkbb.co.nz) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-30 04:48:51 <unihernandez22> dsal, but with other languages it take ~5 seconds
2020-10-30 04:48:59 <unihernandez22> And with Haskell 1 minute
2020-10-30 04:49:14 × hiroaki quits (~hiroaki@2a02:908:4b18:e20::8d72) (Ping timeout: 264 seconds)
2020-10-30 04:49:17 <unihernandez22> So I think I'm doing something wrong
2020-10-30 04:52:34 jedws joins (~jedws@101.184.150.81)
2020-10-30 04:53:26 × ericsagnes quits (~ericsagne@2405:6580:0:5100:e025:6b7e:a41d:7b14) (Ping timeout: 264 seconds)
2020-10-30 04:54:05 × polyrain quits (~polyrain@130.102.13.189) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-30 04:54:11 avoandmayo joins (~textual@122-58-158-238-adsl.sparkbb.co.nz)
2020-10-30 04:55:35 <dsal> Let me try it...
2020-10-30 04:58:34 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-10-30 04:59:08 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-30 04:59:47 lahwran joins (~lahwran@178.239.168.171)
2020-10-30 05:01:28 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-10-30 05:01:40 hiroaki joins (~hiroaki@2a02:908:4b18:e20::8f6e)
2020-10-30 05:03:01 christo joins (~chris@81.96.113.213)
2020-10-30 05:03:33 polyrain joins (~polyrain@130.102.13.189)
2020-10-30 05:03:38 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 264 seconds)
2020-10-30 05:05:08 ericsagnes joins (~ericsagne@2405:6580:0:5100:58d8:d49c:65f5:d6a2)
2020-10-30 05:06:20 × polyrain quits (~polyrain@130.102.13.189) (Client Quit)
2020-10-30 05:06:20 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-10-30 05:06:49 day_ joins (~Unknown@unaffiliated/day)
2020-10-30 05:07:03 polyrain joins (~polyrain@130.102.13.189)
2020-10-30 05:07:03 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-10-30 05:07:34 <unihernandez22> Ok... Bye
2020-10-30 05:07:35 × avoandmayo quits (~textual@122-58-158-238-adsl.sparkbb.co.nz) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-30 05:08:01 × Volt_ quits (~Volt_@c-73-145-164-70.hsd1.mi.comcast.net) (Quit: )
2020-10-30 05:08:10 <Axman6> well I got it to 23s using LLVM, but it is still surprising it's unable to optimise it as well as the quite similar C code
2020-10-30 05:09:13 tsrt^ joins (tsrt@ip98-184-89-2.mc.at.cox.net)
2020-10-30 05:09:44 × day quits (~Unknown@unaffiliated/day) (Ping timeout: 240 seconds)
2020-10-30 05:09:45 day_ is now known as day
2020-10-30 05:12:13 <monsterchrom> int-e, Axman6: As in, Lando counts left Kan ("Lan") extensions? :)
2020-10-30 05:13:37 × Saukk quits (~Saukk@2001:998:f9:2914:1c59:9bb5:b94c:4) (Remote host closed the connection)
2020-10-30 05:15:04 dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2020-10-30 05:16:24 × acarrico quits (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) (Ping timeout: 240 seconds)

All times are in UTC.