Search Haskell Channel Logs

Wednesday, March 8, 2017

#haskell channel featuring sssilver, haskull, Rotaerk, monochrom, orion, `Guest00000,

sssilver 2017-03-08 18:57:23
do you guys agree that the whole "haskell is hard, it'll brake your teeth" crap is very damaging and misleading and stifles proliferation? it almost seems like a guided narrative
sssilver 2017-03-08 18:57:47
I consider myself a below average programmer and it's so much easier for me to write bug free code in a language that won't allow me to mess up
sssilver 2017-03-08 18:58:17
than in a language where I, having my subpar brain, will forget to check for null, or modify state somewhere wrong and forget about it, etc
sssilver 2017-03-08 18:58:32
Why don't we pursue the Python narrative of "Haskell is programming for the rest of us"
orion 2017-03-08 19:00:42
Break your teeth? That's usually what I hear about C.
sssilver 2017-03-08 19:01:27
orion I think the common narrative is that Haskell is the apogee of programming language "hardness"
sssilver 2017-03-08 19:01:41
only the enlightened ones have the mental capability to even consider it, let alone approach it
dminuoso 2017-03-08 19:01:46
sssilver: In C you modify state wrong, in Haskell you reduce to a wrong value. You still get to make *that* mistake :P
orion 2017-03-08 19:03:41
sssilver: Unfortunately, most imperative programmers I speak with are just talented *enough* to get things working for business people. That's all you need of course.
orion 2017-03-08 19:08:09
They don't care about functional languages because they haven't been incentivized to care.
sssilver 2017-03-08 19:08:45
like people rave about Javascript because it's approachable by noobs and then sit down and flex their muscles to deal not just with everything being potentially nullable, but freaking nullable in MULTIPLE ways!
sssilver 2017-03-08 19:09:02
I still can't grok the difference between null and undefined in Javascript
sssilver 2017-03-08 19:10:06
I mean I can, but it's quite ridiculous
MP2E 2017-03-08 19:11:31
I think a big part of it is that the tutorials I read come at it from the perspective of understanding the language step by step, and IO comes later, usually accompanied by learning about typeclasses like Monad, Functor, Applicative. For a new user, this can feel like a lot of abstract stuff to take in for something as simple as pulling in input, transforming it in a simple way, and printing it out.
MP2E 2017-03-08 19:12:34
Of course actually *doing* that isn't a big deal at all
orion 2017-03-08 19:14:16
I think words like "noobs" are divisive.
MP2E 2017-03-08 19:15:32
I think there would be value in a tutorial/book that comes at it from the approach of writing outright imperative haskell at first to get the user off the ground running, and then later delve into the deeper stuff. Maybe there's even already something like this out there
MP2E 2017-03-08 19:15:32
I didn't have much issues learning Haskell as is, I just think it would be helpful to bring in people from other languages
sssilver 2017-03-08 19:15:32
MP2E that's roughly how Swift/Rust approach it, i.e. you start programming, and then they go "imagine if you could count on the fact that X will never be null"
sssilver 2017-03-08 19:15:32
"oh look, we actually have optionals for that!"
haskull 2017-03-08 19:15:54
How would you define a monad concisely, with words any programmer would know?
sssilver 2017-03-08 19:16:23
haskull I would probably not define a monad
haskull 2017-03-08 19:16:40
best I can do is something like "pass data between functions with nice syntax"
sssilver 2017-03-08 19:16:54
haskull interesting, that's not at all what I think when I think of monads :))
orion 2017-03-08 19:16:57
The syntax has nothing to do with the definition of a Monad.
sssilver 2017-03-08 19:17:08
I'd probably explain optionals in practical terms
sssilver 2017-03-08 19:17:24
e.g. letting the compiler infer what can be null and what cannot be
sssilver 2017-03-08 19:17:29
and then explain the concept of unwrapping an optional
orion 2017-03-08 19:17:37
haskull: The most concise, accurate, definition of a monad is the mathematical one. If you're a programmer and you don't understand (or don't *want* to understand) mathematical terms, I have to question your career choice.
sssilver 2017-03-08 19:17:48
e.g. peek in it to see whether there's value in it
sssilver 2017-03-08 19:18:03
and then perhaps suggest that the "unwrapping" could in fact be *any* action
`Guest00000 2017-03-08 19:18:30
haskull: monad is a container which has return and bind.
`Guest00000 2017-03-08 19:18:30
and what return and bind are
`Guest00000 2017-03-08 19:18:54
that's all
Rotaerk 2017-03-08 19:19:36
haskull, I think that when someone asks what a monad is, you should just say it's an abstract concept that requires sufficient exposure to examples in order to "get"
`Guest00000 2017-03-08 19:19:39
class of containers, okay
Rotaerk 2017-03-08 19:19:39
i.e. there's no quick way to make them go "oh, I get it"
orion 2017-03-08 19:19:39
Best definition of a Monad: http://hackage.haskell.org/package/base-4.9.1.0/docs/Control-Monad.html#t:Monad
Rotaerk 2017-03-08 19:19:39
well, at least not without misleading them
sssilver 2017-03-08 19:19:39
`Guest00000 I don't think of it as a container. I think of it as of a type that performs some action when acted upon.
sssilver 2017-03-08 19:19:44
`Guest00000 it doesn't have to contain anything at all
Rotaerk 2017-03-08 19:19:56
and the definition itself isn't sufficient for "getting" it
Rotaerk 2017-03-08 19:20:17
unless maybe you're just used to mathematical thinking or something
orion 2017-03-08 19:20:20
haskull: Moreover, you could start by introducing functors first, then applicatives, then maybe monoids, then monads.
sssilver 2017-03-08 19:20:32
I am completely barefoot when it comes to mathematics, but I successfully ship production Haskell code, and it helps me write bug-free programs that I can actually reason about
`Guest00000 2017-03-08 19:20:48
well
sssilver 2017-03-08 19:20:52
my Haskell programs are so much less squishy than my Python programs
monochrom 2017-03-08 19:20:59
There is one aspect any programmer would not know. Monadness is for things like "Maybe" and "Reader e", not "Maybe a" and "Reader e a". Most programmers do not already have words or concepts of this.
`Guest00000 2017-03-08 19:21:02
sssilver: i might mean functor instead of "container"
sssilver 2017-03-08 19:27:29
orion I think a lot of people are actually too humble to question the quality of their tools, so they question their own skill
sssilver 2017-03-08 19:27:45
e.g. "my program in C++ is very buggy" ~> "I am not good a enough programmer"
sssilver 2017-03-08 19:28:05
and from there it goes to "if you're good enough, language is just a tool"
orion 2017-03-08 19:28:18
sssilver: How old are you? How old are the programmers you interact with regularly?
Rotaerk 2017-03-08 19:28:23
lol
Rotaerk 2017-03-08 19:28:29
"humble"
sssilver 2017-03-08 19:28:42
orion I'm 32, age of people I interact with varies from 25 to 50
sssilver 2017-03-08 19:29:05
I know what I say sounds wrong, but I think there's something to it
orion 2017-03-08 19:29:13
I'm 25. The programmers I interact with are 18-35.
Rotaerk 2017-03-08 19:29:38
I've met primarily arrogant programmers, and apathetic programmers
Rotaerk 2017-03-08 19:29:45
can't say I've met many humble ones
orion 2017-03-08 19:29:46
Rotaerk: Yes!
monochrom 2017-03-08 19:29:56
No, I don't think they question their own skill. I think they question each other's skill.