Today I can finally say that I "understand" Haskell: it took me about 9 years, 7 books, tens of papers (I can't remember exactly how many, but probably less than 30) and hundreds of hours of trial and error. It was hard, really really fucking hard, but now I can write useful programs in Haskell.
I started with Learn you a Haskell for Great Good, but that was obviously not enough for doing anything real... These are the books I had to read to reach enlightenment: >- Topology (Second Edition) by Munkres >- Principles of Mathematical Logic by Hilbert and Ackermann >- Categories for the Working Mathematician by Saunders >- Types and Programming Languages by Pierce >- Advanced Topics in Types and Programming Languages by Pierce (didn't finish it yet) >- Programming in Haskell by Hutton >- Purely Functional Data Structures by Okasaki
Maybe the thing that helped me the most was to read the GHC source code and implement my own tiny Haskell JIT with LLVM: that's when I understood the whys.
Let me know if you Jow Forumsuys have any questions.
Why would anyone bother learning Haskell when all the cool kids have already moved on to Prolog?
Charles Howard
What's a monad?
Jonathan Barnes
That's actually quite an excellent feat, user. Good job, yo.
Has it become your choice to write things in, now that you're useful in it? Or do you fall back to whatever languages you were writing stuff in for the past 9+ years ?
Carson Gutierrez
what makes you think he's actually written any Haskell code?
Cameron Thomas
Cuz he claims that he did, which i guess is good enough for me currently.
Michael Flores
I'm taking a logic course right now where the Prof used a lot of their research to help rewrite the Haskell back end not too long ago, and I wanted to try making a tool to convert between Haskell programs and natural deduction style proofs (a la coq) as a final project. This makes me feel like I have a totally inadequate understanding of Haskell to actually even begin working on the project.
Juan Wright
The best short explanation I can say is that a monad is a monoid in the category of endofunctors. I know this is taken as a "joke" by many, but it's absolutely correct. Thanks. It's actually really nice to write programs in Haskell, but to be honest I am now more interested in Idris, so I am trying to use it for all my new personal projects.
I am also learning homotopy type theory, I believe the future is there.
Liam Evans
What is a monoid and what is the category of endofunctors?
Grayson Green
You should try it anyways!
Juan Howard
So, what have you done with it? Any worthwhile projects? Do you have a haskell job?
Xavier Hall
now get a job
William Taylor
Do you know anything about abstract algebra? it will be a bit difficult to explain otherwise. Some relatively small interpreters, compilers and computer algebra systems, which were "worthwhile" only for me. Unfortunately there are no many Haskell jobs (except for those in academia).
Landon Richardson
I do not know anything about abstract algebra. Can you teach me? it is said that a way to make sure you know something is to be able to teach it to someone else
>The best short explanation I can say is that a monad is a monoid in the category of endofunctors. I know this is taken as a "joke" by many, but it's absolutely correct. if you can't even explain what a monad is in normal terms you didn't understand shit
Parker Myers
When people ask you "what is a Monad?", your answer should not be the definition of a monad, but the general use case of a Monad--it's purpose for existence, why it is "better" than other equivalent methods of implementing the same logic, and why it might be important that "something" is actually a monad when looked at through a peculiar lens.
Easton Ortiz
that's a good explanation of how to explain monads
Ryder Adams
>a monad is a monoid in the category of endofunctors. Ah so it's a troll thread.
Ayden Miller
Now explain them
Tyler Lewis
Why do people always bring up category theory with Haskell? Hask isn't even a category and even if you pretend like it is the category of Haskell types is profoundly boring.
Levi Cruz
Is... This some bait I'm to dumb to understand? Do people actually spend so much time learning Haskell??
Jace Morales
Did I ever claim to understand Monads beyond their autistic jargon definition?
So what you’re saying is, you are the dumbest fucking person to ever grace this site?
Because if you spent 9 years, read ten books, and thirty papers to learn a single programming language, which you then admit there are no professional opportunities for - that’s only something someone criminally insane or stupid would do, right? Normal people would stop at some point. Even irrational people would invent a reason to. Nine fucking years. You are the biggest brain dead monkey I have ever seen manage to create a thread before. That is time you will never get back. You could’ve done anything else with that time. You could have learned several real life, non-meme, non-computer languages in the time that you dedicated to this fucking absurdity. It pisses me off how stupid you are. Do you have children? A wife? Did you ever have to explain to them “no Johnny, I can’t play catch with you because I’m spending my time learning this Jow Forums peddled abstract nonsense computer programming language. No, honey, it won’t lead to any job opportunities. I’m never actually going to use it, I’ll be using Idris after this is all over.” Please, never devote yourself to anything ever again. You have no sense of opportunity cost, no ability to manage your own time. You would be better off put into a managed labor camp where at least after a decade of work you would have a mound of coal to show for your efforts. I’m an ardent capitalist, but you are the kind of person that makes people believe the nanny state is the only solution to the mind boggling level of insanity amongst members of the public. Fucking Christ.
Matthew Robinson
based
Jack Jones
show me on the doll where Haskell touched you, user... it's ok, you're in a safe place now.
Monads are a way of mapping a type that has context over an applicative functor. A functor is something that can be mapped over.
Ryan Perry
>no Johnny, I can’t play catch with you because I’m spending my time learning this Jow Forums peddled abstract nonsense computer programming language. No, honey, it won’t lead to any job opportunities. I’m never actually going to use it, I’ll be using Idris after this is all over. keks hasklel programmers absolutely btfo
Caleb Ward
>it took me about 9 years wasted time Haskell is meme, you infested now
I'm pretty sure I've seen a paper on translating Haskell to Coq. IIRC they wanted to write proofs about the Haskell code. I want to say it was at CPP 2018 but I don't remember for sure.
>Haskell Traditional math thying to do something begore death now the only legit orm of knowlege- a computer programm (not Haskell-on, cose Haskell suck)
Jeremiah Sanders
Do you need an ambulance or is that just cerebral palsy?
Nolan Perez
>learning new things is pointless unless you can make money off of them Jesus Christ and God Almighty, please strike down these nu-Jow Forums posters where they stand
Charles Smith
Pretty much my thoughts exactly, and an excellent pasta sauce. Well done. Enjoy the (you)s.
Michael Cruz
I know the OP is memeing but my programming language theory Prof has every book he mentioned prominently displayed in her office so it's not as far from the truth as I'd like it to be. I'll see if I can dig up that paper and just implement it for my project, thanks for pointing me in the right direction.
Anthony Nguyen
Haskell confirmed glow n(gger trigger word
Nathaniel Williams
>I’m an ardent capitalist Opinion discarded.
Daily reminder that you can learn new things just for fun, in fact the only point to make money is to have time for such things.
Brandon Wood
Learning the different forms of animal shit is learning new things, as well. Do you think this is a good idea spending the most valuable thing you have on?
Connor Diaz
haskell nigger btfo >I wrote a haskell jit and read all these papers, I' m so smart hurr durr >can't explain a simple concept of a monad, repeats meme that makes him feel smart
Prolog is based. Majority of people just haven't been exposed to it.
My prediction the next wave after people jump on the functional programming train is declarative programming with languages like Prolog.
Kayden Collins
t. nu-Jow Forums
Jack Taylor
If you enjoy learning about animal shit, then sure, have at it It seems like OP enjoys learning about programming. Jow Forums used to be full of people like that, not that you'd know
Jordan Richardson
You could've just learned JS and earned 300k in the first year, how silly of you.
Brody Cook
I spent a week figuring how to make a cli snake game in haskell, then I wrote haskell on my CV I was contacted by a guy because of it. Turns out, he had made a gui tic tac toe
Elijah Hall
neat, how much do you make?
Jonathan Collins
This. Anyone who understands something is able to explain it with normal words.
Grayson Butler
based and redpilled
Jace Jenkins
>Haskell is only useful as a mean to pass through stupid resume word filters nice
Elijah Flores
cuck
Matthew Myers
>you don't need to understand computer architecture to program in C that's how stupid you sound
James Sanders
You need to know category theory to do abstractions without creating spaghetti code in any language.
Luke Hall
So it's a static function that operates on class instances?
Chase Roberts
I can explain to you what monads are with words. But I can't make you understand monads with just words. It would be like teaching someone how to make wood carvings with just words.
Joshua Bell
Monads are just functions that compose functions with side effects.
Charles Thomas
I tried to learn prolog when I was about 11 years old..I didn't understand it. :(
Hunter Lewis
Why does every monad need it's own specific transformer? Couldn't there be a generic transformer like transform :: (Monad m,Monad n) => m (n a) -> MonadCompose m n a
Dylan Price
Wrong, monads go well beyond the concept of "function".
Evan Gutierrez
I'm talking about monads in programming, not the mathematical concept.
Carson Ortiz
I think its because monads aren’t composable and transformers are a workaround for this. Which is a bit ironic considering monads themselves are a workaround for allowing only pure functions.
Asher Green
how do i funcitonal programming
Evan Barnes
Programming in Haskell 2nd Edition by Graham Hutton.
Zachary Lewis
A monad in Haskell is a set of functions, and a rule for composing them. There's no general rule for composing functions with side effects, so you need to write your own.
>Haskell doesn't even support dependent types oh am I laffin
Shush now the adults are talking
Logan Gonzalez
As someone who never gets further than some basic tuts. Here are some basic things that I am always too shy to ask for on SO.
I heard that you cannot implement a IO monad in pure haskell, true/false?
If true, isn't that retarded design
If I understand correctly the IO monad is only a marker that "this computation is dirty and uses IO" it also handles failure, is this the correct mental model?
How does one stack multiple monads? Can I have something like an Either IO String.. that uses continuations as a newtype or some stuff?
What's up with template haskell, from what I understand it has horrible performance. Isn't existance a sign that the language is flawed?
Whats up with optics, why do I need literal autism to "modify" some structures?
Jordan Bennett
nice pasta
Jackson Hill
true no true no idea no yes
Haskell is for 130+ only, and I say this unironically.
not OP.
Ayden Campbell
Traditional math truing to do something before death. Now the only legit form of knowledge- a computer program (not Haskell-on, cose Haskell suck)
Humor me for a sec anons. I've been interested in Haskell before ever visiting Jow Forums. I've done some free to take university courses, attended guest lectures. I've only barely grasped the use case of monads other than a fancy way or error handling, and making the code somewhat imperative in style (hurts my soul). My proudest works are 3rd degree spline interpolation, and filtering a 2bil list to search-able sizes in
Sebastian Powell
You cunt. Now I cant' unsee the logo in my wallpaper.
> I heard that you cannot implement a IO monad in pure haskell, true/false? True, virtually by definition.
> If true, isn't that retarded design A main function has type `IO ()`, it is consist exclusively of side-effects. You can do those yourself, but say your (pure) program just takes stdin and produces stdout (i.e. has type `String -> String`), there is a function called `interact :: (String -> String) -> IO ()` which turns it into a suitable `main` and hides all impure IO.
> the IO monad is only a marker that "this computation is dirty and uses IO" it also handles failure Yes, but there are often better ways to deal with failure, see next point
> How does one stack multiple monads? Can I have something like an Either IO String.. that uses continuations as a newtype or some stuff? Through monad transformers. Most pure monads* have a transformer variant that allows them to wrap around an existing monad. In your example that would be EitherT Error IO String, where (EitherT Error) is called the transformer. But EitherT is called ExceptT since it's just adding exceptions of type Error to the underlying monad.
> What's up with template haskell, from what I understand it has horrible performance. Isn't existance a sign that the language is flawed? Most languages don't have template metaprogramming, are they flawed? Template Haskell sucks, but the reason Haskell has so much cool shit is that the GHC people fairly liberally try new features and aren't afraid to remove/drastically rewrite parts of the language. I think everybody hopes that TH is deprecated at some point.
> Whats up with optics, why do I need literal autism to "modify" some structures? Like with monads, it's easier to start using them than to understand them. With monads, using them means you can use do-notation, and with optics you get OO-style field accessors. Once you have a feel for them you can start wondering about the mathematics, which isn't that hard at that point.
Easton Reyes
Not all monads can be monad transformers.
Zachary Hughes
Idris, my dear, you have no ecosystem. But tomorrow I will have dependent types and you will still not have an ecosystem.
Grayson Wood
So your saying books on wood carving are impossible to write? As it's impossible to explain it with words?
Evan Cooper
when you wrap a static class around your object, it's that.
Chase Harris
whats the side effect of the Maybe monad?
Joseph Morgan
This is pretty great desu.
Carter Moore
Thoughts on Haskell Book? Moronuki et al
Alexander Cox
Usefull for parsers untill people realised Applicative was enough for most cases.
A monoid is a set of elements with one operation on the elements of the set and one neutral element. For example natural numbers with addition as the operation and zero as the neutral element of adfition are a moboid.
Alexander Miller
>a monad is a monoid in the category of endofunctors An endofuctor is a functor from and to the same category. A functor is mapping from category to category. A category simply said is a set or ring. A monoid is nicely summed up by As such, a monad is a given set of endofunctors - one if which is the neutral element (probably the identity function) -, and a given operation that "works as" addition (likely function composition).
So, if you have a category, and a bunch of functions "in" it, a monad helps you compose them. Is that right?
Liam Lopez
Wait a minute: are monads just a shitty design pattern to allow IO interoperability in "purely" functional languages? this is fucking stupid
Luke Myers
Monads can be used to accomplish impure operations in a pure language, yeah. But they're a lot more general.
William Barnes
Purity and functionality are different terms, as far as I know.
Pure --> no side effects. Functional --> no sequences, only compositions (as opposed to imperative programming)
IO is kind of a type constructor to signal that given type is not pure, because there is a side effect (reading or writing). The functions that IO function composes are likely pure. And all of these are written in a functional language.
Carter Reed
Not OP but way too fucking long and verbose.
Noah Williams
Has it ever occurred to you that one can learn a programming language (or anything, for that matter) just because he enjoys it? If everything you do revolves around getting jobs and making money, you need to heal yourself.
Oliver Miller
template haskell has great performance, it has terrible everything else
Owen Roberts
Where does the word "IO" appear in that post? >Purity and functionality are different terms They're the same literally by definition.
Blake Hill
this meme is so stupid there are so many things that can't be given layman explanations but people (experts) still can know and understand very much about
Cameron Reed
>explain in normal terms He just did. Perhaps you meant in "dumbed down terms"?