Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 259 260 261 262 263 264 265 266 267 268 269 .. 5022
502,152 events total
2020-09-27 22:13:47 <Guest_94> Maybe ill be back with more questions one day hahah
2020-09-27 22:13:54 × kelvin quits (uid466767@gateway/web/irccloud.com/x-ymoihyiqzvmzmxqc) ()
2020-09-27 22:13:54 <ski> you're welcome
2020-09-27 22:14:00 <normie> djinn just has some small namespace clashes that keep lambdabot from working by default
2020-09-27 22:14:14 <normie> tell wadler we said thanks :)
2020-09-27 22:14:46 <Guest_94> for sure :)
2020-09-27 22:14:51 × Guest_94 quits (5c101100@92.16.17.0) (Remote host closed the connection)
2020-09-27 22:16:58 <normie> so npm has a package called "is-even" that gets something like 2.4 million downloads a month
2020-09-27 22:17:17 <normie> because apparently it's easier to pull in a dependency instead of just using the modulus operator
2020-09-27 22:17:31 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.)
2020-09-27 22:17:41 <normie> so I spent a few hours last night coming up with something even more convoluted and disgusting in haskell
2020-09-27 22:17:44 <normie> https://github.com/dreamsmasher/is-even
2020-09-27 22:17:58 <ski> i heard there was also a package called `left-pad'
2020-09-27 22:18:06 <normie> if anyone has any more ideas of how to implement is-even, please let me know
2020-09-27 22:18:14 <normie> HAHAHAHA the left-pad debacle was so funny
2020-09-27 22:18:32 <pjb> is-even = not is-odd
2020-09-27 22:19:10 <normie> I wrote 9 different versions, ranging from state transformers to profunctors to using church numerals
2020-09-27 22:19:33 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
2020-09-27 22:19:53 <ski> @where evolution -- normie
2020-09-27 22:19:54 <lambdabot> http://www.willamette.edu/~fruehr/haskell/evolution.html
2020-09-27 22:20:17 mpereira joins (~mpereira@2a02:810d:f40:d96:294e:473a:4b53:edb9)
2020-09-27 22:20:25 <normie> hell yeah I forgot about this article
2020-09-27 22:21:47 × falafel quits (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) (Ping timeout: 240 seconds)
2020-09-27 22:22:30 kelvin joins (uid466767@gateway/web/irccloud.com/x-vooczelxxwqtkmcj)
2020-09-27 22:22:38 × jedws quits (~jedws@121.209.139.222) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-09-27 22:22:58 × wz1000 quits (~wz1000@static.11.113.47.78.clients.your-server.de) (Ping timeout: 246 seconds)
2020-09-27 22:25:20 × mpereira quits (~mpereira@2a02:810d:f40:d96:294e:473a:4b53:edb9) (Ping timeout: 246 seconds)
2020-09-27 22:25:39 kelvin parts (uid466767@gateway/web/irccloud.com/x-vooczelxxwqtkmcj) ()
2020-09-27 22:26:14 <dolio> Isn't it more expensive to depend on is-even than just writing it?
2020-09-27 22:28:09 <ski> normie : you have various redundant pairs of brackets, in there
2020-09-27 22:28:32 wroathe joins (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net)
2020-09-27 22:31:13 × fluturel quits (~fluturel@86.120.237.180) (Ping timeout: 260 seconds)
2020-09-27 22:33:13 <normie> that's the joke, I honestly don't know why the npm ecosystem is so ridiculous
2020-09-27 22:33:41 <hpc> most of those silly micropackages are written by one guy
2020-09-27 22:33:59 <normie> but people *use* them
2020-09-27 22:34:26 <hpc> yeah, that i can't explain
2020-09-27 22:34:45 <normie> also @ski whereabours are these brackets
2020-09-27 22:34:50 <normie> in evenProf?
2020-09-27 22:34:57 hackage achille 0.0.0 - A library for building static site generators https://hackage.haskell.org/package/achille-0.0.0 (flupe)
2020-09-27 22:39:30 <ski> normie : `_evenState',`<=',`isEven' .. also all the `(Integral a) =>'s which could be just `Integral a =>'
2020-09-27 22:39:41 <ski> normie : also, you have lots of `$'s i don't like :)
2020-09-27 22:40:14 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-09-27 22:41:13 <ski> e.g.
2020-09-27 22:41:21 <ski> evenState n = not . head $ evalState (sequence $ replicate (fromIntegral n) _evenState) n
2020-09-27 22:41:26 <ski> would imho be better as
2020-09-27 22:41:35 <ski> evenState n = not . head $ evalState (sequence (replicate (fromIntegral n) _evenState)) n
2020-09-27 22:41:38 <ski> or even
2020-09-27 22:41:47 <ski> evenState n = (not . head) (evalState (sequence (replicate (fromIntegral n) _evenState)) n)
2020-09-27 22:41:59 <ski> one could do
2020-09-27 22:42:21 <ski> evenState n = (not . head . (`evalState` n)) (sequence (replicate (fromIntegral n) _evenState))
2020-09-27 22:42:48 <ski> but of course `sequence (replicate n acts)' can be simplified to `replicateM n acts'
2020-09-27 22:43:16 <normie> I forgot about replicateM, thank you
2020-09-27 22:43:58 <ski> similarly
2020-09-27 22:44:00 <ski> (runBool . contr $ (head . dropWhile ((< n) . covar) . iterate dmp) m) False
2020-09-27 22:44:03 <ski> looks hideous
2020-09-27 22:44:09 <ski> how about
2020-09-27 22:44:40 <ski> (runBool . contr . head . dropWhile ((< n) . covar) . iterate dmp) m False
2020-09-27 22:44:41 <ski> ?
2020-09-27 22:45:05 × adam_wespiser quits (~adam_wesp@209.6.42.110) (Remote host closed the connection)
2020-09-27 22:45:16 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
2020-09-27 22:45:49 adam_wespiser joins (~adam_wesp@209.6.42.110)
2020-09-27 22:47:45 <ski> evenState n = (not . head . (`evalState` n) . replicateM (fromIntegral n)) _evenState -- i guess i might write the previous one like this (possibly inlining `_evenState')
2020-09-27 22:48:29 <normie> @ski changed evenProf, big thank you
2020-09-27 22:48:30 <lambdabot> Maybe you meant: wiki src ask
2020-09-27 22:48:43 <normie> how are you refactoring these so quick
2020-09-27 22:49:27 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 240 seconds)
2020-09-27 22:49:49 <normie> I like that infix version, saves a "$"
2020-09-27 22:50:02 <ski> normie : also, it's not a convention/tradition on IRC to adorn people's nicknames with sigils (like `@'). simply mention the nickname, if you want to address someone, or refer to them. e.g. starting the message with the nickname, then a comma or a colon, and the bulk of the message, in the former case
2020-09-27 22:50:30 aarvar joins (~foewfoiew@50.35.43.33)
2020-09-27 22:50:33 <normie> ah, got it
2020-09-27 22:50:44 × adam_wespiser quits (~adam_wesp@209.6.42.110) (Ping timeout: 265 seconds)
2020-09-27 22:50:52 <ski> (many IRC clients will hilight/alert the user, if their nickname is mentioned at the very start of a message. i think not as many will do it, if the nickname is mentioned elsewhere in a message (e.g. if there's a `@' in front of it))
2020-09-27 22:51:10 <normie> I keep forgetting that '@' calls lambdabot
2020-09-27 22:51:23 <ski> normie : hm, i thought i was actually rather slow at refactoring them (i was looking a bit at another channel, as well)
2020-09-27 22:51:47 <normie> I think 'evenState n = not . head . evalState (replicateM (fromIntegral n) _evenState) $ n' is the most readable tbh
2020-09-27 22:51:57 <normie> keeps some semblance of a linear control flow
2020-09-27 22:52:49 <ski> on IRC, `@' is used to indicate that someone is an operator, in a channel. if you see a list of nicknames joined to a channel, then commonly IRC clients will display operators in the channel, by having `@' in front of their nickname (also often displayed in their messages). (but you should probably not refer to operators in a channel, by prefixing their nickname with `@', just because of that ..)
2020-09-27 22:53:46 Orbstheorem joins (~roosember@hellendaal.orbstheorem.ch)
2020-09-27 22:53:46 <ski> evenState n = not (head (evalState (replicateM (fromIntegral n) _evenState) n)) -- isn't too bad, either
2020-09-27 22:54:08 <ski> (a few nested brackets are nothing to be afraid of)
2020-09-27 22:54:19 mpereira joins (~mpereira@2a02:810d:f40:d96:294e:473a:4b53:edb9)
2020-09-27 22:55:32 <normie> nested parentheses aren't a (common) (scheme) for readability ;)
2020-09-27 22:55:32 <ski> (.. redundant brackets, otoh, tend to annoy me .. unless there's some particular reason to insert them, like emphasizing something, or perhaps not bothering with keeping track of relative precedence of more uncommon operators)
2020-09-27 22:56:01 × m0rphism quits (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de) (Ping timeout: 264 seconds)
2020-09-27 22:56:23 <ski> (and i seldom write any `$'s at all. `BlockArguments' removes most of my uses of `$')
2020-09-27 22:56:37 <normie> I tend to prefer brackets for typeclass constraints regardless of quantity though
2020-09-27 22:57:02 <ski> that's okay. at least you're aware that you don't need them, for one constraint
2020-09-27 22:57:15 <normie> i'll need to add brackets if any subsequent constraints are added anyways
2020-09-27 22:57:30 <ski> but e.g. it seems that people often don't know that they could write
2020-09-27 22:57:34 <ski> (S a) <= (S b) = a <= b
2020-09-27 22:57:34 <ski> as
2020-09-27 22:57:38 <ski> S a <= S b = a <= b
2020-09-27 22:58:12 <normie> because the precedence of infix operators is greater than those of constructors?
2020-09-27 22:58:27 <ski> (similarly, `let (x:xs) = ...' or `case ... of [] -> ...; (x:xs) -> ...' annoy me)
2020-09-27 22:58:36 <solonarv> s/constructors/function application/, in fact
2020-09-27 22:58:57 <normie> oh wow
2020-09-27 22:59:07 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-09-27 22:59:26 <ski> the "invisible function application operator", "juxtaposition", binds tighter than, has higher precedence than, all (user-defined) infix operators
2020-09-27 22:59:29 × mpereira quits (~mpereira@2a02:810d:f40:d96:294e:473a:4b53:edb9) (Ping timeout: 272 seconds)
2020-09-27 23:01:55 <ski> (but note that the "syntactic operators" `@' and `~' (and `!', and also record construction syntax) binds tigher than application, in patterns. (also record construction and update syntax, in expressions))

All times are in UTC.