Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-13 08:57:13 ski . o O ( `-Wincomplete-patterns',`-Wincomplete-uni-patterns',`-Wincomplete-record-updates' )
2021-04-13 08:58:41 <merijn> Or just -Wall :p
2021-04-13 08:59:16 <jpe90> yeah I think i've got flycheck with -Wall and hlint set up
2021-04-13 08:59:21 <ski> but that's less fun to say :)
2021-04-13 08:59:46 <jpe90> they complain to me often
2021-04-13 08:59:48 oish joins (~charlie@228.25.169.217.in-addr.arpa)
2021-04-13 09:00:36 <Arahael> I *love* hlint
2021-04-13 09:01:09 <merijn> I like that GHC actually makes -Wall be "everything, except the *really* questionable warnings", unlike gcc, where -Wall is, like, one third of the important warnings >.>
2021-04-13 09:01:35 <jpe90> yeah i really like hlint too, it's good for catching bad habits early on
2021-04-13 09:02:41 <jpe90> it would be cool if there was a "you're using excessive parens where you could use $" option, still trying to work on using that operator properly
2021-04-13 09:03:47 <merijn> word of warning
2021-04-13 09:03:53 <merijn> hlint is not gospel
2021-04-13 09:04:30 <merijn> It's basically "the opinion of the author", which may or may not (depending on the specific rule) widely accepted by everyone else
2021-04-13 09:04:49 <ski> hlint is opinionated
2021-04-13 09:05:32 <jpe90> any rules in particular you'd suggest disabling or should i just decide on my own down the road
2021-04-13 09:05:41 <merijn> I don't really use it, so not really
2021-04-13 09:05:47 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 260 seconds)
2021-04-13 09:05:49 <jpe90> gotcha
2021-04-13 09:05:58 <ski> jpe90 : oh .. i would prefer the reverse one "you're using `$', when you could use `.' or plain brackets"
2021-04-13 09:05:59 <merijn> Just a comment to take it's suggestion with a grain of salt and make up your own mind :)
2021-04-13 09:07:03 <merijn> I'm sure there's a ton of helpful beginner stuff there, but I know that python/JS communities treat pylint/jslint as gospel, so just be aware not all of hlint's opinions are as universally accepted :)
2021-04-13 09:07:12 <ski> jpe90 : "still trying to work on using that operator properly" -- how about "never", as a first approximation ?
2021-04-13 09:07:24 × xff0x quits (~xff0x@2001:1a81:52e3:ed00:6689:c12:7ca5:50eb) (Ping timeout: 258 seconds)
2021-04-13 09:07:31 <merijn> ski: pfft, $ is great with for/forM!
2021-04-13 09:07:47 <ski> `BlockArguments' ftw ! :)
2021-04-13 09:07:55 <merijn> I dislike blockarguments
2021-04-13 09:08:17 xff0x joins (~xff0x@2001:1a81:52e3:ed00:4e19:7447:12ec:457)
2021-04-13 09:08:18 <merijn> It fits in the frivolous syntax extensions
2021-04-13 09:08:29 <ski> (but yea, there are situations where it's acceptable. but newbies, for whatever reason, tend to use it *way* too much ..)
2021-04-13 09:08:32 <merijn> Breaks tons of shit and the pay-off isn't near good enough
2021-04-13 09:09:38 <ski> jpe90 : and i second making up your own mind. it's your code, it ought to be clear and readable, to *you*
2021-04-13 09:10:07 <ski> (but being aware of various styles, arguments, issues, opinions, is good)
2021-04-13 09:10:18 <merijn> ski: I think the overuse of $ comes from "magical thinking" where they think it's just brackets-B-gone
2021-04-13 09:11:08 <ski> the idea that brackets are inherently bad, and are better to avoid, seems to be the root problem ?
2021-04-13 09:11:08 <jpe90> and it's a shiny new operator that i haven't seen before.. can't help but touch the shiny things..
2021-04-13 09:11:36 × nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds)
2021-04-13 09:11:47 <ski> (might be related to a general fear of algebra, as monochrom's suggested, iirc)
2021-04-13 09:12:32 <merijn> jpe90: . is the (slightly more intimidating), but objectively superior shiny new operator ;)
2021-04-13 09:13:00 <merijn> ski: Very nested brackets are bad, because you end up needing a stack machine in your brain to track them :p
2021-04-13 09:13:01 <jpe90> yeah that one is really cool, definitely need to train myself to use it more
2021-04-13 09:13:10 <jpe90> reminds me of piping shell commands
2021-04-13 09:14:10 <ski> i normally prefer `(foo x . bar . baz y z) blah' over `foo x . bar . bar y z $ blah' over `foo x $ bar $ baz y z $ blah'. but `foo x (bar (baz y z blah))' is commonly also quite fine (often to be preferred to any of the former)
2021-04-13 09:14:15 <merijn> jpe90: In general . is better than $ because in a sequence of "(f . g . h . i) x" (or "f . g . h . i $ x") any part of the . pipeline can be moved into a new variable name and things still typecheck
2021-04-13 09:14:46 <ski> and that's because `.' is an associative operation (while `$' isn't)
2021-04-13 09:14:50 <merijn> i.e. if "f . g . h . i" typechecks, then, by definition, "let foo = f . g in foo . h . i" also typechecks
2021-04-13 09:15:05 <merijn> Which makes refactoring nice and easy
2021-04-13 09:15:25 <ski> merijn : yea, at that point, indentation, or explicit breaking out and naming, helps
2021-04-13 09:15:31 <ski> (re nested)
2021-04-13 09:15:51 <merijn> ski: I usually write horribly ugly 5 lines . compositions, then later lift out parts into better named chunks
2021-04-13 09:16:21 × hololeap quits (~hololeap@gateway/tor-sasl/hololeap) (Ping timeout: 240 seconds)
2021-04-13 09:17:21 <ski> (oh, and writing `foo x (bar $ baz y z blah)' is atrocious ..)
2021-04-13 09:19:02 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
2021-04-13 09:19:29 <ski> and yea, if you want something to play with, `.' is more fun. e.g. `(back .) . (. forward)'
2021-04-13 09:20:19 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2021-04-13 09:25:01 fendor joins (~fendor@77.119.130.199.wireless.dyn.drei.com)
2021-04-13 09:25:24 __monty__ joins (~toonn@unaffiliated/toonn)
2021-04-13 09:25:44 Major_Biscuit joins (~Major_Bis@wlan-145-94-219-47.wlan.tudelft.nl)
2021-04-13 09:28:21 <ski> @type traverse :: (a -> State s b) -> [a] -> State s [b]
2021-04-13 09:28:23 <lambdabot> (a -> State s b) -> [a] -> State s [b]
2021-04-13 09:28:24 <ski> @type ((state . (swap .)) .) . flip . mapAccumL . flip . (((swap .) . runState) .) :: (a -> State s b) -> [a] -> State s [b]
2021-04-13 09:28:25 <lambdabot> (a -> State s b) -> [a] -> State s [b]
2021-04-13 09:29:29 <xerox_> I wonder if there is a straightforward way to parallelize Data.Tree.unfoldTree, anybody got ideas?
2021-04-13 09:30:28 <ski> (.. it's too bad `State'/`StateT' has the state in the wrong order, or that could just have been `(state .) . flip . mapAccumL . flip . (runState .)' .. or perhaps even `(state .) . mapAccumL . (runState .)', if the argument ordering was different -- although that's less clear of a win)
2021-04-13 09:31:21 <ski> @type Data.Tree.unfoldTree
2021-04-13 09:31:22 <lambdabot> (b -> (a, [b])) -> b -> Tree a
2021-04-13 09:32:37 <ski> hm, do you expect it to be reasonably balanced ?
2021-04-13 09:32:47 <xerox_> yeah
2021-04-13 09:33:11 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-13 09:34:07 <ski> i guess you could do the first step, then see if you could distribute the children onto different cores ?
2021-04-13 09:36:03 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-13 09:36:51 <xerox_> hm good idea
2021-04-13 09:36:55 × bahamas quits (~lucian@unaffiliated/bahamas) (Quit: leaving)
2021-04-13 09:37:32 <ski> > (concat . transpose . zipWith (map . shows) [0 ..] . transpose . chunksOf 4) (words "a b c d e f g h")
2021-04-13 09:37:34 <lambdabot> ["0a","1b","2c","3d","0e","1f","2g","3h"]
2021-04-13 09:37:55 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-04-13 09:38:30 <xerox_> there's a pure way to go about it right? I forget what the library is, definitely not Control.Concurrent
2021-04-13 09:39:07 <ski> `Control.Parallel' ?
2021-04-13 09:39:34 <ski> perhaps with some of the strategy stuff, or `Eval'
2021-04-13 09:40:33 <ski> you can also consult the relevant sections of
2021-04-13 09:40:34 <ski> @where PCPH
2021-04-13 09:40:34 <lambdabot> "Parallel and Concurrent Programming in Haskell" by Simon Marlow in 2013 at <http://community.haskell.org/~simonmar/pcph/>,<http://chimera.labs.oreilly.com/books/1230000000929/>,<https://web.archive.
2021-04-13 09:40:34 <lambdabot> org/web/20180117194842/http://chimera.labs.oreilly.com/books/1230000000929>,<https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/>
2021-04-13 09:42:46 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-13 09:43:13 × frozenErebus quits (~frozenEre@37.231.244.249) (Ping timeout: 240 seconds)
2021-04-13 09:43:27 cafce25 joins (~cafce25@ipbcc3009d.dynamic.kabel-deutschland.de)
2021-04-13 09:43:47 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2021-04-13 09:44:23 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-13 09:48:41 <xerox_> oh yeah Control.Parallel.Strategies is the thing
2021-04-13 09:48:59 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-13 09:49:15 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
2021-04-13 09:49:32 × timCF quits (~i.tkachuk@200-149-20-81.sta.estpak.ee) (Quit: leaving)
2021-04-13 09:54:42 kristijonas joins (~kristijon@78-56-32-39.static.zebra.lt)
2021-04-13 09:59:40 × rnat2 quits (uid73555@gateway/web/irccloud.com/x-blfxzrgdprfecfub) (Quit: Connection closed for inactivity)
2021-04-13 10:01:54 m1dnight_ is now known as sometesttempnick
2021-04-13 10:02:02 sometesttempnick is now known as m1dnight_
2021-04-13 10:02:40 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 252 seconds)
2021-04-13 10:03:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-04-13 10:03:13 × frozenErebus quits (~frozenEre@37.231.244.249) (Ping timeout: 252 seconds)
2021-04-13 10:03:16 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-04-13 10:04:04 × dixie quits (~dixie@real.wilbury.sk) (Ping timeout: 268 seconds)

All times are in UTC.