2022/05/14

2022-05-14 00:00:10 +0200 <EvanR> somehow even worse than global state
2022-05-14 00:02:06 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net)
2022-05-14 00:07:17 +0200causal(~user@50.35.83.177)
2022-05-14 00:09:40 +0200 <geekosaur> it's global state that sneaks up on you without warning
2022-05-14 00:10:28 +0200 <hpc> just tell developers it's containerized state
2022-05-14 00:10:40 +0200 <hpc> each thread is a state namespace
2022-05-14 00:10:43 +0200 <hpc> they'll be all over it
2022-05-14 00:11:07 +0200 <monochrom> I think they're already all over it.
2022-05-14 00:11:45 +0200 <hpc> nah, sometimes they'll notice it's difficult to work with
2022-05-14 00:11:52 +0200 <hpc> and this innoculates them against that knowledge :D
2022-05-14 00:13:19 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 00:18:29 +0200dostoevsky8(~5c42c5384@user/dostoevsky)
2022-05-14 00:18:30 +0200causal(~user@50.35.83.177) (Quit: WeeChat 3.5)
2022-05-14 00:19:31 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 00:19:31 +0200dostoevsky8dostoevsky
2022-05-14 00:22:29 +0200causal(~user@50.35.83.177)
2022-05-14 00:26:01 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:6dfd:37a:2bc3:ca7e) (Remote host closed the connection)
2022-05-14 00:26:20 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:6dfd:37a:2bc3:ca7e)
2022-05-14 00:27:51 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2022-05-14 00:28:25 +0200 <Henson> thanks again for the help, everyone, another mysterious bug squashed
2022-05-14 00:31:22 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
2022-05-14 00:35:56 +0200dostoevsky2(~5c42c5384@user/dostoevsky)
2022-05-14 00:37:10 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 00:37:10 +0200dostoevsky2dostoevsky
2022-05-14 00:45:28 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
2022-05-14 00:46:42 +0200dostoevsky3(~5c42c5384@user/dostoevsky)
2022-05-14 00:48:10 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 00:48:10 +0200dostoevsky3dostoevsky
2022-05-14 00:51:23 +0200markasoftware(~quassel@107.161.26.124)
2022-05-14 00:53:46 +0200dolio(~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
2022-05-14 00:58:19 +0200dolio(~dolio@130.44.130.54)
2022-05-14 00:59:30 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-05-14 01:09:33 +0200tcard(~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Remote host closed the connection)
2022-05-14 01:09:51 +0200tcard(~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
2022-05-14 01:12:04 +0200alp_(~alp@user/alp) (Ping timeout: 248 seconds)
2022-05-14 01:14:12 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de) (Ping timeout: 248 seconds)
2022-05-14 01:18:24 +0200aweinstock(~aweinstoc@cpe-74-76-189-75.nycap.res.rr.com)
2022-05-14 01:18:29 +0200slac74270(~slack1256@191.126.99.86)
2022-05-14 01:21:00 +0200slack1256(~slack1256@191.126.227.86) (Ping timeout: 260 seconds)
2022-05-14 01:22:50 +0200slac74270slack1256
2022-05-14 01:25:52 +0200slack1256(~slack1256@191.126.99.86) (Remote host closed the connection)
2022-05-14 01:29:12 +0200laalyn(~laalyn@c-73-189-182-49.hsd1.ca.comcast.net)
2022-05-14 01:32:08 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de)
2022-05-14 01:32:45 +0200 <laalyn> Hey can somebody help me figure out why haskell is slow?
2022-05-14 01:34:17 +0200dhil(~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) (Ping timeout: 248 seconds)
2022-05-14 01:34:49 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:6dfd:37a:2bc3:ca7e) (Ping timeout: 248 seconds)
2022-05-14 01:34:56 +0200 <hpc> https://dontasktoask.com/ :P
2022-05-14 01:35:19 +0200king_gs(~Thunderbi@187.201.105.54)
2022-05-14 01:35:22 +0200 <hpc> laalyn: can you paste the code you're having issues with?
2022-05-14 01:35:27 +0200 <laalyn> oh my bad
2022-05-14 01:36:00 +0200 <laalyn> I'm taking haskell for a test run and trying to solve a few programming problems that I'm familiar with previously
2022-05-14 01:36:58 +0200 <laalyn> Read a M*N matrix of 0 and 1s and print the sizes of all the 'islands' of 1s
2022-05-14 01:37:30 +0200 <hpc> are you using [[Bool]] or [[Int]] or something like that?
2022-05-14 01:37:41 +0200 <laalyn> I tried three ways to solve it
2022-05-14 01:37:55 +0200 <hpc> [] is a linked list type, that could be the issue
2022-05-14 01:38:04 +0200 <laalyn> first was with fgl, then using maps to emulate adjencency and visited array, and then using vector to do the same
2022-05-14 01:38:09 +0200 <hpc> ah
2022-05-14 01:38:16 +0200 <laalyn> yeah i realize that linked list is slow for random access
2022-05-14 01:38:42 +0200 <laalyn> and actually i implemented this in Elixir, which is another functional language with immutable data structures, and it runs faster
2022-05-14 01:38:46 +0200 <laalyn> but Elixir runs on a vm
2022-05-14 01:39:56 +0200 <laalyn> https://paste.tomsmeding.com/H9C6s0dT
2022-05-14 01:40:07 +0200 <laalyn> heres the code for the one with maps, as it performs the best
2022-05-14 01:40:26 +0200 <laalyn> oh wait I sent the one with vectors
2022-05-14 01:40:41 +0200 <laalyn> https://paste.tomsmeding.com/DhAVp2FF
2022-05-14 01:40:44 +0200 <laalyn> heres the one with maps
2022-05-14 01:41:27 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2022-05-14 01:43:32 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds)
2022-05-14 01:48:55 +0200 <sm> could be a good time to practice using the profiler
2022-05-14 01:49:25 +0200 <sm> I'm no expert, but that's enough code to be hiding multiple performance issues
2022-05-14 01:51:45 +0200 <sm> if you'd like to share a test file, I'd have a look
2022-05-14 01:51:50 +0200 <sm> test input
2022-05-14 01:52:00 +0200 <laalyn> sure
2022-05-14 01:52:36 +0200dolio(~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
2022-05-14 01:52:48 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 01:52:57 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 01:53:13 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
2022-05-14 01:53:24 +0200 <laalyn> hm i think its too big to be pasted
2022-05-14 01:53:45 +0200 <laalyn> https://paste.tomsmeding.com/keMQo88y
2022-05-14 01:53:49 +0200 <laalyn> heres a 100x100 one
2022-05-14 01:53:58 +0200 <laalyn> the slowdown isn't as bad
2022-05-14 01:55:27 +0200king_gs(~Thunderbi@187.201.105.54) (Read error: Connection reset by peer)
2022-05-14 01:58:17 +0200king_gs(~Thunderbi@187.201.105.54)
2022-05-14 01:59:27 +0200 <sm> ...cue the usual hilarious attempts to profile a haskell program...
2022-05-14 02:04:14 +0200king_gs(~Thunderbi@187.201.105.54) (Quit: king_gs)
2022-05-14 02:08:18 +0200 <sm> and then to produce useful results.. I have failed so far
2022-05-14 02:08:54 +0200 <laalyn> what was the profiler output?
2022-05-14 02:09:07 +0200 <laalyn> i'm still recompiling haskell and libs with profiler support
2022-05-14 02:10:24 +0200smitop2(uid328768@id-328768.tinside.irccloud.com)
2022-05-14 02:11:34 +0200bonz060(~quassel@2001:bc8:47a4:a23::1) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-05-14 02:12:20 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 248 seconds)
2022-05-14 02:15:34 +0200dolio(~dolio@130.44.130.54)
2022-05-14 02:21:51 +0200 <sm> laalyn: just curious, how are you doing that ?
2022-05-14 02:22:15 +0200 <sm> I only just now managed to get useful profiles
2022-05-14 02:22:18 +0200 <laalyn> doing what specifically?
2022-05-14 02:22:54 +0200 <sm> are you using stack ... --profile ? or cabal ? I'd like to learn from your command line
2022-05-14 02:23:21 +0200 <laalyn> oh im just using ghc
2022-05-14 02:23:21 +0200 <sm> half an hour to get a profile, and I
2022-05-14 02:23:31 +0200 <sm> am pretty good at this stuff (according to me)
2022-05-14 02:23:42 +0200gdd(~gdd@129.199.146.230) (Read error: Connection reset by peer)
2022-05-14 02:23:56 +0200 <sm> I believe this is at least 50% of why people say optimising haskell is hard
2022-05-14 02:24:19 +0200 <laalyn> well i need to rebuild all my haskell system libs in order to use ghc with -profile
2022-05-14 02:24:34 +0200 <laalyn> as im using Gentoo
2022-05-14 02:24:47 +0200 <sm> ghc -package split -prof -fprof-auto foo.hs, was that your command ?
2022-05-14 02:25:45 +0200 <laalyn> i was following the guide here: https://wiki.haskell.org/How_to_profile_a_Haskell_program#Enable_profiling_on_libraries
2022-05-14 02:25:53 +0200 <laalyn> so its ghc -O2 -prof -fprof-auto -rtsopts program
2022-05-14 02:25:55 +0200 <EvanR> yeah IntMaps are usually pretty good for emulating a sparse array, HashMap for string keys
2022-05-14 02:26:21 +0200gdd(~gdd@129.199.146.230)
2022-05-14 02:26:25 +0200 <EvanR> sometimes some stray laziness can slow things down and a single well placed ! fixes it xD
2022-05-14 02:26:47 +0200 <laalyn> hmm so where would i place that
2022-05-14 02:26:57 +0200 <laalyn> because in another functional language using the same data structure is faster
2022-05-14 02:27:05 +0200 <sm> here's the profile I got: https://termbin.com/rliw. passing the baton.
2022-05-14 02:27:16 +0200 <EvanR> I'm suspicious that IntMap or HashMap are being used in elixir
2022-05-14 02:27:25 +0200 <laalyn> its a hash trie
2022-05-14 02:27:33 +0200 <laalyn> but they allow anything as the keys/values
2022-05-14 02:28:03 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2022-05-14 02:28:13 +0200 <EvanR> in any case you have to identify the slowdown first
2022-05-14 02:28:52 +0200 <laalyn> sm: so most time is spent on dfs... very helpful
2022-05-14 02:29:25 +0200 <laalyn> it's difficult for me to identify the slowdown because the algorithms and data structures used are the exact same
2022-05-14 02:29:35 +0200 <laalyn> im guessing its due to lazy evaluation?
2022-05-14 02:29:55 +0200 <EvanR> that's also suspicious since elixir is a strict language with mutation, haskell isn't
2022-05-14 02:30:16 +0200 <laalyn> actually data structures in elixir are immutable
2022-05-14 02:31:21 +0200 <EvanR> in any case you need to look more closely than declare the two languages do the same thing
2022-05-14 02:31:37 +0200 <EvanR> when obviously they don't
2022-05-14 02:32:04 +0200smthinks most time is spent in lines 29 and 30
2022-05-14 02:33:04 +0200 <EvanR> another preliminary is to see what kind of performance diff there actually is
2022-05-14 02:33:28 +0200 <laalyn> sm: are you looking at the vector imp or map imp?
2022-05-14 02:33:50 +0200 <sm> just at your code and the profile
2022-05-14 02:34:17 +0200 <laalyn> which paste was it
2022-05-14 02:34:46 +0200 <laalyn> oh i see it was the vector imp
2022-05-14 02:34:52 +0200 <laalyn> lines 29-30 are just getting the input
2022-05-14 02:34:55 +0200 <laalyn> thats pretty fast
2022-05-14 02:35:03 +0200 <EvanR> in the vector version you use foldl (no prime)
2022-05-14 02:35:12 +0200 <EvanR> that might be introduced extreme laziness
2022-05-14 02:35:15 +0200 <EvanR> introducing
2022-05-14 02:35:59 +0200 <EvanR> nevermind, it's folding over 4 items
2022-05-14 02:36:22 +0200 <laalyn> shouldn't foldl be optimized into being strict when using -O2
2022-05-14 02:36:32 +0200 <sm> I could very well be wrong, and I don't understand the code. But it says 46% of individual time is spent in main
2022-05-14 02:36:37 +0200 <EvanR> it doesn't matter, since it's just 4 items
2022-05-14 02:37:11 +0200 <EvanR> but you can check that by reading core output
2022-05-14 02:37:15 +0200 <laalyn> well main contains the function call to search, which calls dfs
2022-05-14 02:37:26 +0200 <laalyn> so main holds everything
2022-05-14 02:38:35 +0200 <sm> here's the profile simplified by profiterole, FWIW:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/46aa635aa6de11d1d46220d2b44a8b0ce64e…)
2022-05-14 02:39:00 +0200 <Henson> just briefly looking over the code, there's a lot of use of tuples, and no strictness anywhere. Using foldl' will probably be better than foldl, trying to avoid tuples whenever possible, and strictly evaluating your data using seq or BangPatterns will probably help. Also there's a lot of list searching going on, which is probably slowing things down, too.
2022-05-14 02:40:06 +0200 <EvanR> tuples do be lazy
2022-05-14 02:40:17 +0200 <EvanR> but sometimes get optimized
2022-05-14 02:41:57 +0200 <laalyn> what should I replace tuples with
2022-05-14 02:42:20 +0200 <EvanR> in your Map version, you use Map Int Bool and Map Int Int
2022-05-14 02:42:38 +0200 <EvanR> IntMap has basically the same API and might (will probably) help
2022-05-14 02:42:57 +0200 <laalyn> i'll try that
2022-05-14 02:42:58 +0200 <Henson> according to the profile, a lot of time is spent in lines 15 to 17, where there's a foldl instead of foldl', and a whole bunch of tupes and recursion, which leads to a whole bunch of thunks that need to be held in memory and evaluated
2022-05-14 02:42:59 +0200 <sm> there could be a dozen or more perf issues in here eh. I would like to know how to systematically report them with tools though.
2022-05-14 02:43:06 +0200 <EvanR> only look at replacing tuples with strict tuples or putting in extra strictness if that's the problem
2022-05-14 02:44:07 +0200 <laalyn> Henson: i swapped the foldl with foldl' and there was no performance diff
2022-05-14 02:44:15 +0200 <laalyn> along with compiling with -O2
2022-05-14 02:44:28 +0200 <EvanR> the foldl is just to "loop" over 4 coordinate shifts
2022-05-14 02:44:28 +0200 <Henson> what I usually do is just place bangs everywhere (and switch from foldl to foldl') and see if that helps. If so, then slowly remove bangs until you find the one or more than make the difference
2022-05-14 02:44:44 +0200 <Henson> laalyn: ok
2022-05-14 02:45:52 +0200 <laalyn> also 15-17 is the recursive call so most time would be spent there anyway
2022-05-14 02:46:13 +0200 <EvanR> btw, Data.Map is the lazy version, i.e. the values in there won't be evaluated until necessary
2022-05-14 02:46:23 +0200 <Henson> yes, that's true
2022-05-14 02:46:29 +0200 <EvanR> Data.Map.Strict only stores evaluated
2022-05-14 02:46:56 +0200 <EvanR> might not matter in this case
2022-05-14 02:47:00 +0200 <laalyn> theoretically wouldn't DiffArray be the most performant?
2022-05-14 02:47:18 +0200 <laalyn> but i heard its slow because of underlying compiler workings
2022-05-14 02:47:30 +0200 <EvanR> for doing an IntMap, IntMap is best
2022-05-14 02:47:35 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 02:47:49 +0200 <laalyn> DiffArray could be used to emulate C data structures
2022-05-14 02:47:58 +0200 <laalyn> updates would be O(1) and lookups would be O(1)
2022-05-14 02:48:05 +0200 <EvanR> haven't heard anything good about DiffArray, but I may be out of date
2022-05-14 02:48:22 +0200 <laalyn> i was reading around a bit and noticed a trend of sorts
2022-05-14 02:48:34 +0200 <laalyn> it seems like people have rejected the whole "Versioned Array" idea
2022-05-14 02:48:39 +0200 <EvanR> big O usually comes with a big "up to constant factor"
2022-05-14 02:48:50 +0200 <laalyn> or fat nodes
2022-05-14 02:49:04 +0200 <laalyn> fgl used to be implemented with this i think but then they switched to trees
2022-05-14 02:49:09 +0200 <lechner> Something happened to http://dev.stephendiehl.com/hask
2022-05-14 02:50:12 +0200 <laalyn> well a versioned array would only need to do a write to update array then a write to add version delta
2022-05-14 02:50:37 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 02:50:46 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 02:50:47 +0200 <EvanR> it has to beat the IntMap which has a small number of levels
2022-05-14 02:51:12 +0200 <EvanR> aiui
2022-05-14 02:51:22 +0200shiraeeshi(~shiraeesh@109.166.57.239)
2022-05-14 02:51:40 +0200 <EvanR> actually if you go by big O, IntMap is also O(1) xD, where 1 = 64 bits
2022-05-14 02:52:17 +0200 <EvanR> still not convinced any of this is the real problem here
2022-05-14 02:52:31 +0200 <EvanR> it's usually unwanted laziness
2022-05-14 02:52:43 +0200HensonHensonAway
2022-05-14 02:53:09 +0200 <laalyn> sooo what if u need to exceed 64 bits
2022-05-14 02:53:58 +0200 <EvanR> that would be a huge number of items
2022-05-14 02:54:50 +0200 <EvanR> and wouldn't make sense with Int keys anyway
2022-05-14 02:55:57 +0200 <sm> we're just optimising by trial and error, alas. I think my next move would to simplify the code a lot until there's a perf issue I can understand and fix
2022-05-14 02:56:54 +0200 <EvanR> yeah don't be afraid to write smaller functions and then compose them, ghc will inline everything
2022-05-14 02:57:10 +0200 <laalyn> ok, reimped with IntMap
2022-05-14 02:57:12 +0200 <EvanR> it might make profiling easier
2022-05-14 02:57:26 +0200 <sm> and add one small bit back at a time
2022-05-14 02:57:36 +0200 <laalyn> i used the strict api and got 0.2s speedup from 1.7s to 1.5s
2022-05-14 02:57:49 +0200 <sm> +1 EvanR
2022-05-14 02:58:55 +0200 <sm> -fprof-auto labels the functions, but there are very few of them, so the profile is not very precise
2022-05-14 02:59:13 +0200 <sm> you could manually annotate all the subexpressions for more detail, but easier (and better for the code) to name them as functions
2022-05-14 02:59:47 +0200 <laalyn> so the move is to make the profile more granular
2022-05-14 03:00:20 +0200 <laalyn> ill wait for my libs to finish compiling with profiling support then try that
2022-05-14 03:00:27 +0200 <sm> yes I think so
2022-05-14 03:00:29 +0200 <EvanR> you can also do a memory profile to see if there's a memory leak
2022-05-14 03:00:33 +0200 <EvanR> well, space leak
2022-05-14 03:00:45 +0200 <sm> and/or, start with simpler code, fix and add small bits
2022-05-14 03:00:55 +0200 <EvanR> because that won't help your speed, and also indicates an issue with the code
2022-05-14 03:01:11 +0200 <laalyn> hmm well theres really only one component to the code
2022-05-14 03:01:14 +0200 <laalyn> which is the dfs
2022-05-14 03:01:44 +0200 <laalyn> and thats where the slowdown is
2022-05-14 03:01:52 +0200 <EvanR> if a ball of mud is too slow, there's no much you can do about it
2022-05-14 03:02:08 +0200 <sm> it's only 15 lines, but that's a ton of complexity
2022-05-14 03:02:26 +0200 <EvanR> but I have hope you don't actually have a ball of mud
2022-05-14 03:02:34 +0200 <laalyn> what would that imply
2022-05-14 03:02:39 +0200 <laalyn> a ball of mud
2022-05-14 03:02:55 +0200 <EvanR> a monolithic block of code you can't identify any functional parts of
2022-05-14 03:03:06 +0200 <EvanR> it must all live or die together
2022-05-14 03:03:23 +0200 <laalyn> well i can fully understand what its doing
2022-05-14 03:03:36 +0200 <laalyn> its just one fold
2022-05-14 03:03:52 +0200 <laalyn> to do recursive dfs call and recv the updated visited array back
2022-05-14 03:03:56 +0200 <EvanR> i beg to differ
2022-05-14 03:04:37 +0200 <laalyn> so its not the data structures problem
2022-05-14 03:04:51 +0200 <sm> you don't understand the laziness/space usage I think
2022-05-14 03:05:27 +0200 <laalyn> would you like to see the code in Elixir
2022-05-14 03:05:29 +0200 <laalyn> maybe thats more readable
2022-05-14 03:05:31 +0200 <EvanR> I think your memory profile should show a big jump when you load the data, then stay flat for the whole run, then die
2022-05-14 03:06:02 +0200 <EvanR> if not, could indicate a misunderstanding of the code
2022-05-14 03:06:02 +0200 <sm> ps, presumably 10000 and 30000 iterations is what you expect ? If that sounds like too many, that's always a good place to start
2022-05-14 03:06:20 +0200 <laalyn> thats what i expect
2022-05-14 03:06:28 +0200 <laalyn> since input size is 100x100
2022-05-14 03:06:36 +0200 <sm> ok, just checking
2022-05-14 03:06:42 +0200 <laalyn> yeah no problem
2022-05-14 03:07:20 +0200 <EvanR> >it's just recursing and returning the updated visited array
2022-05-14 03:07:34 +0200 <EvanR> make sure you evaluate the update before recursing
2022-05-14 03:07:48 +0200 <EvanR> or else it may build up a 30000 long thunk
2022-05-14 03:08:15 +0200 <laalyn> vis' is the new visited array
2022-05-14 03:08:19 +0200 <laalyn> so i would add a bang to that?
2022-05-14 03:08:22 +0200 <EvanR> since it's explicitly recursive, it's not foldl's responsibility
2022-05-14 03:09:26 +0200 <shiraeeshi> some update on me trying to build https://github.com/well-typed/memory-usage-zurihac-2021
2022-05-14 03:09:58 +0200 <shiraeeshi> I've installed ghc-9.2.1-alpha2
2022-05-14 03:10:02 +0200 <EvanR> dfs r c adj !vis = -- try that alternative to the definition of dfs
2022-05-14 03:10:36 +0200 <shiraeeshi> reverted cabal.project to the unchanged state
2022-05-14 03:10:39 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-05-14 03:11:16 +0200 <shiraeeshi> "cabal build" command gives me this error: https://paste.tomsmeding.com/xygZteig
2022-05-14 03:11:52 +0200 <shiraeeshi> it can't build OneTuple, base-compat, basement, blaze-builder
2022-05-14 03:13:06 +0200 <shiraeeshi> for OneTuple, the error says: Module ‘GHC.Tuple’ does not export ‘getSolo’
2022-05-14 03:14:18 +0200 <shiraeeshi> I've cloned OneTuple and looked at the source code, there is an import with conditional #ifdef
2022-05-14 03:15:17 +0200 <shiraeeshi> it executes the version under the condition:
2022-05-14 03:15:18 +0200 <shiraeeshi> #if MIN_VERSION_base(4,16,0)
2022-05-14 03:16:10 +0200dostoevsky6(~5c42c5384@user/dostoevsky)
2022-05-14 03:16:26 +0200 <shiraeeshi> in case of base 4-16, it imports GHC.Tuple (Solo (Solo), getSolo)
2022-05-14 03:16:46 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-05-14 03:16:50 +0200 <shiraeeshi> in case of base 4-15, it imports GHC.Tuple (Solo (Solo)) and then defines getSolo
2022-05-14 03:17:45 +0200 <shiraeeshi> this ghc-9.2.1-alpha2 has base-4.16, but it doesn't export getSolo
2022-05-14 03:17:46 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 03:17:47 +0200dostoevsky6dostoevsky
2022-05-14 03:18:27 +0200 <EvanR> note that accumulating updates to a vector of Bool one at a time is likely to be real slow
2022-05-14 03:18:35 +0200 <EvanR> it copies the whole vector each time
2022-05-14 03:19:24 +0200 <shiraeeshi> if I comment out the part that import Solo and getSolo
2022-05-14 03:19:33 +0200 <shiraeeshi> *imports
2022-05-14 03:20:04 +0200 <shiraeeshi> and put the base-4.15 code that imports Solo and defines getSolo - it compiles
2022-05-14 03:20:22 +0200 <monochrom> When "Solo" is said so many times, one wonders if it's really solo...
2022-05-14 03:21:03 +0200 <shiraeeshi> so my question is: how did it work on the day of the presentation?
2022-05-14 03:21:13 +0200 <EvanR> that we are having library problems involving a 1 tuple, I bet node.js people feel redeemed
2022-05-14 03:22:03 +0200 <EvanR> "look haskell can't even get 1 tuples to work. Don't even start with left padding"
2022-05-14 03:22:59 +0200 <monochrom> Do node.js people know tuples?
2022-05-14 03:23:30 +0200 <sclv> shiraeeshi: because it doesn’t use the normal package sources. it uses head.hackage which is a mutable overlay
2022-05-14 03:24:06 +0200 <jackdk> shiraeeshi: https://hackage.haskell.org/package/ghc-prim-0.8.0/docs/src/GHC.Tuple.html#getSolo the versions of Data.Tuple I see on Hackage for base-4.16.0.0 and 4.16.1.0 both `import GHC.Tuple (Solo(..))` for reexport but not the standalone `getSolo` function.
2022-05-14 03:24:06 +0200 <sclv> head.hackage gets reset with new patches every ghc release and the old ones get deleted
2022-05-14 03:24:23 +0200 <shiraeeshi> jackdk: you mean the line that says "repository head.hackage.ghc.haskell.org" ?
2022-05-14 03:24:29 +0200 <shiraeeshi> in cabal.project
2022-05-14 03:24:38 +0200 <sclv> no i mean that not jack :-)
2022-05-14 03:24:50 +0200 <jackdk> oh no I missed that context, I'm gonna go make more tea
2022-05-14 03:25:03 +0200 <sclv> it was written against a custom patchset that now no longer exists
2022-05-14 03:25:24 +0200 <shiraeeshi> oh my bad, I missed the right username
2022-05-14 03:25:39 +0200 <sclv> you can’t perfectly reproduce it. you can either do the incremental work to bring it up to date, or give up
2022-05-14 03:25:39 +0200 <monochrom> All of us need more wine.
2022-05-14 03:26:12 +0200 <sclv> there is a proposal to keep old head.hackage patch overlays around but… not now
2022-05-14 03:27:35 +0200 <shiraeeshi> jackdk: but #ifdef in OneTuple is written like I described
2022-05-14 03:28:09 +0200 <jackdk> shiraeeshi: ok I can't see that working using released packages but I have no idea what's on head.hackage
2022-05-14 03:29:14 +0200 <shiraeeshi> sclv: the readme of the demo I'm trying to build says: "Or, alternatively, use this nix invocation to set-up the environment."
2022-05-14 03:29:21 +0200 <shiraeeshi> nix-shell
2022-05-14 03:29:34 +0200 <shiraeeshi> "Configuring the haskell.nix caches will save you some build time (or you can remove the eventlog2html entry from the shell.nix file and install another way)."
2022-05-14 03:29:48 +0200 <shiraeeshi> I have 2 questions:
2022-05-14 03:30:04 +0200 <shiraeeshi> what does "configuring the haskell.nix caches" mean?
2022-05-14 03:30:34 +0200 <shiraeeshi> is it going to help with the mutable head.hackage situation?
2022-05-14 03:30:37 +0200 <sclv> nix has binary caches you can tell it to use to shortcut building derivations
2022-05-14 03:31:00 +0200 <shiraeeshi> they have shell.nix file in the project
2022-05-14 03:31:03 +0200 <sclv> i have no idea if the derivation is sufficiently valid still but the caches are orthogonal
2022-05-14 03:31:09 +0200 <shiraeeshi> perhaps it would help
2022-05-14 03:31:33 +0200 <sclv> it might, it might not. the caches will only change build times not the general situation
2022-05-14 03:32:10 +0200 <shiraeeshi> so it's not like they have an exact snapshot of what they used in that nix thing?
2022-05-14 03:32:24 +0200 <sclv> it depends how the nix was configured
2022-05-14 03:33:43 +0200 <shiraeeshi> sclv: "nix has binary caches you can tell it to use to shortcut building derivations"
2022-05-14 03:34:07 +0200 <shiraeeshi> you mean I can tell nix to download binaries from somewhere?
2022-05-14 03:34:16 +0200 <sclv> yes. but the caches are checked against the source hashes. they can’t be used without the full source
2022-05-14 03:34:22 +0200 <sclv> it just shortcuts building
2022-05-14 03:34:34 +0200 <sclv> it doesn’t make anything more or less installable
2022-05-14 03:35:15 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 03:35:45 +0200machinedgod(~machinedg@24.105.81.50)
2022-05-14 03:35:55 +0200 <shiraeeshi> so as I understand it, allow-newer and linking to mutable head.hackage made the build unreproducible
2022-05-14 03:36:11 +0200 <sclv> yes
2022-05-14 03:36:24 +0200 <sclv> particularly the latter.
2022-05-14 03:36:31 +0200 <jackdk> shiraeeshi: https://input-output-hk.github.io/haskell.nix/tutorials/getting-started.html#setting-up-the-binary…
2022-05-14 03:36:34 +0200 <shiraeeshi> and it's unlikely that nix is going to help with that
2022-05-14 03:37:49 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Remote host closed the connection)
2022-05-14 03:37:58 +0200 <sm> see if y'all can find /r/haskell in the https://anvaka.github.io/map-of-reddit
2022-05-14 03:37:58 +0200 <sm> phew.. now that that's settled..
2022-05-14 03:38:20 +0200 <sclv> In this case the nix derivation doesn’t pin the packages in head.hackage so it doesn’t look like it will help
2022-05-14 03:38:40 +0200 <sclv> if you read the derivation you see what it provides
2022-05-14 03:39:00 +0200 <shiraeeshi> where does the "nix-shell" command come from?
2022-05-14 03:39:01 +0200 <sm> (warning, the southern continent is NSFW)
2022-05-14 03:39:21 +0200 <sclv> it comes from installing the nix package manager
2022-05-14 03:39:55 +0200 <shiraeeshi> so it doesn't get shipped with cabal, just wanted to make sure
2022-05-14 03:40:28 +0200abhixec(~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
2022-05-14 03:40:30 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 03:40:45 +0200 <shiraeeshi> ok, perhaps I should ask the demo authors to make the demo buildable
2022-05-14 03:43:00 +0200 <shiraeeshi> or perhaps I can make it buildable by myself?
2022-05-14 03:43:16 +0200 <shiraeeshi> the presentation was 11 months ago
2022-05-14 03:44:06 +0200 <shiraeeshi> I can't port it to stack because we don't have a snapshot for ghc-9.2 yet, right?
2022-05-14 03:45:10 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2022-05-14 03:48:25 +0200 <sm> stackage nightly has ghc 9.2
2022-05-14 03:49:11 +0200 <sm> which voids the warranty I guess
2022-05-14 03:49:11 +0200 <sm> I am using it daily
2022-05-14 03:49:28 +0200andrey__(~andrey@p508d51c7.dip0.t-ipconnect.de)
2022-05-14 03:50:24 +0200 <shiraeeshi> how can I check if ghc-debug is in stackage nightly for ghc 9.2?
2022-05-14 03:50:56 +0200 <sm> another amusement: did you wonder which are our neighbour subreddits ? https://anvaka.github.io/sayit/?query=haskell
2022-05-14 03:51:04 +0200 <sm> shiraeeshi: go to http://stackage.org/nightly and find in page for ghc-debug
2022-05-14 03:51:32 +0200 <sm> if it's not, it can often still be installed from hackage
2022-05-14 03:51:44 +0200 <sm> or from github, in this case, I guess
2022-05-14 03:51:52 +0200andrey_(~andrey@p508d5b33.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-05-14 03:52:10 +0200 <shiraeeshi> no ghc-debug in there
2022-05-14 03:52:10 +0200 <sm> or gitlab, even
2022-05-14 03:52:55 +0200 <sm> https://gitlab.haskell.org/ghc/ghc-debug > "The project needs to built with a development version of GHC from this branch." > does not inspire confidence
2022-05-14 03:53:24 +0200 <sm> your best source of help for ghc-debug is #ghc I think
2022-05-14 03:54:06 +0200 <shiraeeshi> I guess I can just for some time until everything is in a stack snapshot
2022-05-14 03:54:27 +0200 <shiraeeshi> how long till it gets there, can anybody tell?
2022-05-14 03:54:33 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 248 seconds)
2022-05-14 03:54:50 +0200 <shiraeeshi> *I can just wait for some time
2022-05-14 03:55:41 +0200 <sm> could be a long wait.. if you want it to happen, best to engage with the maintainers
2022-05-14 03:55:58 +0200 <sm> just getting on hackage would be good
2022-05-14 03:56:32 +0200 <shiraeeshi> hmm, how would getting on hackage be good?
2022-05-14 03:56:48 +0200 <shiraeeshi> there are no snapshots in there
2022-05-14 03:57:23 +0200 <shiraeeshi> or do you mean I can link to hackage instead of mutable head.hackage once it gets there?
2022-05-14 03:57:38 +0200 <sm> getting on hackage means it's more buildable than a random git* repo
2022-05-14 03:57:42 +0200 <shiraeeshi> and then remove allow-newer
2022-05-14 03:58:46 +0200 <sm> if it's (recently published) on hackage, that suggests there is some reasonable build plan that doesn't require violating bounds with allow-newer, yes
2022-05-14 03:59:04 +0200 <sm> shiraeeshi: may I ask how you're so motivated ? is it something you need for work ?
2022-05-14 03:59:46 +0200 <shiraeeshi> idk why lol, seems like I've become a little bit obsessed
2022-05-14 04:00:17 +0200 <shiraeeshi> there is a video that shows how to profile for space leaks
2022-05-14 04:00:20 +0200 <sm> I hear that. +1 :)
2022-05-14 04:00:40 +0200 <shiraeeshi> I wanted to follow the example
2022-05-14 04:01:08 +0200 <sm> just reach out to mpickering on #ghc, you might get lucky
2022-05-14 04:01:10 +0200 <shiraeeshi> they are describing new niceties that they added that make debugging space leaks easier
2022-05-14 04:02:01 +0200 <shiraeeshi> before them, I mean now, you have to set some labels in the code and then search for them in the logs or something
2022-05-14 04:02:15 +0200 <shiraeeshi> the process becomes tedious
2022-05-14 04:02:36 +0200 <shiraeeshi> with the new thing that they added, it can automatically put labels
2022-05-14 04:02:56 +0200 <shiraeeshi> "cost centers"
2022-05-14 04:03:05 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-05-14 04:03:36 +0200 <sm> it's unfortunately often true that the latest shiny haskell tools are visible in the distance long before mortals can use them
2022-05-14 04:04:05 +0200 <sm> but I'm being a pessimist. Let us know if you have any luck
2022-05-14 04:04:54 +0200 <shiraeeshi> I guess the reason for my motivation is that it's an uncomfortable feeling when you know that laziness is problematic sometimes and can lead to space leaks
2022-05-14 04:05:04 +0200 <shiraeeshi> so you have to be careful about them
2022-05-14 04:05:15 +0200 <shiraeeshi> or at least be able to deal with them if they occur
2022-05-14 04:05:23 +0200 <sm> there are a lot of more mundane techniques you can use right now
2022-05-14 04:05:41 +0200 <sm> we were just working on such a problem before you started chatting, did you see ?
2022-05-14 04:05:59 +0200 <shiraeeshi> yes
2022-05-14 04:06:27 +0200 <shiraeeshi> but there is no guarantee that the space leaks won't occur, so you have to learn how to deal with them
2022-05-14 04:06:49 +0200 <sm> that's right, although you can go a long time without hitting one (or without hitting a hard one)
2022-05-14 04:07:45 +0200 <shiraeeshi> so how does debugging memory consumption look like now, in the current versions of ghc?
2022-05-14 04:07:54 +0200 <sm> they come up a lot more in beginner exercises than real-world programs, maybe
2022-05-14 04:08:01 +0200 <shiraeeshi> are there good resources about it?
2022-05-14 04:08:23 +0200 <sm> there's a chapter in the user guide I think, probably the best place to start
2022-05-14 04:08:30 +0200 <shiraeeshi> I have a vague understanding now after watching an intro from the demo
2022-05-14 04:08:40 +0200 <sm> and there have been good blog posts
2022-05-14 04:08:42 +0200 <shiraeeshi> ghc user guide
2022-05-14 04:08:44 +0200 <shiraeeshi> ?
2022-05-14 04:08:49 +0200 <sm> yes
2022-05-14 04:09:39 +0200 <shiraeeshi> ok, gonna take a look some time
2022-05-14 04:12:02 +0200 <sm> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/profiling.html#
2022-05-14 04:13:14 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
2022-05-14 04:13:48 +0200 <shiraeeshi> hey, thanks for the link, it went right into my stash of links
2022-05-14 04:13:50 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 04:14:15 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 04:15:21 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 04:15:58 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 04:16:03 +0200 <shiraeeshi> look like it's not a lot of text, I can actually read that in an hour or so
2022-05-14 04:16:27 +0200 <sm> @where profiling also has it, nice
2022-05-14 04:16:27 +0200 <lambdabot> http://www.haskell.org/ghc/docs/latest/html/users_guide/profiling.html
2022-05-14 04:16:52 +0200 <sm> mastering the techiques in the chapter will take a lot longer, but could be a superpower
2022-05-14 04:22:13 +0200 <sm> heck, just printing it and sticking on the wall would probably give superpower
2022-05-14 04:22:28 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
2022-05-14 04:22:53 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 04:23:02 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 04:27:19 +0200AlexNoo_(~AlexNoo@178.34.162.184)
2022-05-14 04:27:42 +0200dostoevsky7(~5c42c5384@user/dostoevsky)
2022-05-14 04:27:44 +0200 <shiraeeshi> "with the new thing that they added, it can automatically put labels"
2022-05-14 04:28:30 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 04:28:30 +0200dostoevsky7dostoevsky
2022-05-14 04:28:40 +0200 <shiraeeshi> correction: it allows to automatically distinguish different invokations of data constructors (in creation or in pattern matching, I don't remember)
2022-05-14 04:29:10 +0200AlexZenon(~alzenon@178.34.163.35) (Ping timeout: 240 seconds)
2022-05-14 04:29:30 +0200Alex_test(~al_test@178.34.163.35) (Ping timeout: 240 seconds)
2022-05-14 04:31:18 +0200AlexNoo(~AlexNoo@178.34.163.35) (Ping timeout: 276 seconds)
2022-05-14 04:31:40 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 04:33:06 +0200AlexZenon(~alzenon@178.34.162.184)
2022-05-14 04:33:25 +0200Alex_test(~al_test@178.34.162.184)
2022-05-14 04:33:51 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 04:45:45 +0200Benzi-Junior(~BenziJuni@88-149-64-179.du.xdsl.is) (Ping timeout: 248 seconds)
2022-05-14 04:47:26 +0200dostoevsky2(~5c42c5384@user/dostoevsky)
2022-05-14 04:49:08 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 04:49:08 +0200dostoevsky2dostoevsky
2022-05-14 05:06:48 +0200Benzi-Junior(~BenziJuni@dsl-149-64-179.hive.is)
2022-05-14 05:07:50 +0200m1dnight(~christoph@78-22-9-5.access.telenet.be) (Ping timeout: 246 seconds)
2022-05-14 05:10:10 +0200m1dnight(~christoph@78.22.9.5)
2022-05-14 05:10:56 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
2022-05-14 05:11:39 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 05:12:37 +0200gabiruh(~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in)
2022-05-14 05:13:06 +0200gabiruh(~gabiruh@vps19177.publiccloud.com.br)
2022-05-14 05:13:40 +0200Benzi-Junior(~BenziJuni@dsl-149-64-179.hive.is) (Ping timeout: 248 seconds)
2022-05-14 05:13:59 +0200vicfred(~vicfred@user/vicfred)
2022-05-14 05:17:55 +0200dostoevsky3(~5c42c5384@user/dostoevsky)
2022-05-14 05:18:55 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 05:18:56 +0200dostoevsky3dostoevsky
2022-05-14 05:26:53 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
2022-05-14 05:27:09 +0200HensonAwayHenson
2022-05-14 05:27:15 +0200Henson(~kvirc@107-179-133-201.cpe.teksavvy.com) (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
2022-05-14 05:29:59 +0200stackdroid18(14094@user/stackdroid) (Quit: hasta la vista... tchau!)
2022-05-14 05:33:00 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
2022-05-14 05:41:13 +0200rekahsoft(~rekahsoft@bras-base-wdston4533w-grc-02-142-113-160-8.dsl.bell.ca) (Ping timeout: 260 seconds)
2022-05-14 05:45:19 +0200coot(~coot@213.134.190.95)
2022-05-14 05:49:33 +0200smitop2(uid328768@id-328768.tinside.irccloud.com) (Quit: Connection closed for inactivity)
2022-05-14 05:50:02 +0200dostoevsky3(~5c42c5384@user/dostoevsky)
2022-05-14 05:51:37 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 05:51:37 +0200dostoevsky3dostoevsky
2022-05-14 05:56:50 +0200bontaq(~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 240 seconds)
2022-05-14 06:02:38 +0200jargon(~jargon@174-22-206-112.phnx.qwest.net) (Quit: Nini.)
2022-05-14 06:05:59 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 06:10:43 +0200Sgeo(~Sgeo@user/sgeo)
2022-05-14 06:14:01 +0200zebrag(~chris@user/zebrag) (Read error: Connection reset by peer)
2022-05-14 06:16:32 +0200dzdcnfzd(~dzdcnfzd@pool-108-54-250-165.nycmny.fios.verizon.net)
2022-05-14 06:16:58 +0200 <dzdcnfzd> I have a stack project. I want to write tests for it in bash and run them with stack test. What's the best way to do this?
2022-05-14 06:18:09 +0200 <dzdcnfzd> I've found people saying I should make a .hs test with a main that just calls the bash scripts in question and returns non-zero if any of them return non-zero, then mark that test as of type exitcode-stdio-1.0 in my project.cabal file
2022-05-14 06:18:21 +0200 <dzdcnfzd> but I'm using a stack.yaml file, not a project.cabal file
2022-05-14 06:19:19 +0200 <dzdcnfzd> My goal in this is to be able to type "stack test" and have it build the executable and then run the tests
2022-05-14 06:21:50 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2022-05-14 06:23:22 +0200kitty1(~kitty@096-039-147-043.res.spectrum.com) (Read error: Connection reset by peer)
2022-05-14 06:23:24 +0200dostoevsky5(~5c42c5384@user/dostoevsky)
2022-05-14 06:24:39 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 06:24:39 +0200dostoevsky5dostoevsky
2022-05-14 06:25:59 +0200 <dsal> dzdcnfzd: Have you considered using a normal test framework?
2022-05-14 06:26:00 +0200 <Axman6> dzdcnfzd: my advice would just be to use cabal, you can make stack understand a cabal based project quite easily but trying to go the other way can be harder
2022-05-14 06:26:42 +0200 <Axman6> why do you want to write the tests in bash? what are you trying to do that you couldn't do from a haskell terstsuite?
2022-05-14 06:27:21 +0200 <dzdcnfzd> Axman6: I'm writing a utility that interops with sed
2022-05-14 06:28:36 +0200 <dsal> It's unclear what Haskell's role in this is, but haskell's got a few good test frameworks.
2022-05-14 06:28:49 +0200 <dzdcnfzd> The easiest way I know to check my program's correctness is to write a little script that runs my program on a file, gets the output, uses it for a sed command, and checks the output against a known value
2022-05-14 06:28:52 +0200 <dsal> I like tasty. tasty-discover works reasonably well.
2022-05-14 06:29:12 +0200 <Axman6> you can run both your program and sed from haskell pretty easily
2022-05-14 06:29:14 +0200 <dsal> tasty-golden would do the thing above fairly well, but it's a somewhat limited test case.
2022-05-14 06:30:19 +0200 <Axman6> https://hackage.haskell.org/package/process-1.6.14.0/docs/System-Process.html
2022-05-14 06:31:25 +0200 <Axman6> I believe you can also get cabal to tell you the path to the binary you've compiled, but I've never done that
2022-05-14 06:31:25 +0200 <dzdcnfzd> I guess
2022-05-14 06:31:38 +0200 <dzdcnfzd> That would be cool
2022-05-14 06:31:59 +0200 <sclv> ‘cabal list-bin’
2022-05-14 06:32:09 +0200phma(~phma@host-67-44-208-89.hnremote.net) (Read error: Connection reset by peer)
2022-05-14 06:32:11 +0200 <dzdcnfzd> is there a way to get that automatically as an input to the test?
2022-05-14 06:32:13 +0200 <dzdcnfzd> or no
2022-05-14 06:32:25 +0200 <dzdcnfzd> In general for testing, is there any concept of custom scripts
2022-05-14 06:32:27 +0200 <dzdcnfzd> or actions
2022-05-14 06:32:29 +0200 <dzdcnfzd> in cabal
2022-05-14 06:32:46 +0200phma(~phma@2001:5b0:211f:6928:8569:9a3:f6e6:2945)
2022-05-14 06:32:57 +0200 <sclv> i would just call the “main” function of the program directly
2022-05-14 06:32:59 +0200 <dsal> If you need to run your executable, you should consider making main smaller so you can use it as a library.
2022-05-14 06:32:59 +0200 <dzdcnfzd> or will stack test always just run a particular haskell executable
2022-05-14 06:33:01 +0200 <Axman6> cabal can create some useful modules for you during compilation, but I can;t remember how that's done
2022-05-14 06:33:06 +0200zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2022-05-14 06:33:21 +0200 <Axman6> sclv: can you do and control what it sees as stdin, stdout etc?
2022-05-14 06:33:24 +0200 <sclv> the pattern is make the program mainly in a lib, and the executable stanza is a thin wrapper
2022-05-14 06:33:29 +0200 <dzdcnfzd> dsal: that's a good idea
2022-05-14 06:34:00 +0200 <dzdcnfzd> sclv: yeah, of course, that's a good pattern, but I think it's worse for testing
2022-05-14 06:34:04 +0200 <dzdcnfzd> I want a real integration test
2022-05-14 06:34:07 +0200 <sclv> Axman6: sorta, but usually its better to test componants and not drive it directly.
2022-05-14 06:34:15 +0200 <dzdcnfzd> end-to-end
2022-05-14 06:34:17 +0200 <dsal> As a library, I'd expect to be able to supply a bytestring of some sort as input and have a bytestring of some sort as output and a configuration structure.
2022-05-14 06:34:33 +0200 <Axman6> yeah if your main can do something like appMain :: Args -> ByteString {- stding -} -> IO ByteString then your testing will be as simple as running it, calling sed using the above module, and comparing the results
2022-05-14 06:35:04 +0200 <sclv> for a real integration test, you can recursively invoke “list-bin” within it, or require the bin as a cmd line arg
2022-05-14 06:35:55 +0200 <dzdcnfzd> is the wisdom of the crowd that I should forsake stack.yaml in favor of my-project.cabal?
2022-05-14 06:36:08 +0200 <dzdcnfzd> I don't have a lot of stack or cabal knowledge so
2022-05-14 06:36:14 +0200 <dzdcnfzd> is this what people do?
2022-05-14 06:36:18 +0200 <sclv> but again anything that needs this is typically big enough to be testing multiple integrated components and the test should then be a whole separate project
2022-05-14 06:36:42 +0200 <dsal> I use stack, but stack isn't related to your problem.
2022-05-14 06:36:43 +0200bilegeek(~bilegeek@2600:1008:b047:7868:8343:8573:5cc1:560a)
2022-05-14 06:37:24 +0200 <dzdcnfzd> I just mean in general
2022-05-14 06:37:28 +0200 <dzdcnfzd> I think I have to pick one, right?
2022-05-14 06:37:48 +0200 <dzdcnfzd> I have to either manually modify my cabal file or use stack.yaml
2022-05-14 06:38:04 +0200 <dzdcnfzd> if I manually modify my cabal file it tells me it's skipping the stack.yaml I think?
2022-05-14 06:38:05 +0200 <dsal> Well, package.yaml, which writes out your cabal file and you can do that without stack if you'd like.
2022-05-14 06:38:12 +0200 <dsal> You don't modify stack.yaml very much.
2022-05-14 06:38:36 +0200 <dzdcnfzd> Ah, I see
2022-05-14 06:38:41 +0200 <dzdcnfzd> Okay, same question though
2022-05-14 06:38:55 +0200 <dzdcnfzd> Should I be forsaking package.yaml in favor of myProject.caba
2022-05-14 06:38:58 +0200 <dzdcnfzd> *.cabal
2022-05-14 06:39:07 +0200 <dsal> I wouldn't write out .cabal files by hand.
2022-05-14 06:39:28 +0200 <dsal> We don't use stack at work (for the bulk of our software), but we do use hpack because writing .cabal files by hand sounds like a terrible idea.
2022-05-14 06:39:43 +0200 <dsal> We've got like, thousands of modules and would just constantly have conflicts if people did that by hand.
2022-05-14 06:41:38 +0200 <dsal> I've been using stack for years and have never successfully migrated a project off of it, but that's still independent of "how do I write testable code and then test that testable code?"
2022-05-14 06:45:16 +0200zaquest(~notzaques@5.130.79.72)
2022-05-14 06:46:41 +0200 <dzdcnfzd> I see
2022-05-14 06:50:04 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
2022-05-14 06:50:53 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo)
2022-05-14 06:50:59 +0200 <sm> stack user here, checking in
2022-05-14 06:51:09 +0200 <dzdcnfzd> thanks btw
2022-05-14 06:51:17 +0200 <dzdcnfzd> currently trying to put together a tasty test
2022-05-14 06:51:50 +0200 <sm> dzdcnfzd, as I think you know, you can define test suites, and these run arbitrary haskell code, which can do anything including running shell scripts
2022-05-14 06:51:58 +0200 <sm> and by the way have you seen shelltestrunner ?
2022-05-14 06:52:36 +0200 <sm> I'm curious though if it's actually important for `stack test` to run everything ? I use `make test` as my top level command
2022-05-14 06:53:02 +0200 <dzdcnfzd> sm: No, I haven't seen it. Yeah, I know I can do whatever I want from a haskell file. I just wanted to do it as simply as possible
2022-05-14 06:53:44 +0200 <dzdcnfzd> As to make -- it'd also work, I guess, but it's another bit of tooling
2022-05-14 06:53:55 +0200 <sm> or just a shell script
2022-05-14 06:53:59 +0200 <sm> ./test
2022-05-14 06:54:06 +0200 <dzdcnfzd> Yes, I considered that
2022-05-14 06:54:15 +0200 <dzdcnfzd> That's basically what I wanted
2022-05-14 06:54:34 +0200 <dzdcnfzd> The only thing is that the shell script would have to run stack build
2022-05-14 06:54:58 +0200 <sm> it can do that.. I have my make test rule do that
2022-05-14 06:55:01 +0200 <dzdcnfzd> I wanted to be able to run `stack test` -> stack builds the project, invokes my script
2022-05-14 06:55:05 +0200 <dsal> Why upside down? Just make `stack test --file-watch` work
2022-05-14 06:55:20 +0200coot(~coot@213.134.190.95) (Quit: coot)
2022-05-14 06:55:23 +0200 <dzdcnfzd> What do you mean?
2022-05-14 06:55:41 +0200 <sm> dzdcnfzd: wants to run shell script tests, and doesn't want to write haskell code to do that if there's an easier way
2022-05-14 06:55:54 +0200 <dzdcnfzd> sm: with make it'd be possible. I was hoping there'd be a native way within cabal
2022-05-14 06:56:01 +0200 <dzdcnfzd> Or stack
2022-05-14 06:56:06 +0200 <dsal> I think running stack from haskell from stack to write a test in shell is definitely the hardest way.
2022-05-14 06:56:29 +0200 <sm> the native way would be test/Main.hs: runProcess "./test" :)
2022-05-14 06:56:38 +0200laalyn(~laalyn@c-73-189-182-49.hsd1.ca.comcast.net) (Quit: Client closed)
2022-05-14 06:56:43 +0200 <dzdcnfzd> I'm actually writing a haskell program that constructs a make file that builds everything and runs it
2022-05-14 06:56:45 +0200 <dzdcnfzd> very simple
2022-05-14 06:57:02 +0200 <dsal> How is that more simple than just calling your function and inspecting the output?
2022-05-14 06:57:16 +0200 <sm> I think you should generate the whole thing from a bash script for easy deployment
2022-05-14 06:57:29 +0200smsemi-joking
2022-05-14 06:57:56 +0200 <dsal> I think any involvement of shell just greatly complicates things and makes them less portable.
2022-05-14 06:58:31 +0200 <dzdcnfzd> dsal I was joking above, but why would using the shell make it less portable?
2022-05-14 06:58:53 +0200 <sm> windows.. different shells available on unix machines..
2022-05-14 06:59:02 +0200 <sm> different shell versions (apple vs homebrew, etc)
2022-05-14 06:59:27 +0200 <dzdcnfzd> Yeah, that's a good point
2022-05-14 07:00:58 +0200laalyn(~laalyn@c-73-189-182-49.hsd1.ca.comcast.net)
2022-05-14 07:00:59 +0200 <dsal> Based on the description, it sounds like you just have a thing that takes some input and produces some output. Something like this does most of the work for you: https://hackage.haskell.org/package/tasty-golden-2.3.5/docs/Test-Tasty-Golden.html#v:goldenVsString
2022-05-14 07:02:17 +0200 <dzdcnfzd> That is what I'm going to use but it's only sort of the case
2022-05-14 07:02:23 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 07:02:32 +0200 <sm> yes, I will shill shelltestrunner a little more - that might replace some of your test scripts. Though it's one more thing to install, it's more cross platform than sh. tasty-golden does similar work but requires a bit of programming
2022-05-14 07:02:37 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2022-05-14 07:03:25 +0200 <dzdcnfzd> the whole testing thing is a little bit complicated by the fact that it's a utility whose output is meant to be used by a `sed` command
2022-05-14 07:03:28 +0200 <laalyn>  /msg NickServ VERIFY REGISTER laalyn DA5QhWyzExBdppzD
2022-05-14 07:03:42 +0200 <dzdcnfzd> Uhhhhhh
2022-05-14 07:03:46 +0200 <dzdcnfzd> He laalyn
2022-05-14 07:03:58 +0200 <laalyn> yeaaah im guessing that cmd didnt work
2022-05-14 07:04:02 +0200 <dzdcnfzd> lol
2022-05-14 07:04:14 +0200 <dsal> dzdcnfzd: that shouldn't be an issue. You've got a function that takes a bytestring and returns a bytestring, right?
2022-05-14 07:04:18 +0200 <dzdcnfzd> sm: it looks very cool
2022-05-14 07:04:25 +0200 <dzdcnfzd> dsal: yes
2022-05-14 07:04:36 +0200 <sm> I rely on it
2022-05-14 07:04:45 +0200 <dzdcnfzd> but the bytestring it outputs isn't the one I care about
2022-05-14 07:04:55 +0200 <dzdcnfzd> I care about how sed behaves when I feed it that bytestring
2022-05-14 07:05:11 +0200 <dzdcnfzd> Hence the shell part
2022-05-14 07:05:19 +0200smnotes that sed itself is highly non-portable.. but that's what tests will tell you
2022-05-14 07:05:20 +0200laalyn(~laalyn@c-73-189-182-49.hsd1.ca.comcast.net) (Client Quit)
2022-05-14 07:05:39 +0200laalyn(~laalyn@c-73-189-182-49.hsd1.ca.comcast.net)
2022-05-14 07:05:51 +0200 <dsal> Sure, sed is not portable, but the next step would be replacing sed.
2022-05-14 07:06:05 +0200 <sm> perl ftw
2022-05-14 07:06:30 +0200 <laalyn> perl 6 is pretty cool
2022-05-14 07:07:01 +0200 <sm> heh, perl 6 is what got me interested in this exotic new language "Haskell"
2022-05-14 07:07:05 +0200 <dsal> I guess I don't understand how a shell script improves anything here. If you have a stream editor, you write the tests against that interface. Changing the implementation from sed to conduit shouldn't break any tests.
2022-05-14 07:08:38 +0200 <sm> dsal.. I'm guessing that writing and changing the shell tests can be (for lots of folks) a lot quicker than futzing with compilation and unfamiliar libs
2022-05-14 07:09:06 +0200 <sm> and, maybe closer to the intended real-world use of the tool ?
2022-05-14 07:09:16 +0200 <dzdcnfzd> dsal: exactly. I was hoping to hack this together in 30m. It's going to be a bigger time investment now
2022-05-14 07:09:27 +0200 <dzdcnfzd> Because I don't know the libs, I'm not an expert in haskell IO
2022-05-14 07:09:37 +0200 <dsal> I… guess, but if you're writing stuff in Haskell, you've got great tools for correctness and stuff.
2022-05-14 07:10:03 +0200 <dsal> I wouldn't expect the tests to use any IO unless you were using the golden thing.
2022-05-14 07:10:09 +0200 <sm> I know it would take me an hour or possibly half a day debugging some stupid lazy IO/concurrency issue
2022-05-14 07:10:11 +0200 <dsal> Some tests are better than no tests, but good tests are within reach.
2022-05-14 07:11:35 +0200 <dzdcnfzd> dsal I definitely need IO
2022-05-14 07:11:47 +0200 <dzdcnfzd> how are you gonna run an external program without IO?
2022-05-14 07:12:17 +0200 <dsal> Yeah, but that's the part you already have to write, not the test.
2022-05-14 07:12:30 +0200 <dzdcnfzd> ?
2022-05-14 07:12:35 +0200 <dsal> The test is just "if I call my thing with x I get y"
2022-05-14 07:12:39 +0200 <dzdcnfzd> No
2022-05-14 07:12:43 +0200 <dzdcnfzd> That's not end-to-end
2022-05-14 07:12:48 +0200 <dzdcnfzd> that's a unit test
2022-05-14 07:13:40 +0200 <dzdcnfzd> For context, what I've done is made a DSL that compiles down to sed regexes
2022-05-14 07:14:14 +0200 <dzdcnfzd> My tests are programs written in this DSL, combined with sed input that I'd like to test against these programs
2022-05-14 07:14:44 +0200 <dsal> Ok, then the test is "If I call my thing with f and x I get y"
2022-05-14 07:16:01 +0200 <dzdcnfzd> so basically I have `echo "test1_sedInput.txt" | sed -E "$(stack exec my-program test1_programInput)" > test1_golden.txt`
2022-05-14 07:16:41 +0200 <dzdcnfzd> That exact command is an almost fully specified test without any extra work
2022-05-14 07:17:12 +0200 <dzdcnfzd> I can write a haskell program to do all that for me but it's going to be significantly more work to put together
2022-05-14 07:17:15 +0200 <dzdcnfzd> that's all
2022-05-14 07:18:11 +0200 <dsal> Well, so is the thing you're describing and why you're here. You still have to have a collection of those inputs, outputs, expected outputs, validation, error reporting, and runtime. And it's super convenient when that runs with `stack test --file-watch`. That whole thing is one relatively small function and you could do it with a loop over specified inputs.
2022-05-14 07:18:59 +0200 <dsal> If you give me a repo I can clone, I should be able to prototype that pretty quickly.
2022-05-14 07:19:26 +0200 <dzdcnfzd> Yep. But that's why I wanted to just have a way to do `stack test` and have it build and then run a shell script
2022-05-14 07:20:13 +0200 <dzdcnfzd> Don't feel compelled to! But I can certainly show you the repo. I'm hoping people will find it interesting anyways
2022-05-14 07:20:27 +0200dostoevsky3(~5c42c5384@user/dostoevsky)
2022-05-14 07:21:12 +0200 <dsal> Nah, I was trying to work on one of my programs, but I don't have any outstanding issues at the moment. heh
2022-05-14 07:21:51 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 07:21:51 +0200dostoevsky3dostoevsky
2022-05-14 07:22:11 +0200smnotes that --file-watch is awesome, but so is entr
2022-05-14 07:22:28 +0200 <sm> and for that matter, ghcid -t
2022-05-14 07:23:26 +0200 <dsal> We don't use stack at work, but apparently other people use ghcid and have a great time. I've never actually got it working. heh
2022-05-14 07:24:58 +0200 <sm> for extra fun, combine two or more of these
2022-05-14 07:25:43 +0200 <sm> what's your latest project dsal ?
2022-05-14 07:26:05 +0200 <dsal> I've mostly just been doing work stuff.
2022-05-14 07:26:40 +0200 <dsal> I get to write a lot of parsers for obscure formats written by people who've never spoken to the nerds who have to touch the computers.
2022-05-14 07:26:53 +0200 <sm> ouch
2022-05-14 07:26:58 +0200 <sm> good thing you have haskell eh
2022-05-14 07:27:10 +0200 <dsal> Yeah, it's kind of nice.
2022-05-14 07:28:08 +0200 <dsal> I've learned to not hate hedgehog at least. Though the project as a whole currently makes it a little difficult to write hedgehog tests against effectful code. Hoping to get that fixed because the thing I'm working on right now is complicated, insufficiently tested, and I'm adding a lot of complication.
2022-05-14 07:31:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 07:34:06 +0200 <dzdcnfzd> dsal: https://github.com/anthonyrgreen/sedx-compile
2022-05-14 07:34:46 +0200 <dsal> dzdcnfzd: Is that private? I'm dustin if you want to limit access.
2022-05-14 07:35:02 +0200 <dzdcnfzd> I made it public
2022-05-14 07:35:14 +0200 <dzdcnfzd> Is it visible?
2022-05-14 07:35:50 +0200 <dsal> I get a 404
2022-05-14 07:36:26 +0200 <dzdcnfzd> Ahh, whoops
2022-05-14 07:36:28 +0200 <dzdcnfzd> https://github.com/anthonyrgreen/sedx-compiler
2022-05-14 07:36:50 +0200 <dsal> compiles!
2022-05-14 07:36:59 +0200 <dsal> Well, checks out. I'll find out if it compiles eventually.
2022-05-14 07:37:29 +0200 <dzdcnfzd> :)
2022-05-14 07:38:00 +0200 <dzdcnfzd> If you see me doing anything really dumb and get inspired to tell me it's dumb, please do so
2022-05-14 07:38:11 +0200 <dzdcnfzd> I am making up my haskell style as I go along
2022-05-14 07:38:21 +0200 <dzdcnfzd> Pretty sure I'm doing things the wrong way in places
2022-05-14 07:39:46 +0200 <dsal> Well, it doesn't compile.
2022-05-14 07:39:49 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 07:40:09 +0200 <dzdcnfzd> What happens?
2022-05-14 07:40:13 +0200 <dsal> I like stylish-haskell for some basic layout advice. And hlint for other advice
2022-05-14 07:40:27 +0200 <dsal> Not in scope: type constructor or class ‘LinkedMatch’
2022-05-14 07:40:36 +0200 <dzdcnfzd> what command is this?
2022-05-14 07:40:43 +0200 <dsal> stack test
2022-05-14 07:40:53 +0200 <dsal> or stack biuld
2022-05-14 07:40:54 +0200 <dzdcnfzd> Ah, yes
2022-05-14 07:41:08 +0200 <dzdcnfzd> stack build is working for me, not sure what's happening for you
2022-05-14 07:41:18 +0200 <dzdcnfzd> stack test isn't working because I just started writing it
2022-05-14 07:41:53 +0200 <dzdcnfzd> wait a sec
2022-05-14 07:41:56 +0200 <dzdcnfzd> I know what's happening
2022-05-14 07:42:06 +0200 <dzdcnfzd> I didn't add one file to my commit, sorry
2022-05-14 07:42:15 +0200 <dsal> Yeah. Give me more files!
2022-05-14 07:43:08 +0200 <dzdcnfzd> I think it should work
2022-05-14 07:43:47 +0200 <dsal> builds!
2022-05-14 07:44:04 +0200dostoevsky4(~5c42c5384@user/dostoevsky)
2022-05-14 07:45:30 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 07:45:30 +0200dostoevsky4dostoevsky
2022-05-14 07:47:21 +0200 <dsal> dzdcnfzd: There aren't any sedx files around. Perhaps one way to structure this might be to make a directory structure with ["input", "sedx", "expected"]
2022-05-14 07:48:02 +0200 <dzdcnfzd> Yes, I just decided on the file extension
2022-05-14 07:48:18 +0200 <dsal> I mean, can you toss in something you'd like to see tested.
2022-05-14 07:48:25 +0200 <dzdcnfzd> You can see what will be a .sedx file under https://github.com/anthonyrgreen/sedx-compiler/blob/main/sample_programs/search_and_replace.txt
2022-05-14 07:48:49 +0200 <dzdcnfzd> I can make the sed input file and upload it next to that
2022-05-14 07:49:39 +0200 <dzdcnfzd> Hold up a sec, I'll fix the extension and add the other input, plus the output files
2022-05-14 07:50:45 +0200 <dsal> I'm thinking an easy way to do things is "tests/{arbitrary,directory,names}/{input,script.sedx,expected}"
2022-05-14 07:51:54 +0200 <dsal> Style opinion: Never use `return` -- I can't ever tell whether someone understand what it does.
2022-05-14 07:52:27 +0200kuribas`(~user@d51529C17.access.telenet.be)
2022-05-14 07:54:46 +0200 <dzdcnfzd> I have uploaded the test files
2022-05-14 07:54:58 +0200 <dzdcnfzd> they are in three directories under test/
2022-05-14 07:55:16 +0200kuribas(~user@ptr-17d51eo38esxcyx0dri.18120a2.ip6.access.telenet.be) (Ping timeout: 248 seconds)
2022-05-14 07:56:21 +0200 <dzdcnfzd> correction: they are NOW in the three proper directories.
2022-05-14 07:56:27 +0200shiraeeshi(~shiraeesh@109.166.57.239) (Ping timeout: 240 seconds)
2022-05-14 07:57:06 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2022-05-14 07:57:23 +0200gabiruh(~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in)
2022-05-14 07:57:45 +0200gabiruh(~gabiruh@vps19177.publiccloud.com.br)
2022-05-14 07:58:07 +0200 <dsal> I'd put them all in the same directory. Let me make something that works real quick. You're actually pretty close.
2022-05-14 08:02:50 +0200coot(~coot@213.134.190.95)
2022-05-14 08:03:00 +0200 <dsal> Sorry, taking me a sec to figure out how to use your lib.
2022-05-14 08:08:35 +0200 <dsal> It's failing to parse the example.
2022-05-14 08:09:38 +0200 <energizer> i am looking for a string formatting tool like sprintf or f-strings but in a composable ADT style rather than a compact dsl style. is there something like that?
2022-05-14 08:11:03 +0200 <dzdcnfzd> dsal: Sorry, I'm not sure what I changed. I'm trying to figure it out now
2022-05-14 08:11:09 +0200 <dsal> https://www.irccloud.com/pastebin/ErIdYuKn/
2022-05-14 08:11:55 +0200 <dzdcnfzd> I got it
2022-05-14 08:12:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 08:13:50 +0200 <dzdcnfzd> The program is fixed
2022-05-14 08:13:58 +0200 <dzdcnfzd> the .sedx input i mean
2022-05-14 08:14:24 +0200 <sm> energizer: would that be something like https://hackage.haskell.org/package/pretty-1.1.3.6/docs/Text-PrettyPrint.html#t:Doc ?
2022-05-14 08:15:56 +0200 <energizer> sm i dont think so. a solution would have a million ways to format a float
2022-05-14 08:16:18 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 08:16:22 +0200 <energizer> but maybe it's there and i'm missing something
2022-05-14 08:17:08 +0200frost(~frost@user/frost)
2022-05-14 08:18:10 +0200 <dsal> dzdcnfzd: Sorry, I've mangled the project a bit in order to get something that was easier to add.
2022-05-14 08:18:17 +0200 <sm> https://hackage.haskell.org/package/formatting ?
2022-05-14 08:18:18 +0200 <dzdcnfzd> No worries
2022-05-14 08:18:30 +0200 <dzdcnfzd> It's awesome you're looking at it
2022-05-14 08:18:38 +0200 <sm> seems like a few of them at https://hackage.haskell.org/packages/search?terms=printf
2022-05-14 08:19:42 +0200 <dsal> dzdcnfzd: OK. So when the test fails, it isn't *super* useful. Let's use the diff one and toss portability out for a moment.
2022-05-14 08:19:53 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-05-14 08:19:54 +0200 <dzdcnfzd> kk
2022-05-14 08:20:40 +0200 <energizer> thanks sm
2022-05-14 08:23:19 +0200 <dsal> Well, I can't actually tell what's wrong because I don't know what any of this is doing, but this is a useful test, I think. Each directory is a test with an input, expected, and script.sedx https://www.irccloud.com/pastebin/AJwgukSD/Spec.hs
2022-05-14 08:23:41 +0200 <dsal> Also, using this package.yaml https://www.irccloud.com/pastebin/88PtXA5Q/package.yaml
2022-05-14 08:24:24 +0200 <dsal> When I run it, it fails like this. I don't know what it's supposed to do, so maybe that's right. heh https://www.irccloud.com/pastebin/n51OSs0Q/test.out
2022-05-14 08:25:39 +0200 <dsal> Oh. ha. dumb
2022-05-14 08:26:13 +0200 <dsal> Well, it's running on its input. I can't quite tell where the `sedInput` is supposed to be used.
2022-05-14 08:26:22 +0200 <dzdcnfzd> That's awesome!
2022-05-14 08:26:53 +0200jakalx(~jakalx@base.jakalx.net)
2022-05-14 08:28:05 +0200 <dzdcnfzd> The intent is that test.out is what you get if you run `cat "${sedInput}" | sed -e ${ what you're currently putting in the .out file }`
2022-05-14 08:28:07 +0200 <dsal> I don't quite understand what's going on here well enough, but you probably do, so you can at least see where I got it.
2022-05-14 08:28:16 +0200 <dzdcnfzd> What you wrote is very helpful
2022-05-14 08:28:24 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 08:28:36 +0200 <dsal> Yeah, I think you just need to make `runSedxAndReplace` do something more sensible.
2022-05-14 08:28:54 +0200 <dzdcnfzd> Basically I have to take that, and rather than piping what you have directly to the outfile, run a `sed` command on the basis of it
2022-05-14 08:29:29 +0200 <dzdcnfzd> Side note: are you manually doing all your imports?
2022-05-14 08:29:35 +0200 <dzdcnfzd> Or do you have a tool?
2022-05-14 08:29:48 +0200 <dsal> I just do imports manually, yeah.
2022-05-14 08:29:58 +0200 <dsal> stylish-haskell lines them up for me.
2022-05-14 08:33:37 +0200 <dzdcnfzd> This awesome
2022-05-14 08:33:40 +0200 <dzdcnfzd> thanks a lot
2022-05-14 08:33:49 +0200 <dzdcnfzd> Your code is also much cleaner than mine, which is cool
2022-05-14 08:35:24 +0200 <dsal> I'm not sure this sed thing actually works.
2022-05-14 08:38:03 +0200 <dsal> -import {ExtraImport, Module1, Module2} from 'root/move/to/some/new/directory/file';
2022-05-14 08:38:03 +0200 <dsal> +import {ExtraImport, Module1, Module2} from 'root/some/directory/string/file';
2022-05-14 08:38:28 +0200 <dsal> This is how I'm running it: https://www.irccloud.com/pastebin/bqRX0wdr/runSed.hs
2022-05-14 08:39:55 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Remote host closed the connection)
2022-05-14 08:40:06 +0200 <dsal> Using https://hackage.haskell.org/package/process-1.6.14.0/docs/System-Process.html#v:readProcess -- which is really `String`y in a not great way, but there's a lot of `String` here.
2022-05-14 08:42:24 +0200acidjnk(~acidjnk@p200300d0c7068b61ccfdf24993a93a97.dip0.t-ipconnect.de)
2022-05-14 08:43:40 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 08:45:04 +0200 <dzdcnfzd> It should be -E
2022-05-14 08:45:06 +0200 <dzdcnfzd> not -e
2022-05-14 08:45:16 +0200 <dzdcnfzd> I think that might be wrong in the documentation
2022-05-14 08:45:39 +0200 <dzdcnfzd> It took me a long time to figure out why, but basic regexes don't support ?
2022-05-14 08:45:57 +0200 <dzdcnfzd> dsal: I'll convert to bytestrings soon
2022-05-14 08:46:20 +0200 <dsal> I only know the absolute most basic sed. :)
2022-05-14 08:46:33 +0200 <dzdcnfzd> That's why I'm making `sedx` :)
2022-05-14 08:46:45 +0200 <dsal> I changed it to -E and the test fails harder.
2022-05-14 08:46:52 +0200 <dzdcnfzd> !!
2022-05-14 08:47:07 +0200 <dsal> I think we've reached sm's portability concerns. :)
2022-05-14 08:48:36 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 248 seconds)
2022-05-14 08:50:19 +0200 <dzdcnfzd> Trying to get your test to run myself...
2022-05-14 08:52:33 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo) (Remote host closed the connection)
2022-05-14 08:54:02 +0200HotblackDesiato(~HotblackD@gateway/tor-sasl/hotblackdesiato) (Remote host closed the connection)
2022-05-14 08:54:29 +0200HotblackDesiato(~HotblackD@gateway/tor-sasl/hotblackdesiato)
2022-05-14 08:55:20 +0200kuribas`(~user@d51529C17.access.telenet.be) (Ping timeout: 252 seconds)
2022-05-14 08:57:39 +0200 <dsal> Is it working? This is the complete file. https://www.irccloud.com/pastebin/jb5JxydO/Spec.hs
2022-05-14 08:57:49 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo)
2022-05-14 08:58:04 +0200 <dsal> with: $ ls test/examples/search_and_replace/ -> expected input script.sedx
2022-05-14 08:58:26 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-05-14 08:58:36 +0200 <dsal> then just `stack test --file-watch` and edit until things go green.
2022-05-14 08:59:00 +0200 <dzdcnfzd> I haven't gotten it to work quite yet
2022-05-14 08:59:17 +0200 <dzdcnfzd> we have slightly different folder structures
2022-05-14 08:59:25 +0200 <dzdcnfzd> just making it match mine
2022-05-14 09:00:12 +0200 <dsal> Mine's a lot easier to manage. Each test is self-contained.
2022-05-14 09:04:04 +0200 <dzdcnfzd> I see what is happening
2022-05-14 09:04:11 +0200 <dzdcnfzd> Somehow the string escaping is weird
2022-05-14 09:04:30 +0200 <dzdcnfzd> it's adding extra backslashes in front of every backslash
2022-05-14 09:05:19 +0200 <dzdcnfzd> Because it's trying to print it as a haskell string I'm guessing
2022-05-14 09:05:28 +0200 <dzdcnfzd> It's adding its own escape characters
2022-05-14 09:06:24 +0200 <dzdcnfzd> So it's running `sed "-E" "s/import {\\(\\([A-Za-z0-9]*\\(, \\)\\?\\)*\\)}...` instead of `sed "-E" "s/import {\(\([A-Za-z0-9]*\(, \)\?\)*\)}...`
2022-05-14 09:06:35 +0200xkuru(~xkuru@user/xkuru) (Read error: Connection reset by peer)
2022-05-14 09:07:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 09:07:57 +0200smmumbles something petty about existing tools and being done by now
2022-05-14 09:10:10 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 09:12:13 +0200 <dzdcnfzd> Ugh, I know what's happening
2022-05-14 09:12:28 +0200 <dsal> dzdcnfzd: I'd be surprised if the \ didn't make it through clean in the rawcmd. If I change "sed" to "echo" it seems to do what I expect.
2022-05-14 09:12:45 +0200 <dzdcnfzd> I tried the same and you're right. I think it's a weird BSD vs. GNU sed thing
2022-05-14 09:13:00 +0200 <dzdcnfzd> This is exactly why I'm writing this
2022-05-14 09:13:11 +0200 <dzdcnfzd> The regex works on one machine, not on another
2022-05-14 09:13:40 +0200 <dzdcnfzd> Okay. I'm gonna sleep
2022-05-14 09:13:44 +0200 <dzdcnfzd> Thank you very much for the help
2022-05-14 09:13:49 +0200 <dzdcnfzd> It's been extremely helpful
2022-05-14 09:13:56 +0200 <dsal> Oh, the error itself will show the \\ because of how it's being printed in a string in a string.
2022-05-14 09:14:03 +0200 <dzdcnfzd> I'm going to try to get this working tomorrow maybe
2022-05-14 09:14:08 +0200 <dzdcnfzd> Yes, that's exactly right
2022-05-14 09:14:15 +0200 <dsal> But yeah, I should also be asleep.
2022-05-14 09:14:20 +0200 <dzdcnfzd> As a side-note
2022-05-14 09:14:28 +0200 <dzdcnfzd> I tried using free monads for this
2022-05-14 09:14:35 +0200 <dsal> I've never used a free monad.
2022-05-14 09:14:39 +0200 <dzdcnfzd> Just 'cause I thought they were cool. I'm not convinced
2022-05-14 09:14:55 +0200 <dzdcnfzd> I'm not sure I gained much
2022-05-14 09:15:26 +0200 <dsal> I use mtl most of the time. Every time I've tried to do something fancier, it's just been a huge amount of work.
2022-05-14 09:17:38 +0200xff0x(~xff0x@b133147.ppp.asahi-net.or.jp) (Ping timeout: 260 seconds)
2022-05-14 09:18:09 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:d416:b93a:7a85:a330)
2022-05-14 09:18:10 +0200 <dzdcnfzd> It works
2022-05-14 09:18:12 +0200 <dzdcnfzd> :)
2022-05-14 09:18:25 +0200 <dzdcnfzd> you need GNU sed
2022-05-14 09:18:40 +0200gustik(~gustik@2a01:c844:2457:2220:475d:34f:d571:996f) (Quit: Leaving)
2022-05-14 09:18:45 +0200 <dzdcnfzd> next project is adding flags to make it work with BSD sed
2022-05-14 09:18:54 +0200 <dzdcnfzd> and then extended or basic regular expressions
2022-05-14 09:18:54 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-05-14 09:19:06 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2022-05-14 09:19:40 +0200xff0x(~xff0x@om126194002228.10.openmobile.ne.jp)
2022-05-14 09:20:17 +0200 <dzdcnfzd> dsal: test is pushed. Thanks so much!
2022-05-14 09:23:17 +0200_ht(~quassel@231-169-21-31.ftth.glasoperator.nl)
2022-05-14 09:26:13 +0200bilegeek(~bilegeek@2600:1008:b047:7868:8343:8573:5cc1:560a) (Quit: Leaving)
2022-05-14 09:26:35 +0200 <sm> if you have to add special flags, it's about the same as sed, no ?
2022-05-14 09:27:24 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de)
2022-05-14 09:31:00 +0200dostoevsky5(~5c42c5384@user/dostoevsky)
2022-05-14 09:31:59 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 09:31:59 +0200dostoevsky5dostoevsky
2022-05-14 09:36:03 +0200 <dzdcnfzd> sm: the idea is that you tailor your flags to the version of sed
2022-05-14 09:36:22 +0200 <dzdcnfzd> so your flags just specify what version of sed you're producing a string for
2022-05-14 09:36:36 +0200 <dzdcnfzd> You don't have to change your program at all
2022-05-14 09:37:13 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 09:37:48 +0200 <dzdcnfzd> the sedx interpreter reads the same program but changes the regex it produces to match the version of sed you specify
2022-05-14 09:39:11 +0200coot(~coot@213.134.190.95) (Quit: coot)
2022-05-14 09:46:10 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 09:58:12 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Quit: Ping timeout (120 seconds))
2022-05-14 09:58:43 +0200dostoevsky(~5c42c5384@user/dostoevsky)
2022-05-14 09:59:04 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 09:59:54 +0200xff0x(~xff0x@om126194002228.10.openmobile.ne.jp) (Read error: Connection reset by peer)
2022-05-14 10:01:12 +0200mikoto-chan(~mikoto-ch@213.177.151.239)
2022-05-14 10:03:32 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-05-14 10:06:38 +0200christiansen(~christian@83-95-137-75-dynamic.dk.customer.tdc.net)
2022-05-14 10:07:13 +0200xff0x(~xff0x@b133147.ppp.asahi-net.or.jp)
2022-05-14 10:08:26 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 10:08:56 +0200gehmehgeh(~user@user/gehmehgeh)
2022-05-14 10:14:07 +0200dostoevsky5(~5c42c5384@user/dostoevsky)
2022-05-14 10:15:30 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 10:15:30 +0200dostoevsky5dostoevsky
2022-05-14 10:18:04 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 10:21:13 +0200acidjnk(~acidjnk@p200300d0c7068b61ccfdf24993a93a97.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2022-05-14 10:23:02 +0200zer0bitz(~zer0bitz@2001:2003:f444:8f00:4d2d:6b08:61d2:d694)
2022-05-14 10:23:54 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 10:30:41 +0200kuribas(~user@ptr-17d51ephr5e6kr1ik4l.18120a2.ip6.access.telenet.be)
2022-05-14 10:33:29 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net)
2022-05-14 10:42:10 +0200christiansen(~christian@83-95-137-75-dynamic.dk.customer.tdc.net) (Ping timeout: 260 seconds)
2022-05-14 10:42:33 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:d416:b93a:7a85:a330) (Ping timeout: 248 seconds)
2022-05-14 10:47:33 +0200 <apache2> I keep getting this
2022-05-14 10:47:42 +0200 <apache2> • Couldn't match expected type ‘Text’
2022-05-14 10:47:42 +0200 <apache2> with actual type ‘Data.Text.Internal.Lazy.Text’
2022-05-14 10:47:58 +0200 <apache2> How do I turn the lazy text into Data.Text?
2022-05-14 10:49:08 +0200 <jackdk> apache2: https://hackage.haskell.org/package/text-2.0/docs/Data-Text-Lazy.html#v:toStrict
2022-05-14 10:52:42 +0200 <apache2> thanks!
2022-05-14 10:58:11 +0200dzdcnfzd(~dzdcnfzd@pool-108-54-250-165.nycmny.fios.verizon.net) (Quit: Client closed)
2022-05-14 11:00:30 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 240 seconds)
2022-05-14 11:03:55 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net)
2022-05-14 11:05:56 +0200dostoevsky2(~5c42c5384@user/dostoevsky)
2022-05-14 11:07:05 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 248 seconds)
2022-05-14 11:07:05 +0200dostoevsky2dostoevsky
2022-05-14 11:08:51 +0200acidjnk(~acidjnk@p200300d0c7068b617cff31b27765479a.dip0.t-ipconnect.de)
2022-05-14 11:19:21 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 248 seconds)
2022-05-14 11:25:07 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 11:30:45 +0200shiraeeshi(~shiraeesh@109.166.57.239)
2022-05-14 11:32:29 +0200xaotuk(~sasha@109.245.225.44)
2022-05-14 11:42:59 +0200coot(~coot@213.134.190.95)
2022-05-14 11:45:26 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-05-14 11:48:17 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:e28b:dfc7:bbce:95de)
2022-05-14 11:52:08 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-05-14 11:59:11 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-05-14 12:00:28 +0200 <tomsmeding> (sounds like you need the inverse, fromStrict, but presumably you already figured that out)
2022-05-14 12:01:08 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 12:01:54 +0200shiraeeshi(~shiraeesh@109.166.57.239) (Quit: Leaving)
2022-05-14 12:05:38 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-05-14 12:18:54 +0200Benzi-Junior(~BenziJuni@dsl-149-64-179.hive.is)
2022-05-14 12:20:31 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo) (Remote host closed the connection)
2022-05-14 12:25:47 +0200 <RudraveerMandal[> Can Haskell be used for making smart contracts on Ethereum
2022-05-14 12:27:47 +0200 <Rembane> RudraveerMandal[: It seems so: https://www.programmersought.net/article/325194150.html
2022-05-14 12:27:52 +0200dostoevsky9(~5c42c5384@user/dostoevsky)
2022-05-14 12:28:23 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Ping timeout: 260 seconds)
2022-05-14 12:29:13 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 12:29:14 +0200dostoevsky9dostoevsky
2022-05-14 12:29:33 +0200 <RudraveerMandal[> les go
2022-05-14 12:30:11 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo)
2022-05-14 12:34:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 12:37:48 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 12:48:14 +0200jakalx(~jakalx@base.jakalx.net) ()
2022-05-14 12:49:23 +0200jakalx(~jakalx@base.jakalx.net)
2022-05-14 12:50:25 +0200dostoevsky9(~5c42c5384@user/dostoevsky)
2022-05-14 12:51:58 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 12:51:58 +0200dostoevsky9dostoevsky
2022-05-14 12:54:02 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2022-05-14 12:54:47 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds)
2022-05-14 12:55:08 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:e28b:dfc7:bbce:95de) (Ping timeout: 252 seconds)
2022-05-14 12:56:45 +0200Lord_of_Life_Lord_of_Life
2022-05-14 12:58:46 +0200dostoevsky7(~5c42c5384@user/dostoevsky)
2022-05-14 13:00:08 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 13:00:09 +0200dostoevsky7dostoevsky
2022-05-14 13:07:50 +0200farn(~farn@2a03:4000:7:3cd:d4ab:85ff:feeb:f505) (Quit: farn)
2022-05-14 13:07:59 +0200farn(~farn@2a03:4000:7:3cd:d4ab:85ff:feeb:f505)
2022-05-14 13:13:06 +0200Batzy(~quassel@user/batzy) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-05-14 13:13:11 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 13:14:08 +0200Batzy(~quassel@user/batzy)
2022-05-14 13:15:07 +0200elkcl(~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) (Ping timeout: 240 seconds)
2022-05-14 13:15:15 +0200elkcl(~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru)
2022-05-14 13:16:29 +0200littlebo1eep(~alMalsamo@gateway/tor-sasl/almalsamo)
2022-05-14 13:16:34 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
2022-05-14 13:16:50 +0200chomwitt(~chomwitt@2a02:587:dc21:9e00:e28b:dfc7:bbce:95de)
2022-05-14 13:17:04 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 13:17:29 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net) (Quit: Leaving)
2022-05-14 13:17:58 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 260 seconds)
2022-05-14 13:20:27 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 13:20:47 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 13:21:00 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Remote host closed the connection)
2022-05-14 13:21:50 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 13:21:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 13:26:40 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
2022-05-14 13:27:21 +0200jmd_(~jmdaemon@user/jmdaemon) (Ping timeout: 248 seconds)
2022-05-14 13:27:28 +0200littlebo1eeplittlebobeep
2022-05-14 13:29:47 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2022-05-14 13:33:22 +0200AlexNoo_AlexNoo
2022-05-14 13:40:59 +0200acidjnk(~acidjnk@p200300d0c7068b617cff31b27765479a.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2022-05-14 13:41:04 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 13:41:55 +0200cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-05-14 13:43:18 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 13:45:03 +0200cheater(~Username@user/cheater)
2022-05-14 13:48:47 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 13:54:51 +0200kaskal(~kaskal@089144207160.atnat0016.highway.bob.at) (Quit: ZNC - https://znc.in)
2022-05-14 13:57:21 +0200kaskal(~kaskal@2001:4bb8:2e0:b5bd:e3c0:d71b:f32:84d8)
2022-05-14 13:58:28 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3)
2022-05-14 14:03:02 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 14:07:44 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-05-14 14:10:10 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net)
2022-05-14 14:10:19 +0200jmdaemon(~jmdaemon@user/jmdaemon)
2022-05-14 14:10:39 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 14:12:24 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 14:15:00 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 248 seconds)
2022-05-14 14:18:04 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 14:20:24 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-05-14 14:21:45 +0200dostoevsky2(~5c42c5384@user/dostoevsky)
2022-05-14 14:22:59 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 14:22:59 +0200dostoevsky2dostoevsky
2022-05-14 14:24:00 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3) (Remote host closed the connection)
2022-05-14 14:31:32 +0200jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 248 seconds)
2022-05-14 14:31:47 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 14:35:48 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net)
2022-05-14 14:37:45 +0200dostoevsky7(~5c42c5384@user/dostoevsky)
2022-05-14 14:38:01 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 14:39:30 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 14:39:30 +0200dostoevsky7dostoevsky
2022-05-14 14:41:56 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 14:42:22 +0200dhil(~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net)
2022-05-14 14:46:30 +0200jgeerds(~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 240 seconds)
2022-05-14 14:48:35 +0200sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-05-14 14:48:50 +0200machinedgod(~machinedg@24.105.81.50)
2022-05-14 14:50:18 +0200dostoevsky0(~5c42c5384@user/dostoevsky)
2022-05-14 14:51:35 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 14:51:35 +0200dostoevsky0dostoevsky
2022-05-14 14:52:53 +0200sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-05-14 14:56:49 +0200CiaoSen(~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-05-14 15:10:44 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 15:11:48 +0200freemanX(~user@118.201.89.106)
2022-05-14 15:13:02 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 15:16:41 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-05-14 15:20:22 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-05-14 15:22:32 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net) (Read error: Connection reset by peer)
2022-05-14 15:22:43 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net)
2022-05-14 15:29:41 +0200xaotuk(~sasha@109.245.225.44) (Ping timeout: 252 seconds)
2022-05-14 15:32:33 +0200nehsou^(~nehsou@128-092-160-234.biz.spectrum.com) (Remote host closed the connection)
2022-05-14 15:32:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2022-05-14 15:39:07 +0200king_gs(~Thunderbi@2806:103e:29:da71:ba86:4e28:3521:b634)
2022-05-14 15:40:24 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 15:41:19 +0200jakalx(~jakalx@base.jakalx.net) ()
2022-05-14 15:42:57 +0200jakalx(~jakalx@base.jakalx.net)
2022-05-14 15:44:33 +0200causal(~user@50.35.83.177) (Quit: WeeChat 3.5)
2022-05-14 15:51:22 +0200odnes(~odnes@5-203-130-148.pat.nym.cosmote.net) (Quit: Leaving)
2022-05-14 15:58:49 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 248 seconds)
2022-05-14 16:05:14 +0200coot(~coot@213.134.190.95) (Quit: coot)
2022-05-14 16:08:07 +0200king_gs(~Thunderbi@2806:103e:29:da71:ba86:4e28:3521:b634) (Ping timeout: 240 seconds)
2022-05-14 16:08:19 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2022-05-14 16:09:29 +0200flupe(~baboum@radon.sbi.re) (Ping timeout: 248 seconds)
2022-05-14 16:23:10 +0200shailangsa(~shailangs@host109-152-9-235.range109-152.btcentralplus.com) ()
2022-05-14 16:24:18 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-05-14 16:24:59 +0200Vajb(~Vajb@2001:999:400:9bc1:d5dd:7e53:33b:56)
2022-05-14 16:26:17 +0200zebrag(~chris@user/zebrag)
2022-05-14 16:30:54 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 16:30:55 +0200KaipeiKaiepi
2022-05-14 16:38:31 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-05-14 16:41:28 +0200vicfred(~vicfred@user/vicfred) (Quit: Leaving)
2022-05-14 16:46:37 +0200gurkenglas(~gurkengla@dslb-084-057-085-111.084.057.pools.vodafone-ip.de)
2022-05-14 16:47:59 +0200freemanX(~user@118.201.89.106) (Ping timeout: 240 seconds)
2022-05-14 16:49:54 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) ()
2022-05-14 16:51:41 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-05-14 16:53:10 +0200CiaoSen(~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2022-05-14 16:56:59 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 17:00:00 +0200razetime(~quassel@117.254.34.170)
2022-05-14 17:01:07 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2022-05-14 17:02:34 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
2022-05-14 17:04:02 +0200mjs2600(~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in)
2022-05-14 17:05:23 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 17:05:31 +0200mjs2600(~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net)
2022-05-14 17:09:22 +0200vicfred(~vicfred@user/vicfred)
2022-05-14 17:09:27 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2022-05-14 17:10:35 +0200vicfred_(~vicfred@user/vicfred)
2022-05-14 17:12:24 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection)
2022-05-14 17:13:09 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 17:13:50 +0200vicfred(~vicfred@user/vicfred) (Ping timeout: 240 seconds)
2022-05-14 17:14:25 +0200littlebobeep(~alMalsamo@gateway/tor-sasl/almalsamo)
2022-05-14 17:14:50 +0200razetime(~quassel@117.254.34.170) (Ping timeout: 240 seconds)
2022-05-14 17:17:22 +0200sympt(~sympt@193.37.33.20)
2022-05-14 17:17:46 +0200frost(~frost@user/frost) (Ping timeout: 252 seconds)
2022-05-14 17:18:28 +0200shailangsa(~shailangs@host109-152-9-235.range109-152.btcentralplus.com)
2022-05-14 17:21:38 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 17:23:20 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 17:23:48 +0200sympt(~sympt@193.37.33.20) (Remote host closed the connection)
2022-05-14 17:24:17 +0200 <tomsmeding> public service announcement for ghcup users: if you aren't running 0.1.17.8 yet and are using --isolate, please upgrade https://www.reddit.com/r/haskell/comments/unl3f4/ann_ghcup_01178_bugfix_release/
2022-05-14 17:25:32 +0200 <hpc> what's the bug?
2022-05-14 17:25:46 +0200sympt(~sympt@193.37.33.20)
2022-05-14 17:25:55 +0200 <tomsmeding> if you use --isolate --force and the install fails, then ghcup "cleans up the installation directory"
2022-05-14 17:26:13 +0200 <tomsmeding> (0.1.17.8 doesn't anymore)
2022-05-14 17:29:03 +0200sympt(~sympt@193.37.33.20) (Remote host closed the connection)
2022-05-14 17:31:12 +0200V(~v@ircpuzzles/2022/april/winner/V) (Ping timeout: 252 seconds)
2022-05-14 17:35:31 +0200razetime(~quassel@117.254.35.119)
2022-05-14 17:39:08 +0200sympt(~sympt@193.37.33.20)
2022-05-14 17:45:30 +0200vicfred_(~vicfred@user/vicfred) (Quit: Leaving)
2022-05-14 17:46:30 +0200mikoto-chan(~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
2022-05-14 17:48:44 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-05-14 17:49:06 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-05-14 17:49:14 +0200Guest7049(~Guest70@91.232.128.162)
2022-05-14 17:51:17 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 17:53:27 +0200Topsi(~Topsi@95.33.20.255)
2022-05-14 17:54:32 +0200dostoevsky0(~5c42c5384@user/dostoevsky)
2022-05-14 17:54:45 +0200tabemann(~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection)
2022-05-14 17:55:01 +0200V(~v@ircpuzzles/2022/april/winner/V)
2022-05-14 17:55:30 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 17:55:30 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 240 seconds)
2022-05-14 17:55:31 +0200dostoevsky0dostoevsky
2022-05-14 17:58:57 +0200travisb(~travisb@172-13-49-137.lightspeed.milwwi.sbcglobal.net)
2022-05-14 18:00:49 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 18:00:59 +0200vorpuni(~pvorp@2001:861:3881:c690:cb8b:2f67:7218:10ac)
2022-05-14 18:01:44 +0200odnes(~odnes@2a02:587:e901:3110::88b)
2022-05-14 18:01:50 +0200odnes(~odnes@2a02:587:e901:3110::88b) (Remote host closed the connection)
2022-05-14 18:02:59 +0200V(~v@ircpuzzles/2022/april/winner/V) (Quit: We're here. We're queer. Connection reset by peer)
2022-05-14 18:03:23 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 18:03:35 +0200V(~v@ircpuzzles/2022/april/winner/V)
2022-05-14 18:06:22 +0200Guest7049(~Guest70@91.232.128.162) (Quit: Client closed)
2022-05-14 18:13:28 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 18:14:30 +0200dostoevsky7(~5c42c5384@user/dostoevsky)
2022-05-14 18:15:56 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 18:15:57 +0200dostoevsky7dostoevsky
2022-05-14 18:16:25 +0200Frikraaa[m]Frido[m]
2022-05-14 18:16:49 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2022-05-14 18:18:15 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 18:19:05 +0200hololeap(~hololeap@user/hololeap)
2022-05-14 18:20:19 +0200alp_(~alp@user/alp)
2022-05-14 18:22:07 +0200zer0bitz_(~zer0bitz@2001:2003:f444:8f00:86c:4c1e:64b:5ea1)
2022-05-14 18:22:11 +0200Guest44(~Guest44@207.237.194.99)
2022-05-14 18:22:19 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2022-05-14 18:23:00 +0200zer0bitz(~zer0bitz@2001:2003:f444:8f00:4d2d:6b08:61d2:d694) (Ping timeout: 248 seconds)
2022-05-14 18:23:20 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 18:24:14 +0200 <Guest44> I'm trying to write a function to calculate the average of a list of integers but cant seem to get it working correctly as my integers aren't being treated as numbers, can someone help debug?
2022-05-14 18:24:48 +0200sympt(~sympt@193.37.33.20) (Remote host closed the connection)
2022-05-14 18:25:14 +0200 <maerwald> Guest44: can you share your code on https://play-haskell.tomsmeding.com/play
2022-05-14 18:26:12 +0200 <Guest44> done!
2022-05-14 18:26:20 +0200 <maerwald> did you create a paste from it?
2022-05-14 18:26:28 +0200 <Guest44> https://play-haskell.tomsmeding.com/U5agoi8h
2022-05-14 18:26:44 +0200jinsun(~jinsun@user/jinsun)
2022-05-14 18:27:09 +0200 <Guest44> I'd really like to do something along the lines of `top = (fromIntegral $ sum scores) :: Num` but that gives me a different error
2022-05-14 18:27:13 +0200 <maerwald> Guest44: so the error tells you that a constraint is missing
2022-05-14 18:27:20 +0200 <maerwald> did you try adding that constraint?
2022-05-14 18:27:56 +0200 <Guest44> I can try
2022-05-14 18:28:11 +0200 <Guest44> Is there a reasons fractions are different than numbers? to me it seems like number is a more "general" class
2022-05-14 18:28:28 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 18:28:28 +0200 <tomsmeding> Guest44: Int is also an instance of Num
2022-05-14 18:28:32 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 18:28:47 +0200 <tomsmeding> and (/) doesn't work on Int, because it's supposed to be fractional division (like float division)
2022-05-14 18:29:02 +0200 <tomsmeding> Guest44: every Fractional is also a Num, but not every Num is a Fractional
2022-05-14 18:29:32 +0200jinsun__(~jinsun@user/jinsun) (Ping timeout: 252 seconds)
2022-05-14 18:29:45 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 248 seconds)
2022-05-14 18:30:08 +0200 <Guest44> Hm, so what if I wanted to take 3 / 2 = 1.5
2022-05-14 18:30:12 +0200 <tomsmeding> Num has (+), (-), (*), negate, abs, signum, fromInteger; Fractional has (/), recip, fromRational (see https://hackage.haskell.org/package/base-4.16.1.0/docs/Prelude.html#t:Num and https://hackage.haskell.org/package/base-4.16.1.0/docs/Prelude.html#t:Fractional)
2022-05-14 18:30:14 +0200xaotuk(~sasha@net151-38-245-109.mbb.telenor.rs)
2022-05-14 18:30:23 +0200 <tomsmeding> > 3 / 2 :: Double
2022-05-14 18:30:23 +0200 <Guest44> 3 and 2 are integers -- does haskell have something like "casting" in other languages?
2022-05-14 18:30:26 +0200 <lambdabot> 1.5
2022-05-14 18:30:28 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 18:30:33 +0200 <tomsmeding> Guest44: that casting is precisely the fromIntegral that you already used
2022-05-14 18:30:49 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 18:30:49 +0200 <monochrom> @quote monochrom fromIntegral
2022-05-14 18:30:50 +0200 <lambdabot> monochrom says: You've got an Int / But you want Double / Who do you call? / "fromIntegral!"
2022-05-14 18:31:15 +0200tomsmedingwill try to remember that one
2022-05-14 18:31:19 +0200 <Guest44> Ok that all makes sense
2022-05-14 18:31:22 +0200dostoevsky8(~5c42c5384@user/dostoevsky)
2022-05-14 18:31:26 +0200 <maerwald> I'd probably just use Double
2022-05-14 18:31:34 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 18:31:43 +0200 <maerwald> ad-hoc polymorphic result types are annoying
2022-05-14 18:32:13 +0200 <maerwald> https://play-haskell.tomsmeding.com/3V4eqhvf
2022-05-14 18:32:37 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 18:32:56 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 18:32:57 +0200dostoevsky8dostoevsky
2022-05-14 18:35:07 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 18:35:33 +0200 <Guest44> From a little googling, it seems that `Fractionable` is nearly equivalent to the rational numbers, is `Num` equivalent to the Real Numbers?
2022-05-14 18:35:49 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 18:37:26 +0200 <hololeap> so, I want to use cabal-install-solver in a project, but it only exists in master, not in 3.6 or other branches. this confuses me. maybe I don't understand how people utilize branches in big projects like this, because the "split-off" of cabal-install-solver happened *before* the release of 3.6.2.0
2022-05-14 18:38:41 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 18:39:02 +0200 <hololeap> so does the master branch represent experimentation that would not find its way into the 3.6 branch?
2022-05-14 18:39:17 +0200 <hololeap> (sorry if this is a bit OT)
2022-05-14 18:39:41 +0200 <c_wraith> Guest44: Integer is an instance of Num, so that seems unlikely.
2022-05-14 18:41:18 +0200 <c_wraith> Guest44: Num is actually a sort of ring-like thing. It gives you addition and multiplication like a ring, but it also throws in more fiddly things like abs, signum, and fromInteger
2022-05-14 18:41:35 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-05-14 18:42:12 +0200 <c_wraith> Guest44: the numeric type classes weren't designed around mathematical abstractions, really. They were designed around type inference returning sensible results
2022-05-14 18:42:57 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-05-14 18:43:07 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3)
2022-05-14 18:44:03 +0200 <hololeap> there is an implicit OverloadedNumbers extention in base haskell :3
2022-05-14 18:45:46 +0200 <c_wraith> I mean, the big issue is that inference of law-only classes would require changing the way constraints are inferred entirely. But law-only classes come up all the time in any kind of numeric hierarchy.
2022-05-14 18:46:42 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 276 seconds)
2022-05-14 18:47:01 +0200 <hololeap> negate, abs, and signum seem like unnecessary requirements for the class
2022-05-14 18:48:51 +0200hyiltiz(~quassel@31.220.5.250)
2022-05-14 18:49:13 +0200jakalx(~jakalx@base.jakalx.net)
2022-05-14 18:49:32 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3) (Remote host closed the connection)
2022-05-14 18:49:55 +0200 <c_wraith> In principle, I agree. In practice, splitting those off would result in weird types
2022-05-14 18:50:13 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-05-14 18:50:42 +0200 <c_wraith> Num is the only shared interface between Integral and Fractional
2022-05-14 18:51:35 +0200 <hololeap> I'm mostly thinking of what poor ol' Natural does with those ... negate 0 = 0; negate _ = undefined
2022-05-14 18:52:12 +0200 <hololeap> then again, 0 - _ = undefined
2022-05-14 18:52:25 +0200 <hololeap> (except 0, of course)
2022-05-14 18:52:35 +0200 <monochrom> was going to say that, heh
2022-05-14 18:53:19 +0200 <c_wraith> the whole hierarchy is about making it easy to write code at the expense of allowing some nonsense.
2022-05-14 18:53:51 +0200 <c_wraith> :t toRational
2022-05-14 18:53:54 +0200 <lambdabot> Real a => a -> Rational
2022-05-14 18:54:06 +0200 <c_wraith> I can't imagine a more nonsense name for a class than that.
2022-05-14 18:54:24 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-05-14 18:54:50 +0200 <monochrom> Consider "Realable" >:)
2022-05-14 18:55:21 +0200 <hololeap> @hackage numeric-prelude -- this is the alternative <:(
2022-05-14 18:55:21 +0200 <lambdabot> https://hackage.haskell.org/package/numeric-prelude -- this is the alternative <:(
2022-05-14 18:55:48 +0200 <c_wraith> exactly
2022-05-14 18:57:07 +0200 <hololeap> but the example of Natural really does highlight how awesome finite-typelits is
2022-05-14 18:57:14 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 18:57:22 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2022-05-14 18:57:44 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
2022-05-14 18:57:49 +0200 <hololeap> if just for the interface of e.g. packFinite
2022-05-14 18:58:54 +0200mikoto-chan(~mikoto-ch@213.177.151.239)
2022-05-14 18:58:59 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 18:59:25 +0200 <hololeap> they really should have skipped adding a Num instance, although I see the convenience factor
2022-05-14 19:03:10 +0200 <hololeap> weird question about that package: is packFiniteProxy only there to help people using ghc <8.0.1, who don't have access to TypeApplications? I see those "proxy" versions of functions from time to time
2022-05-14 19:04:31 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
2022-05-14 19:05:40 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 19:07:00 +0200 <hololeap> I suppose I'm asking people to guess the motivation behind that, but I thought it might be well-known enough
2022-05-14 19:08:09 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 19:11:02 +0200 <c_wraith> numeric-prelude doesn't even provide tools for what I consider to be the biggest problem math-like libraries tend to have.
2022-05-14 19:11:22 +0200 <c_wraith> Or at least I don't see anything for affine spaces in there.
2022-05-14 19:13:55 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 19:14:06 +0200 <c_wraith> (points and vectors are not the same thing. times and durations are not the same thing.)
2022-05-14 19:14:50 +0200dhil(~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) (Ping timeout: 240 seconds)
2022-05-14 19:15:52 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-05-14 19:18:20 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Client Quit)
2022-05-14 19:19:51 +0200Guest7967(~textual@user/polo)
2022-05-14 19:19:58 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 19:20:17 +0200justsomeguy(~justsomeg@user/justsomeguy)
2022-05-14 19:21:30 +0200 <sclv> hololeap: lots of changes in master did not make it into the 3.6 branch. 3.6.2 was a very conservative set of backports to coincide with a ghc release iirc
2022-05-14 19:22:06 +0200 <sclv> because cabal needs to do releases to support ghc releases, it often has minor releases that do not capture the full state of work that's in the next major release roadmap.
2022-05-14 19:22:54 +0200 <sclv> so its not so much "experimentation" as having a "support branch" (3.6) and master reflects the projected "next major release" (3.8)
2022-05-14 19:23:59 +0200 <hololeap> ok, thanks sclv. that's basically what I meant by "experimentation"
2022-05-14 19:24:10 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2022-05-14 19:24:18 +0200merijn(~merijn@c-001-001-002.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
2022-05-14 19:24:37 +0200 <hololeap> although that raises the question of why they skip odd-numbered releaases
2022-05-14 19:26:02 +0200 <sclv> its not experimentation in the sense that if its merged into master, it IS projected for release. its just projected for the next major release.
2022-05-14 19:26:29 +0200stackdroid18(14094@user/stackdroid)
2022-05-14 19:27:04 +0200 <sclv> skipping odd numbered releases is similar to ghc -- it lets master "between releases" be at an odd number so people can manage using snapshot builds a bit more reasonably.
2022-05-14 19:27:49 +0200machinedgod(~machinedg@24.105.81.50)
2022-05-14 19:27:50 +0200 <sclv> this is really no different than noticing that there's changes in master in ghc but say a 9.2.3 release would not have them because master tracks projected 9.4 or whatever
2022-05-14 19:28:14 +0200 <sclv> it feels all like pretty standard unexceptional dev practices to me.
2022-05-14 19:28:27 +0200 <hololeap> I'm just not familiar with all of it
2022-05-14 19:28:34 +0200 <hololeap> so thanks for the explaination
2022-05-14 19:28:47 +0200 <sclv> sure, glad to explain!
2022-05-14 19:29:50 +0200zincy(~zincy@host86-160-236-152.range86-160.btcentralplus.com)
2022-05-14 19:29:53 +0200zincy(~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
2022-05-14 19:32:01 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3)
2022-05-14 19:32:56 +0200Guest7967Polo
2022-05-14 19:33:28 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 19:34:53 +0200zincy(~zincy@2a00:23c8:970c:4801:18b4:9d3:33e8:26e3) (Remote host closed the connection)
2022-05-14 19:35:17 +0200econo(uid147250@user/econo)
2022-05-14 19:37:13 +0200Polo(~textual@user/polo) (Quit: Textual IRC Client: www.textualapp.com)
2022-05-14 19:37:39 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 19:41:30 +0200dostoevsky4(~5c42c5384@user/dostoevsky)
2022-05-14 19:42:59 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 19:42:59 +0200dostoevsky4dostoevsky
2022-05-14 19:44:39 +0200xkuru(~xkuru@user/xkuru)
2022-05-14 19:50:04 +0200Polo(~Polo@user/polo)
2022-05-14 19:54:10 +0200Guest44(~Guest44@207.237.194.99) (Quit: Connection closed)
2022-05-14 19:54:11 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 19:57:34 +0200hololeap(~hololeap@user/hololeap) (Ping timeout: 240 seconds)
2022-05-14 20:01:35 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 20:05:04 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 240 seconds)
2022-05-14 20:05:15 +0200Polo(~Polo@user/polo) (Quit: Textual IRC Client: www.textualapp.com)
2022-05-14 20:09:33 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net)
2022-05-14 20:10:14 +0200jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2022-05-14 20:12:40 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2022-05-14 20:12:43 +0200dostoevsky9(~5c42c5384@user/dostoevsky)
2022-05-14 20:13:54 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 20:13:55 +0200dostoevsky9dostoevsky
2022-05-14 20:15:03 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 260 seconds)
2022-05-14 20:17:03 +0200Polo(~Polo@user/polo)
2022-05-14 20:17:14 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:19:50 +0200razetime(~quassel@117.254.35.119) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-05-14 20:20:03 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net)
2022-05-14 20:20:38 +0200merijn(~merijn@c-001-001-002.client.esciencecenter.eduvpn.nl)
2022-05-14 20:23:10 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 20:23:34 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 240 seconds)
2022-05-14 20:24:10 +0200yauhsien(~yauhsien@61-231-24-3.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2022-05-14 20:25:33 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-05-14 20:26:22 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:31:32 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 248 seconds)
2022-05-14 20:32:17 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:33:00 +0200raym(~raym@user/raym) (Quit: kernel update, rebooting...)
2022-05-14 20:33:58 +0200Polo(~Polo@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-05-14 20:38:04 +0200raym(~raym@user/raym)
2022-05-14 20:38:30 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 20:39:01 +0200Vajb(~Vajb@2001:999:400:9bc1:d5dd:7e53:33b:56) (Read error: Connection reset by peer)
2022-05-14 20:39:19 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:39:48 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2022-05-14 20:41:08 +0200jmcarthur(~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
2022-05-14 20:43:10 +0200 <tomsmeding> is it correct that one cannot actually use text-2.0 yet with any released ghc version?
2022-05-14 20:43:26 +0200 <maerwald> no
2022-05-14 20:44:08 +0200 <tomsmeding> :(
2022-05-14 20:44:20 +0200 <maerwald> I mean, it's not correct
2022-05-14 20:44:30 +0200 <tomsmeding> o
2022-05-14 20:45:12 +0200 <maerwald> it's just that cabal prefers the versions that GHC ships with... but it can upgrade too. That only creates problems in some cases
2022-05-14 20:45:19 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 20:45:42 +0200 <tomsmeding> oh apparently I needed 'cabal clean'?
2022-05-14 20:46:23 +0200 <tomsmeding> oh a dep also doesn't support text 2.0, rip
2022-05-14 20:46:39 +0200 <maerwald> the fix is usually easy
2022-05-14 20:47:24 +0200 <tomsmeding> did anything change semantics in text-2.0? As in, if a package compiles with both, does it do the same thing with both?
2022-05-14 20:47:43 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
2022-05-14 20:47:46 +0200 <maerwald> I'd say yes
2022-05-14 20:47:59 +0200 <tomsmeding> right, then it's not worth my time trying currently :p
2022-05-14 20:48:16 +0200 <maerwald> behavior should be the same, except for that vulnerability
2022-05-14 20:48:56 +0200 <tomsmeding> man I should ask my questions less ambiguously
2022-05-14 20:49:06 +0200 <tomsmeding> thanks I'm going to try rebuilding
2022-05-14 20:49:07 +0200 <maerwald> err, scratch that
2022-05-14 20:49:16 +0200 <maerwald> vulnerability was in aeson :D
2022-05-14 20:49:22 +0200tomsmedingwas already slightly confused
2022-05-14 20:49:23 +0200 <tomsmeding> yes ;)
2022-05-14 20:49:35 +0200 <maerwald> text only changed internal API
2022-05-14 20:49:48 +0200 <tomsmeding> 'constraints: text ==2.0 ; allow-newer: text' here we go
2022-05-14 20:50:05 +0200 <tomsmeding> oh not constraints apparently?
2022-05-14 20:50:10 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:50:23 +0200 <maerwald> but if one of your dependency depends on internal modules, allow-newer might not be safe
2022-05-14 20:50:25 +0200 <tomsmeding> oh it is, I just can't type
2022-05-14 20:50:59 +0200 <tomsmeding> because semantics changed for internal modules?
2022-05-14 20:51:14 +0200 <tomsmeding> I think it's likely that stuff in the snap ecosystem depends on internal text stuff
2022-05-14 20:51:16 +0200 <geekosaur> the internal storage format changed from utf16 to utf8
2022-05-14 20:51:24 +0200dostoevsky2(~5c42c5384@user/dostoevsky)
2022-05-14 20:51:26 +0200 <tomsmeding> geekosaur: that's precisely why I wanted to upgrade
2022-05-14 20:51:38 +0200 <geekosaur> something like text-icu that probably dug into the internals for performance will probably fail
2022-05-14 20:51:49 +0200 <tomsmeding> question is, will stuff that changes semantics now give a type error, or is upgrading unsafe
2022-05-14 20:51:53 +0200 <geekosaur> (icu uses utf16 by default)
2022-05-14 20:52:10 +0200 <geekosaur> that I don't know
2022-05-14 20:52:35 +0200 <maerwald> tomsmeding: no
2022-05-14 20:52:42 +0200 <maerwald> the Text type did not change
2022-05-14 20:52:49 +0200 <geekosaur> thing is, for performance they probably use something like ByteArray# and ghc doesn't provide a SixteenBitWordArray#
2022-05-14 20:53:01 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 20:53:01 +0200dostoevsky2dostoevsky
2022-05-14 20:53:20 +0200jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Remote host closed the connection)
2022-05-14 20:53:23 +0200 <tomsmeding> ah right, so if anything manipulated the underlying ByteArray# it's going to break
2022-05-14 20:53:30 +0200 <tomsmeding> thanks both, that settles the issue :)
2022-05-14 20:53:32 +0200 <maerwald> they changed the constructor though
2022-05-14 20:53:42 +0200 <maerwald> but that's not a safe enough bet
2022-05-14 20:53:48 +0200 <maerwald> *constructor name
2022-05-14 20:54:49 +0200 <tomsmeding> yeah, not going to risk it
2022-05-14 20:55:17 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 252 seconds)
2022-05-14 20:55:39 +0200Kaiepi(~Kaiepi@156.34.47.253) (Ping timeout: 240 seconds)
2022-05-14 20:56:05 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 20:56:14 +0200justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.4)
2022-05-14 21:01:10 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 21:03:42 +0200Sgeo(~Sgeo@user/sgeo)
2022-05-14 21:04:59 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-05-14 21:05:28 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-05-14 21:05:50 +0200Guest4496(~Guest44@207.237.194.99)
2022-05-14 21:06:06 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:10:01 +0200pavonia(~user@user/siracusa)
2022-05-14 21:13:05 +0200 <Guest4496> How does haskell know that `map . map func inputs` should be interpreted as `map (map func) inputs` instead of throwing errors? As a human, I interpret this along the lines of `map( map ( func (inputs)))` (Makes no sense -- map needs two arguments!) or  `map(map func inputs)` (Makes no sense -- first argument to outer map must be a function
2022-05-14 21:13:28 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 248 seconds)
2022-05-14 21:13:37 +0200 <tomsmeding> `map . map func inputs` means `\x -> map (map func inputs x)`
2022-05-14 21:14:00 +0200 <tomsmeding> `f . g = \x -> f (g x)`
2022-05-14 21:14:05 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:14:18 +0200 <tomsmeding> so it's _not_ interpreted as `map (map func) inputs`
2022-05-14 21:14:35 +0200 <EvanR> all this relies on map func inputs resulting in a function
2022-05-14 21:14:45 +0200 <EvanR> which is possible
2022-05-14 21:14:52 +0200 <EvanR> wait
2022-05-14 21:15:09 +0200 <tomsmeding> still not the same as the interpretation that Guest4496 stated that it would be :p
2022-05-14 21:15:37 +0200 <EvanR> map func inputs is necessarily a list
2022-05-14 21:15:57 +0200 <tomsmeding> :t \func inputs -> map . map func inputs
2022-05-14 21:15:58 +0200 <lambdabot> error:
2022-05-14 21:15:59 +0200 <lambdabot> • Couldn't match expected type ‘a1 -> a2 -> b1’
2022-05-14 21:15:59 +0200 <lambdabot> with actual type ‘[b]’
2022-05-14 21:16:23 +0200 <tomsmeding> Guest4496: that code snippet can never ever typecheck with the standard `(.)` and `map`
2022-05-14 21:16:42 +0200 <tomsmeding> Guest4496: are you very sure that the (.) is not really ($)?
2022-05-14 21:17:44 +0200 <EvanR> map . map func inputs is problematic if . is . or $
2022-05-14 21:17:56 +0200 <tomsmeding> oh fair point
2022-05-14 21:18:32 +0200 <Guest4496> Ah, In my interpreter I defined `m2d = map . map` and just replaced them whereas really it gets replaced as `(map . map) func inputs`
2022-05-14 21:18:38 +0200 <EvanR> which is good, the more random things that can be typed which are accepted, the harder it is to stop nonsense
2022-05-14 21:18:58 +0200 <tomsmeding> Guest4496: yes, function application binds tighter than infix operators :)
2022-05-14 21:19:22 +0200 <tomsmeding> map . map x y = map . (map x y) != (map . map) x y
2022-05-14 21:20:20 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 260 seconds)
2022-05-14 21:20:54 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:21:20 +0200 <EvanR> map . map x y = ((map) . ((map x) y))
2022-05-14 21:21:22 +0200 <EvanR> clear? xD
2022-05-14 21:22:00 +0200gpncarl(~gpncarl@120.244.220.69)
2022-05-14 21:23:02 +0200 <tomsmeding> why is there not a way to encode a lazy bytestring to an aeson Encoding _without_ going via a full strict bytestring
2022-05-14 21:25:34 +0200 <tomsmeding> you can fold over the chunks in a lazy bytestring and encode those piece by piece into strict Texts, which you can encode into aeson Encodings one by one, but the one function that is missing is Data.Aeson.Encoding.Builder.unquoted https://hackage.haskell.org/package/aeson-2.0.3.0/docs/src/Data.Aeson.Encoding.Builder.html#text
2022-05-14 21:25:42 +0200 <tomsmeding> it exists but it isn't exported
2022-05-14 21:26:10 +0200gpncarl(~gpncarl@120.244.220.69) (Ping timeout: 240 seconds)
2022-05-14 21:26:14 +0200 <tomsmeding> and from a quoted builder you can't strip the quotes without rendering it first
2022-05-14 21:26:31 +0200 <tomsmeding> though hm, rendering those chunks should be cheap
2022-05-14 21:28:15 +0200 <EvanR> I see a lazyText to Encoding
2022-05-14 21:28:49 +0200 <EvanR> curious how lazy bytestring is coming up in json
2022-05-14 21:28:54 +0200 <EvanR> rather, bytestring
2022-05-14 21:29:10 +0200mikoto-chan(~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
2022-05-14 21:29:18 +0200 <tomsmeding> I have output of a process as a bytestring and I want to put that in a json string
2022-05-14 21:29:24 +0200 <tomsmeding> s/bytestring/lazy bytestring/
2022-05-14 21:29:30 +0200 <EvanR> well json is text...
2022-05-14 21:29:45 +0200 <EvanR> were you encoding the bytestring somehow
2022-05-14 21:29:56 +0200 <tomsmeding> it's going to be presented to the user as text in the end anyway, so I don't mind if non-utf8 stuff gets replaced with U+FFFD
2022-05-14 21:30:02 +0200 <tomsmeding> yeah utf8
2022-05-14 21:30:21 +0200 <tomsmeding> this is the playground :p
2022-05-14 21:30:21 +0200 <EvanR> convert lazy bytestring to lazy text then? xD
2022-05-14 21:30:32 +0200 <EvanR> before converting to Encoding
2022-05-14 21:30:35 +0200 <tomsmeding> you make a very good point
2022-05-14 21:31:11 +0200 <tomsmeding> oooooh Data.Text.Lazy.Encoding TIL
2022-05-14 21:32:00 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 260 seconds)
2022-05-14 21:33:44 +0200 <EvanR> decodeUtf8 Decode a ByteString containing UTF-8 encoded text that is known to be valid.
2022-05-14 21:34:03 +0200 <tomsmeding> yeah I'm going to decodeUtf8With lenientDecode
2022-05-14 21:34:16 +0200 <EvanR> screams "and this is where the program will crash because it can"
2022-05-14 21:34:42 +0200 <tomsmeding> :p
2022-05-14 21:35:02 +0200zincy(~zincy@host86-160-236-152.range86-160.btcentralplus.com)
2022-05-14 21:36:33 +0200 <tomsmeding> okay this saves like 3 internal imports and a bunch of weird bytestring chunking code
2022-05-14 21:36:36 +0200 <tomsmeding> EvanR++
2022-05-14 21:36:41 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:36:57 +0200abiss27(~abiss27@user/abiss)
2022-05-14 21:37:17 +0200 <tomsmeding> still it's almost more imports than code :p https://paste.tomsmeding.com/dxn0cEcX
2022-05-14 21:39:16 +0200 <EvanR> more imports than code
2022-05-14 21:39:25 +0200 <EvanR> a t-shirtable moment
2022-05-14 21:39:53 +0200 <tomsmeding> if you remove all the empty lines it's an equal number of lines
2022-05-14 21:40:17 +0200 <tomsmeding> it's a pity it's hard to get more language extensions than code
2022-05-14 21:40:22 +0200 <tomsmeding> but sometimes I try hard
2022-05-14 21:41:58 +0200 <EvanR> alternate preludes are doing it backwards
2022-05-14 21:42:12 +0200 <EvanR> we need something to increase imports
2022-05-14 21:43:33 +0200 <EvanR> like an extension where you can only use the imported thing once, after that you gotta import another
2022-05-14 21:43:48 +0200 <tomsmeding> lol
2022-05-14 21:43:55 +0200 <tomsmeding> linear imports
2022-05-14 21:44:18 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 260 seconds)
2022-05-14 21:44:24 +0200 <tomsmeding> "Be sparing with your library usage. Use -XLinearImports."
2022-05-14 21:45:15 +0200Feuermagier(~Feuermagi@user/feuermagier) (Remote host closed the connection)
2022-05-14 21:46:49 +0200zincy(~zincy@host86-160-236-152.range86-160.btcentralplus.com) (Remote host closed the connection)
2022-05-14 21:48:12 +0200Kaiepi(~Kaiepi@156.34.47.253)
2022-05-14 21:48:45 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:49:16 +0200dostoevsky1(~5c42c5384@user/dostoevsky)
2022-05-14 21:50:28 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Ping timeout: 248 seconds)
2022-05-14 21:50:28 +0200dostoevsky1dostoevsky
2022-05-14 21:50:40 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-05-14 21:51:59 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 21:52:31 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-05-14 21:55:47 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 21:56:18 +0200 <EvanR> if somehow that speeds up linking, it might be worth it
2022-05-14 21:56:48 +0200 <tomsmeding> lol don't think so, linking happens much later
2022-05-14 21:56:51 +0200 <tomsmeding> EvanR: are you on windows
2022-05-14 21:57:07 +0200 <EvanR> no, windows is in cold storage
2022-05-14 21:57:27 +0200 <tomsmeding> was just guessing because link time on windows is _particularly_ bad
2022-05-14 21:57:32 +0200 <EvanR> oof
2022-05-14 21:57:44 +0200 <tomsmeding> I've seen hello world take 8secs to link
2022-05-14 21:57:49 +0200 <tomsmeding> on students' laptops
2022-05-14 21:58:21 +0200 <tomsmeding> though I later realised that the culprit might be the virus scanner -- but then still, people use those things and you can't just disable them
2022-05-14 21:58:34 +0200alx741(~alx741@host-181-198-243-150.netlife.ec)
2022-05-14 21:59:32 +0200 <geekosaur> reportedly things improve a bit with lld, which will be part of the new windows toolchain (I think that's coming with 9.4)
2022-05-14 22:00:00 +0200 <tomsmeding> probably not in time for september :p
2022-05-14 22:00:39 +0200 <tomsmeding> or if 9.4 drops before then, perhaps it won't be quite mature enough to throw in front of a bunch of students yet
2022-05-14 22:01:07 +0200kuribas(~user@ptr-17d51ephr5e6kr1ik4l.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2022-05-14 22:03:30 +0200alx741(~alx741@host-181-198-243-150.netlife.ec) (Ping timeout: 240 seconds)
2022-05-14 22:07:02 +0200jmdaemon(~jmdaemon@user/jmdaemon)
2022-05-14 22:07:07 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2022-05-14 22:13:07 +0200_ht(~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection)
2022-05-14 22:22:02 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 22:25:05 +0200Polo(~Polo@user/polo)
2022-05-14 22:26:12 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-05-14 22:26:35 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-05-14 22:27:10 +0200Guest|82(~Guest|82@apn-31-0-50-47.dynamic.gprs.plus.pl)
2022-05-14 22:27:44 +0200Guest|82(~Guest|82@apn-31-0-50-47.dynamic.gprs.plus.pl) (Client Quit)
2022-05-14 22:29:30 +0200Philonous(~Philonous@user/philonous) (Quit: ZNC - https://znc.in)
2022-05-14 22:30:00 +0200Philonous(~Philonous@user/philonous)
2022-05-14 22:35:42 +0200acidjnk(~acidjnk@p200300d0c7068b617cff31b27765479a.dip0.t-ipconnect.de)
2022-05-14 22:36:18 +0200michalz(~michalz@185.246.204.122)
2022-05-14 22:39:05 +0200Polo(~Polo@user/polo) (Ping timeout: 260 seconds)
2022-05-14 22:41:24 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-05-14 22:41:27 +0200Polo(~Polo@user/polo)
2022-05-14 22:41:51 +0200dostoevsky1(~5c42c5384@user/dostoevsky)
2022-05-14 22:42:47 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 22:42:47 +0200dostoevsky1dostoevsky
2022-05-14 22:43:58 +0200roconnor(~roconnor@coq/roconnor)
2022-05-14 22:44:13 +0200 <roconnor> How can I get Tasty to run tests concurrently?
2022-05-14 22:45:39 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2022-05-14 22:48:07 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-05-14 22:52:30 +0200acidjnk(~acidjnk@p200300d0c7068b617cff31b27765479a.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2022-05-14 22:52:37 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 22:52:47 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 22:56:52 +0200acidjnk(~acidjnk@p200300d0c7068b6181b67b31768892e9.dip0.t-ipconnect.de)
2022-05-14 22:57:07 +0200Polo(~Polo@user/polo) (Ping timeout: 240 seconds)
2022-05-14 23:01:14 +0200 <byorgey> roconnor: should just be as simple as +RTS -N8 or whatever. If you're running the test suite via e.g. stack, you can do something like --test-arguments '+RTS -N8 -RTS'
2022-05-14 23:05:59 +0200Polo(~Polo@user/polo)
2022-05-14 23:06:32 +0200Polo(~Polo@user/polo) (Client Quit)
2022-05-14 23:08:22 +0200Cale(~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) (Read error: Connection reset by peer)
2022-05-14 23:08:42 +0200 <roconnor> oh, that seems good.
2022-05-14 23:08:55 +0200 <kronicma1> anyone know how to configure which ghc stack uses when system-ghc is enabled? it keeps using the one I have in /usr/bin instead of the one in ~/.ghcup/bin that I want it to use
2022-05-14 23:09:04 +0200 <roconnor> byorgey: what if I'm running cabal test?
2022-05-14 23:09:21 +0200 <maerwald> kronicma1: check your $PATH variable
2022-05-14 23:09:39 +0200 <kronicma1> .ghcup/bin comes before /usr/bin in my path
2022-05-14 23:10:20 +0200 <maerwald> kronicma1: do both paths provide the same version?
2022-05-14 23:10:25 +0200Feuermagier(~Feuermagi@user/feuermagier)
2022-05-14 23:10:40 +0200 <kronicma1> yes, but one is the arch linux install which has the dumb dynamic linking thing
2022-05-14 23:10:46 +0200 <kronicma1> hence why I want .ghcup/bin's ghc
2022-05-14 23:11:00 +0200 <maerwald> I'v pretty sure stack looks in PATH from left to right
2022-05-14 23:11:08 +0200 <kronicma1> apparently not
2022-05-14 23:11:25 +0200 <maerwald> would need more proof
2022-05-14 23:11:47 +0200 <maerwald> e.g. maybe ~/.ghcup/bin/ghc is broken
2022-05-14 23:11:49 +0200 <maerwald> or doesn't exist
2022-05-14 23:14:29 +0200 <maerwald> stack runs ghc: https://github.com/commercialhaskell/stack/blob/b9f1c21ed108d52e8e5919fc86c435726704746e/src/Stack…
2022-05-14 23:14:37 +0200 <maerwald> when trying to find a suitable compiler
2022-05-14 23:14:45 +0200 <maerwald> and then just tries the next one
2022-05-14 23:14:50 +0200 <kronicma1> maerwald: thanks for the help! turns out .ghcup/bin/ghc was actually a different version after all
2022-05-14 23:14:58 +0200 <kronicma1> just had to set the appropriate version in ghcup and it worked
2022-05-14 23:14:59 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 23:15:09 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 23:22:35 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Remote host closed the connection)
2022-05-14 23:22:48 +0200ix(~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe)
2022-05-14 23:26:11 +0200Katarushisu(~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat)
2022-05-14 23:27:35 +0200Katarushisu(~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
2022-05-14 23:30:23 +0200michalz(~michalz@185.246.204.122) (Remote host closed the connection)
2022-05-14 23:35:05 +0200merijn(~merijn@c-001-001-002.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
2022-05-14 23:42:22 +0200dostoevsky3(~5c42c5384@user/dostoevsky)
2022-05-14 23:43:31 +0200dostoevsky(~5c42c5384@user/dostoevsky) (Read error: Connection reset by peer)
2022-05-14 23:43:31 +0200dostoevsky3dostoevsky
2022-05-14 23:52:58 +0200Guest57(~Guest57@69-174-160-103.iplwin75.metronetinc.net)
2022-05-14 23:55:43 +0200Cale(~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com)
2022-05-14 23:56:57 +0200 <Guest57> Would findSum :: (Eq a, Num a) => a -> [a] -> (a, a)
2022-05-14 23:56:57 +0200 <Guest57> findSum n [x, y] = if (x + y) == n then (x, y) else (0, 0)
2022-05-14 23:56:58 +0200 <Guest57> findSum n (x:y:xs) = if (x + y) == n then (x, y) else findSum n (x:xs)
2022-05-14 23:57:34 +0200 <Guest57> be a good solution to the problem of taking a number and checking if that number is a result of any sums of numbers in a list?
2022-05-14 23:58:11 +0200tcard(~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Quit: Leaving)
2022-05-14 23:59:22 +0200 <EvanR> a list comprehension which generates all (half, ish) pairs would simplify it
2022-05-14 23:59:46 +0200 <Guest57> oh okay
2022-05-14 23:59:47 +0200 <Guest57> thanks