Live data from Hacker News

Haskell for Beginners

blog.kalvad.com

31–40 of 46 posts

Re: Haskell for Beginners

#31

This got me thinking of something a bit ridiculous: could it be possible, given enough carefully designed examples, to effectively teach the basics of a language without using a single word of a human language?

I would say "No", because there's far more to programming than syntax.

Eg, how do you explain things like scope, object lifetimes, and destruction without words? In C for instance, there are various non-intuitive things such as that the string "Hello" is actually 6 bytes.

IMO, syntax is the least important part of programming. It's far more important to understand what exactly that syntax does. Take for instance #include. It looks straightforward on the surface, but there are lots of un-intuitive parts to it, such as that you're effectively copy/pasting a file into your code, that you need include guards, that order can make and a.h can #define something that breaks b.h, that you need to #define _GNU_SOURCE to get some particular bit of functionality before a particular header...

You can definitely write sample code to illustrate all that but I can't think of any way of explaining "what's going on" and "why we're doing this magical looking bit here" without using words.

Re: Haskell for Beginners

#32

Noob question: does it worth, for a beginner, to start with Haskell instead of Elm or Purescript?

They have vastly different use cases. Elm is a frontend language while haskell is a backend one. You may want to learn both for making a full stack app. Or just learn Haskell and use its wasm compiler.

Re: Haskell for Beginners

#33
There's a massive intellectual black hole at the center of the Haskell galaxy, yet many worlds have evolved happy, advanced civilizations without spiraling into that black hole.

A small subset of Haskell makes for a spectacularly effective functional language. Visualize that this subset exists, and have fun learning it. It helps if one has seen other small languages that work, such as Scheme.

Re: Haskell for Beginners

#34
post #21

Learn Haskell in 1-2-3: 1) WHY: The Functional Programmer's Toolkit - Scott Wlaschin : https://www.youtube.com/watch?v=Nrp_LZ-XGsY 2) WHAT: Learn Haskell in one video : https://www.youtube.com/watch?v=02_H3LjqMr8 3) HOW: Haskell without the theory : https://www.vacationlabs.com/haskell/ It'll teach you enough to be dangerous. Obviously your learning has just begun, but with a mental platform that lets you study other…

For more in depth: https://haskellbook.com/

I bought this years ago and it is ~1200 pages and very through. A ~600 page paper version is coming out soon also.

Re: Haskell for Beginners

#36

I'll add my two cents. Over the past year or so I went from being completely overwhelmed by Haskell to feeling pretty comfortable reading / writing Haskell, even enough to make my first PR to a Haskell package! Here's what worked for me: * I went through LYAH, but at a certain point I felt like it wasn't doing me any favors by sweeping some of the inherent complexity under the rug. So I started listening to talks by…

The main reason to learn category theory for Haskell is to learn how much of the Haskell meme complex is wrong. Otherwise, it won't help the typical newcomer. I think it's important to explain that Hask isn't a category, that Haskell's type system is unsound, that Haskell doesn't have sum types, etc.

There are powerful applications of category theory to other parts of computer science. If one keeps in mind that Haskell is Just Another Programming Language, then one can apply category theory more generally and fully.

Re: Haskell for Beginners

#37

There's a massive intellectual black hole at the center of the Haskell galaxy, yet many worlds have evolved happy, advanced civilizations without spiraling into that black hole. A small subset of Haskell makes for a spectacularly effective functional language. Visualize that this subset exists, and have fun learning it. It helps if one has seen other small languages that work, such as Scheme.

Unfortunately, that subset isn't closed or isn't powerful enough to escape primitive recursion; take your pick.

Suppose that I'm wrong and it's both closed and powerful enough. Then, fix an arbitrary Haskell type signature for some function `f`, and consider defining it as `f = undefined` or `f = f` respectively, and work out what still remains in the subset. Indeed, `undefined = undefined` is its typical definition.

Re: Haskell for Beginners

#38

This got me thinking of something a bit ridiculous: could it be possible, given enough carefully designed examples, to effectively teach the basics of a language without using a single word of a human language?

https://mitpress.mit.edu/books/little-schemer-fourth-edition

https://mitpress.mit.edu/books/seasoned-schemer-second-editi...

Re: Haskell for Beginners

#39

I'll add my two cents. Over the past year or so I went from being completely overwhelmed by Haskell to feeling pretty comfortable reading / writing Haskell, even enough to make my first PR to a Haskell package! Here's what worked for me: * I went through LYAH, but at a certain point I felt like it wasn't doing me any favors by sweeping some of the inherent complexity under the rug. So I started listening to talks by…

The main reason to learn category theory for Haskell is to learn how much of the Haskell meme complex is wrong. Otherwise, it won't help the typical newcomer. I think it's important to explain that Hask isn't a category, that Haskell's type system is unsound, that Haskell doesn't have sum types, etc. There are powerful applications of category theory to other parts of computer science. If one keeps in mind that Haske…

> Haskell doesn't have sum types

Say what?..

Re: Haskell for Beginners

#40
post #39

Earlier quoted context omitted.

The main reason to learn category theory for Haskell is to learn how much of the Haskell meme complex is wrong. Otherwise, it won't help the typical newcomer. I think it's important to explain that Hask isn't a category, that Haskell's type system is unsound, that Haskell doesn't have sum types, etc. There are powerful applications of category theory to other parts of computer science. If one keeps in mind that Haske…

> Haskell doesn't have sum types Say what?..

I think it's because `Either a b` contains all of `undefined`, `Left undefined` and `Right undefined`. In other words, a technicality.
Post reply on HN