Search Haskell Channel Logs

Friday, February 10, 2017

#haskell channel featuring merijn, Jello_Raptor, drostie, monochrom,

drostie 2017-02-10 10:45:33
merijn: also depends on what you're doing whether you introduce an extra dependency.
monochrom 2017-02-10 10:45:49
The other day someone noticed that many editors' colour schemes give comments a faint, invisible colour, and wondered why.
merijn 2017-02-10 10:46:24
monochrom: I'm confused whether you're complaining at me or not :p
monochrom 2017-02-10 10:46:28
My theory is that people now believe in the dystopia of "self-documenting code", and so the only purpose left for comments is to comment out code.
monochrom 2017-02-10 10:48:55
Do you believe in the dystopia of "self-documenting code"?
merijn 2017-02-10 10:49:45
monochrom: I think the file I currently have open has about 50:50 code to comment ratio? But then, I didn't write most of those...so maybe? >.>
monochrom 2017-02-10 10:50:19
Then my complaint may be including you.
drostie 2017-02-10 10:50:31
merijn: I'm thinking particularly in my current case I had this bright idea, "hey, I have this simple .take() and .drop() set of methods, I could .takeWhile() and .dropWhile() but all of the code those don't duplicate with .take() and .drop() they duplicate with each other, about checking whether the prefix is still valid." So it seems like I should refactor out the count-prefix code and then take or drop the corresponding prefix.
drostie 2017-02-10 10:50:43
3 guesses why this is actually a stupid idea. ^_^
monochrom 2017-02-10 10:52:16
Actually let's make it more fun. Do you simultaneously believe in "self-documenting code" and "personal growth in the programming career"? Because they are in fundamental contradiction.
merijn 2017-02-10 10:52:17
Maybe I should just write a CPP macro...
merijn 2017-02-10 10:52:38
Ugh...this line of thinking is going to be my thesis all over again...
monochrom 2017-02-10 10:53:02
Namely, if all you see is self-documenting code, you will never learn the more subtle and advanced things, therefore no personal growth.
monochrom 2017-02-10 10:55:02
If you go with the first option, you are doing your maintainer a service --- you are teaching them a non-obvious generalization (or specialization).
monochrom 2017-02-10 10:55:18
Something they will never learn by reading self-documenting code.
monochrom 2017-02-10 10:55:32
But be sure the teaching happens in comments.
monochrom 2017-02-10 11:03:31
Hrm, old literature says "overloaded function" instead of "method" (for class methods).
monochrom 2017-02-10 11:04:09
It is in Mark Jones's "typing haskell in haskell" but there are also a few relics in Haskell 2010.
monochrom 2017-02-10 11:11:04
onoes, he also uses "Monad m => X -> m Y" for partial functions relying on "fail"
merijn 2017-02-10 11:18:36
Anyone know where I can get more up-to-date vim syntax highligthing for cabal files? Mine seems rather out of date
monochrom 2017-02-10 11:18:53
He also writes "f x y | Ctor x == y" instead of "f x (Ctor z) | x == z"
monochrom 2017-02-10 11:20:31
I guess it is more uniform because he has other guards that do not require y == Ctor something
Jello_Raptor 2017-02-10 11:44:13
Okay, so I found a way to get "shared constructors" on my datatypes :/ but it's cludgy and I'd appreciate any insight on better ways to solve the problem.
Jello_Raptor 2017-02-10 11:44:15
http://lpaste.net/352341