Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,801,693 events total
2025-12-08 19:10:48 × Googulator71 quits (~Googulato@2a01-036d-0106-479c-a13d-10f6-324f-ace8.pool6.digikabel.hu) (Quit: Client closed)
2025-12-08 19:10:50 Googulator95 joins (~Googulato@2a01-036d-0106-479c-a13d-10f6-324f-ace8.pool6.digikabel.hu)
2025-12-08 19:14:53 mulk joins (~mulk@p5b1127bf.dip0.t-ipconnect.de)
2025-12-08 19:17:17 × mehbark quits (~mehbark@user/mehbark) (Quit: insert leave message here)
2025-12-08 19:17:35 mehbark joins (~mehbark@joey.luug.ece.vt.edu)
2025-12-08 19:18:28 × mehbark quits (~mehbark@joey.luug.ece.vt.edu) (Changing host)
2025-12-08 19:18:28 mehbark joins (~mehbark@user/mehbark)
2025-12-08 19:20:09 <iqubic> Is there a good guide to working with STArrays and the ST monad. I wrote some code for Advent of Code last night, and it's really slow because I'm making many small changes to a large data structure and recreating the whole thing each time is slow.
2025-12-08 19:20:40 <iqubic> Or would it be better to work with an IOArray?
2025-12-08 19:21:49 Tuplanolla joins (~Tuplanoll@91-152-225-194.elisa-laajakaista.fi)
2025-12-08 19:27:03 ljdarj1 joins (~Thunderbi@user/ljdarj)
2025-12-08 19:28:07 × peterbecich quits (~Thunderbi@172.222.148.214) (Ping timeout: 240 seconds)
2025-12-08 19:28:20 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds)
2025-12-08 19:28:20 ljdarj1 is now known as ljdarj
2025-12-08 19:28:23 × chele quits (~chele@user/chele) (Remote host closed the connection)
2025-12-08 19:30:43 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
2025-12-08 19:30:49 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
2025-12-08 19:31:13 × itaipu quits (~itaipu@168.121.97.28) (Ping timeout: 264 seconds)
2025-12-08 19:31:49 itaipu joins (~itaipu@168.121.97.28)
2025-12-08 19:32:02 Lord_of_Life_ is now known as Lord_of_Life
2025-12-08 19:32:04 <haskellbridge> <Morj> iqubic "newtype IOArray i e = IOArray (STArray RealWorld i e)" - so there won't be gains to switching at least
2025-12-08 19:35:43 <haskellbridge> <Morj> Usually the biggest performance problems are laziness and boxed types. STArray only has boxed combinators, so if you're using it, your only chance is to set -XStrict and pray to the optimizer
2025-12-08 19:35:50 <iqubic> I'm not sure what you mean there.
2025-12-08 19:36:43 <haskellbridge> <Morj> Sorry, I'm slow to type it out
2025-12-08 19:37:24 <haskellbridge> <Morj> I wanted to say that there are alternatives using unboxed values, but I was verifying which package it was
2025-12-08 19:37:39 <monochrom> Oh, that would be vector.
2025-12-08 19:37:48 <haskellbridge> <Morj> Or array?
2025-12-08 19:38:28 <monochrom> OK that too.
2025-12-08 19:38:34 <haskellbridge> <Morj> Also, iqubic it just occurred to me, how good is your understanding of haskell? Are you just learning it for AOC or using this AOC to improve your high-perf skills?
2025-12-08 19:39:15 <iqubic> I know Haskell very well, but I've never learned how to properly work with mutable data in Haskell.
2025-12-08 19:39:37 <haskellbridge> <Morj> Good!
2025-12-08 19:39:44 × deptype quits (~deptype@2406:b400:3a:9d2f:9b7c:331e:bc52:4fc0) (Remote host closed the connection)
2025-12-08 19:40:01 <iqubic> This is my 6th year doing Advent of Code and I've used Haskell for a wide number of other projects too.
2025-12-08 19:40:01 <haskellbridge> <Morj> I don't know any guides, but you can use this blog for inspiration: https://0xd34df00d.me/posts/2024/09/naive-nfas.html#good-ol-st
2025-12-08 19:41:17 <haskellbridge> <Morj> It's been 5 years since I've written any high-perf myself >_>
2025-12-08 19:41:21 michalz_ joins (~michalz@185.246.207.217)
2025-12-08 19:41:32 <haskellbridge> <Morj> I'm hearing ghc 9 made some things better
2025-12-08 19:42:42 × michalz quits (~michalz@185.246.207.201) (Ping timeout: 244 seconds)
2025-12-08 19:43:57 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 19:47:51 <haskellbridge> <Morj> I don't think I ever used 'array' because I don't recognize the api at all. So the simple options is to take https://hackage-content.haskell.org/package/vector-0.13.2.0/docs/Data-Vector-Unboxed-Mutable.html - and use only functions beginning with 'unsafe'. You should also set {-# LANGUAGE Strict #-}, and compile with llvm backend
2025-12-08 19:49:13 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-12-08 19:49:42 <haskellbridge> <Morj> You won't be able to use structures easily, so all your types will be turned into tuples (tuples can turn into unboxed tuples). And no easy way to get sum types, sadly
2025-12-08 19:51:14 × itaipu quits (~itaipu@168.121.97.28) (Ping timeout: 260 seconds)
2025-12-08 19:51:22 <haskellbridge> <Morj> Hope my bunch of unstructured advice helped a bit
2025-12-08 19:54:01 × machinedgod quits (~machinedg@d75-159-126-101.abhsia.telus.net) (Ping timeout: 264 seconds)
2025-12-08 19:54:37 <monochrom> Unboxed sums are available in very new versions of GHC.
2025-12-08 19:55:18 itaipu joins (~itaipu@168.121.97.28)
2025-12-08 19:59:44 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 20:04:37 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2025-12-08 20:08:50 jmcantrell_ joins (~weechat@user/jmcantrell)
2025-12-08 20:08:50 jmcantrell_ is now known as jmcantrell
2025-12-08 20:15:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 20:16:17 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
2025-12-08 20:16:36 trickard_ is now known as trickard
2025-12-08 20:19:18 <[exa]> iqubic: unboxed (or ideally primitive) mutable vectors + straightforward ST code usually gives a pretty C-like performance for me. You also want stuff like -fspecialise-aggressively -fexpose-all-unfoldings or a lot of manual INLINE if the cost-centre is spread over more functions
2025-12-08 20:20:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2025-12-08 20:22:24 spew joins (~spew@user/spew)
2025-12-08 20:26:24 × Square2 quits (~Square@user/square) (Read error: Connection reset by peer)
2025-12-08 20:26:41 Square2 joins (~Square@user/square)
2025-12-08 20:27:03 Square joins (~Square4@user/square)
2025-12-08 20:27:31 × trickard quits (~trickard@cpe-83-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-12-08 20:27:45 trickard_ joins (~trickard@cpe-83-98-47-163.wireline.com.au)
2025-12-08 20:29:01 <yin> monochrom: I know about IntSet and that's what you want to use virtually everytime for performance, but what I want to know is if and when is Set Int useful
2025-12-08 20:31:01 × Square2 quits (~Square@user/square) (Ping timeout: 250 seconds)
2025-12-08 20:31:19 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 20:32:31 × michalz_ quits (~michalz@185.246.207.217) (Remote host closed the connection)
2025-12-08 20:33:40 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 245 seconds)
2025-12-08 20:36:07 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-08 20:38:51 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
2025-12-08 20:40:35 × jmcantrell quits (~weechat@user/jmcantrell) (Ping timeout: 265 seconds)
2025-12-08 20:40:41 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 20:41:13 jmcantrell_ joins (~weechat@user/jmcantrell)
2025-12-08 20:45:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-12-08 20:48:26 acarrico joins (~acarrico@pppoe-209-99-221-186.greenmountainaccess.net)
2025-12-08 20:50:17 karenw joins (~karenw@user/karenw)
2025-12-08 20:51:15 L29Ah joins (~L29Ah@wikipedia/L29Ah)
2025-12-08 20:52:15 × Pozyomka quits (~pyon@user/pyon) (Quit: brb)
2025-12-08 20:56:07 Pozyomka joins (~pyon@user/pyon)
2025-12-08 20:56:28 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 20:58:20 <__monty__> It seems almost just as useful as IntMap () and signals your intent more clearly.
2025-12-08 21:01:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-08 21:01:48 milan joins (~milan@88.212.61.169)
2025-12-08 21:02:27 <milan> Guyz do you use -XSafe?
2025-12-08 21:03:08 <milan> I am trying simple app but I can't even use haskell-say package in my cabal with -XSafe
2025-12-08 21:06:05 Googulator93 joins (~Googulato@85-238-68-117.pool.digikabel.hu)
2025-12-08 21:07:48 × Googulator95 quits (~Googulato@2a01-036d-0106-479c-a13d-10f6-324f-ace8.pool6.digikabel.hu) (Quit: Client closed)
2025-12-08 21:10:02 × pebble quits (~pebble@37.63.35.63) (Read error: Connection reset by peer)
2025-12-08 21:11:43 × Ikosit quits (~Ikosit@user/ikosit) (Quit: The Lounge - https://thelounge.chat)
2025-12-08 21:11:54 <davean> milan: -XSafe is complicated. You can't use random packages in it.
2025-12-08 21:11:59 Ikosit2 joins (~Ikosit@user/ikosit)
2025-12-08 21:12:16 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-08 21:13:52 <milan> davean: Yeah but https://hackage.haskell.org/package/haskell-say-1.0.0.0/docs/HaskellSay.html is marked safe? But I get app/Main.hs:3:1: error: [-Winferred-safe-imports, -Werror=inferred-safe-imports]
2025-12-08 21:13:54 <milan> Importing Safe-Inferred module HaskellSay from explicitly Safe module
2025-12-08 21:17:32 <milan> Is there a way how to get rid of this warning without just silencing it?
2025-12-08 21:18:55 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-08 21:21:48 <[exa]> yin: there's some nice tree-ish properties of plain Set Int that you get (but I'm not sure they are exposed). Mainly since the trees are bb-α you can get stuff like k-th smallest element very fast. Not sure if that carries to the intmap representation (radix tree essentially)
2025-12-08 21:22:25 <yin> ah, yes. sets are ordered
2025-12-08 21:22:48 <yin> good point
2025-12-08 21:24:26 <[exa]> IntSet is kinda ordered too, right? although more implicitly
2025-12-08 21:27:50 Lycurgus joins (~juan@user/Lycurgus)

All times are in UTC.