2026/02/24

Newest at the top

2026-02-24 22:11:13 +0100 <tomsmeding> dolio: https://hackage-content.haskell.org/package/text-2.1.4/docs/Data-Text-Lazy-Builder-Int.html ?
2026-02-24 22:11:03 +0100 <lambdabot> Show a => [a] -> [Char]
2026-02-24 22:11:00 +0100 <mauke> :t let f [] = "\n"; f (x : xs) = shows x (' ' : f xs) in f
2026-02-24 22:10:48 +0100 <tomsmeding> well, for a start I'd be curious how `T.putStrLn (T.intercalate " " (map T.show ints))` performs, despite still using Prelude.show
2026-02-24 22:10:17 +0100 <dolio> Other than the one I stopped maintaining like 10 years ago?
2026-02-24 22:09:59 +0100 <dolio> Is there a show-to-text/bytestring that doesn't run through show?
2026-02-24 22:09:28 +0100 <tomsmeding> lantti: are you allowed to use dependencies, like 'text' or 'bytestring'?
2026-02-24 22:09:18 +0100 <dolio> Yeah, you need the space analogue of print.
2026-02-24 22:08:59 +0100 <mauke> that's not space separated
2026-02-24 22:08:53 +0100 <lambdabot> (Foldable t, Show a) => t a -> IO ()
2026-02-24 22:08:52 +0100 <EvanR> :t mapM_ print
2026-02-24 22:08:22 +0100 <lambdabot> Show a => a -> ShowS
2026-02-24 22:08:20 +0100 <mauke> :t shows
2026-02-24 22:08:08 +0100 <lantti> 10^6
2026-02-24 22:07:54 +0100 <Rembane> lantti: How many ints do you print?
2026-02-24 22:07:45 +0100 <lantti> although on a positive note, I did pass already. I'm just trying to improve my result from barely passing to something better
2026-02-24 22:07:44 +0100 <newmind> so, since haskell is a lazy language... how are you calculating ints?
2026-02-24 22:07:38 +0100 <dolio> You could try `mapM_` with something. But I'd be surprised if it were a lot faster.
2026-02-24 22:07:33 +0100aka_dude(~aka_dude@192.71.166.120) (Client Quit)
2026-02-24 22:06:49 +0100 <newmind> depending on the length of ints, maybe with a builder, but i doubt for any reasonable length outputs there is that much difference to be had here
2026-02-24 22:06:39 +0100 <lantti> I'm doing an algorithms course where I have to choice to do it in C, Rust or Haskell and I chose Haskell, but in my current task just printing the result takes me to the limit on acceptable time use
2026-02-24 22:06:34 +0100aka_dude(~aka_dude@192.71.166.120)
2026-02-24 22:06:06 +0100 <Rembane> Converting it to a chunked bytestring could be faster, but I haven't compared.
2026-02-24 22:05:31 +0100 <lantti> yes
2026-02-24 22:05:27 +0100 <Rembane> ...minimizing that time that is
2026-02-24 22:05:14 +0100 <Rembane> lantti: Faster as in time from first character to last character?
2026-02-24 22:04:18 +0100 <lantti> is there a faster way to print a list of Int, separated by spaces, than "putStrLn (unwords $ map show ints)"?
2026-02-24 22:04:04 +0100ljdarj(~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds)
2026-02-24 22:01:21 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-02-24 21:56:50 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 21:55:33 +0100petrichor(~jez@user/petrichor) petrichor
2026-02-24 21:50:00 +0100op_4(~tslil@user/op-4/x-9116473) op_4
2026-02-24 21:49:59 +0100srk-srk
2026-02-24 21:49:54 +0100prdak(~Thunderbi@user/prdak) prdak
2026-02-24 21:47:18 +0100srk-(~sorki@user/srk) srk
2026-02-24 21:47:05 +0100srk(~sorki@user/srk) (Ping timeout: 248 seconds)
2026-02-24 21:47:05 +0100op_4(~tslil@user/op-4/x-9116473) (Ping timeout: 264 seconds)
2026-02-24 21:46:06 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-02-24 21:41:28 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 21:34:06 +0100lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2026-02-24 21:32:34 +0100xacktm(bnc4free@user/xacktm) xacktm
2026-02-24 21:32:32 +0100michalz(~michalz@185.246.207.221) (Remote host closed the connection)
2026-02-24 21:32:29 +0100dtman34(~dtman34@2601:447:d183:2302:b0c5:8965:1c3f:d560) dtman34
2026-02-24 21:32:19 +0100xacktm(xacktm@user/xacktm) (Server closed connection)
2026-02-24 21:30:17 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-02-24 21:30:09 +0100chele(~chele@user/chele) (Remote host closed the connection)
2026-02-24 21:23:26 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 21:22:39 +0100gmg(~user@user/gehmehgeh) gehmehgeh
2026-02-24 21:22:25 +0100wickedjargon(~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Ping timeout: 276 seconds)
2026-02-24 21:21:57 +0100eugenrh(~eugenrh@user/eugenrh) eugenrh