learn category theory -- and haskell! :P
January 26, 2020 7:43 AM   Subscribe

Programming with Categories - "In this course we explain how category theory—a branch of mathematics known for its ability to organize the key abstractions that structure much of the mathematical universe—has become useful for writing elegant and maintainable code." (course page; course notes; class summaries; via; also btw: Compositionality)
posted by kliuless (60 comments total) 61 users marked this as a favorite
 
“ The number of elements of a set X is called its cardinality because cardinals were the first birds to recognize the importance of this concept.”

I admit it, I LOLed
posted by doubtfulpalace at 8:05 AM on January 26 [9 favorites]


This is cool and I'd like to learn.

However, in just reading the course notes (which the teachers will eventually turn into a book?), I came across this line early: ...the Haskell compiler will issue one of it's famously cryptic error messages.

What are cryptic error messages doing in modern programming? This course is touted for folks with no background knowledge on programming. Yet, they'll be dealing with cryptic error messages. "Hello, new user. You made an error somewhere in your program. Fuck you."
posted by snwod at 8:30 AM on January 26 [3 favorites]


What are cryptic error messages doing in modern programming?

I could tell you things about C++ that you would not believe.
posted by sjswitzer at 9:05 AM on January 26 [15 favorites]


Taking this class
posted by ocschwar at 9:06 AM on January 26


The lecturer, Bartosz Milewski, also has an open-source book on the topic, which is available here.
posted by acb at 9:12 AM on January 26


I wish they could find a way to explain stuff like this in a way that sounded like something to me, it sounds so interesting but then the content is all words that mean something other than what they sound like and the meanings are never explained.
posted by bleep at 9:31 AM on January 26 [5 favorites]


This course is touted for folks with no background knowledge on programming. Yet, they'll be dealing with cryptic error messages.

Sounds like an comprehensive introduction to modern programming.
posted by figurant at 9:42 AM on January 26 [8 favorites]


Yeah, the idea that this targets and is designed to be accessible to people with "no background in math or programming" is more or less laughable.

I applaud the intent, but the authors have lost touch with what those words mean in that order and demonstrate that within a few paragraphs of preface.

Incidentally, if you try to do a Hello World module in the format suggested, you have to tell ghc to treat your module as its own "main" or it will compile .hs and .o files but silently fail to generate an executable.

(If you specify an executable output file using -o, then it will emit an error informing you no executable output will be generated because there's no main)

Thus, to compile an executable called Hello from a source file called hello.hs containing

module Hello where
main = putStrLn "Hello Haskell!"

you need to issue the command:

$ ghc -main-is Hello hello -o Hello


Beyond all the bafflegab in the few first paragraphs, calling on analogies between mathematical and programming concepts that the reader supposedly is encountering for the first time, you can't credibly say you're targeting beginners while giving examples that don't compile according to the only invocation of ghc explained.
posted by snuffleupagus at 9:43 AM on January 26 [11 favorites]


I could tell you things about C++ that you would not believe.

I seriously doubt that. ;)
posted by jeffamaphone at 9:44 AM on January 26 [1 favorite]


you need to issue the command:

$ ghc -main-is Hello hello -o Hello


I once met a talking parrot who just said "Hello" all day in a vast range of inflections and prosidies. I feel like this is a programming language it could pick up.
posted by kaibutsu at 9:48 AM on January 26 [8 favorites]


I mean, seriously....how do you say "no background required" and then provide this as your basic introduction:


Since programming is about composition, and categories model the essence of composition, one interesting game to play is to think of – we’ll say model – a programming language as a category. In this model, morphisms correspond to programs. What do the domain and codomain of a morphism correspond to? The objects of the category correspond to types, like int or string. In a category, we can only compose a morphism f with a morphism 1 if the codomain of f is the same as the domain of 1. If we’re modelling a programming language as a category, this suggests we want to only allow composition of programs f and 1 if the output type of f is the same as the input type of 1.

A program that consumes an int shouldn’t be able to accept a string! Haskell is designed with this principle in mind, and checks for this sort of error at compile time, only allowing construction of programs that are well-typed.

Category theory is about relationships, and as part of this viewpoint, relationships between categories are very important. The basic sort of relationship is known as a functor. A functor between categories C and D must give an object of D for every object of C. These correspond to type constructors (which a bit of additional structure).

Going deeper still, the basic sort of relationship between functors is known as a natural
transformation. These too are useful for thinking about programming: they are used to
model polymorphic functions.

As may be now clear, types play an a fundamental role in thinking about programming from a categorical viewpoint


No background except a light beach read of The Art of Unix Programming .

Also this bit, which is the entire explanation of what these basic operators do in Haskell:

Useful functions: abs, floor, ceiling, round; integral division div and mod satisfying the equality:

(div x y) * y + (mod x y) == x


What is that supposed to mean to someone who we assume has "no background in math?"

I wonder what the add/drop period looks like for this class.
posted by snuffleupagus at 9:58 AM on January 26 [9 favorites]


I wonder what the add/drop period looks like for this class.

It's a course at MIT. I'm sure the kids can handle it.
posted by great_radio at 10:12 AM on January 26 [3 favorites]


If you're really going to give it a try, here are some things to do:

1. Install Emacs and learn to use it.
2. Install Emacs Haskell-Mode.

Haskell introductory exercises will instantly become a lot easier because you can have one Emacs buffer for the code and one for the interpreter and the minutia go away. No need for compiler commands.

If you want some context to all this:

In 1937, Alan Turing published the founding paper of computer science, "On Computable Numbers ... ". The paper established that once you build a general purpose computer (as defined there in), you can use it to emulate the behavior of any other general purpose computer, which is why building one would be worth the aggravation and expense. (Both of which were absolutely monstrous at the time.)

A facile and wrongful reading of the paper will tell you that the only way to know how a computer program will run is to write it and run it. That facile and wrongful reading of the paper was the excuse for decades of bad code. In reality, there are ways to establish before run time that your code is free of particular classes of error, and those have made their way into the development of computer languages over the decades. Category theory, and the languages associated with it (Haskell, OCaml, et cetera) is how you can develop new measures to exclude new categories of error from your code.

However, it is insanely abstruse, and the people using it are notorious for underestimating the difficulty of catching up to where they are. The lectures in this class are dominated by MIT math majors who have been introduced to a lot of the ideas behind category when they took classes on set theory, group theory, ring theory, lattice theory, and type theory. So if this is going over your head, you have nothing to be embarrassed about, and I say this as an MIT (non-math) alumnus.

Despite being abstruse, this material is being developed by professors who at least aspire to being more accessible. Professor Spivak started last year's class by opining that the debate between whether math is invented or discovered is wrong, and that what mathematicians do is develop new interfaces into math, some of which are better than others. That class (based on the 7 Sketches in COmpositionality book) included a notational system called "wiring diagrams", or "Joyal diagrams." Their inventor, Prof. Joyal, claims that he can get 10 year old children to use them correctly.

And it is important. O'Caml, a very similar language to Haskell, was used to develop another language, Rust, (also discussed on the blue). The compiler team used OCaml's category theoretical constructs to develop this new language. Rust is similar in look and feel to C and Java, but it uses compiler time checking to prevent the bug classes that plagued the industry in the 90's and aughts: memory corruption and race conditions. You don't need to blather about functors and monads to use it.
posted by ocschwar at 10:20 AM on January 26 [20 favorites]


It's a course at MIT. I'm sure the kids can handle it.

Hah! I went straight to the PDF. That makes a lot more sense.
posted by snuffleupagus at 10:25 AM on January 26


One thing that has always stood about to me about category theory in functional programming is just how different they way people talk about it is from category theory in math. I keep meaning to read Milewski's book in the hopes that it would shed some light on this thing. Of course, something called Category Theory for Progammers is probably not going to solve my problems, given that my background is math.
posted by hoyland at 10:37 AM on January 26 [1 favorite]


This course is touted for folks with no background knowledge on programming.

This is something I've thought a lot about in the last two decades. Back when I was young (and dinosaurs ruled the Earth), I knew programming down to the bare metal and logic circuits, which today seems as obtuse as thinking that you know biology because you studied chemistry.

I confess, I have no fucking idea how you all think about computers and programming. I think about Boolean algebra, you think about attack surfaces. I would have been right at home working with the bombes at Bletchley Park. I look at my co-workers, fiddling with their cellphones, while astonished that they don't perceive the miracle in their hands, a simple device that gives them instant access to humanity's hive mind (for good and ill).

(I studied up on how to grow strawberries this morning. Imagine that, 30 years ago.)

I work at a school district and I am confronted by the fact that these kids know both more and less than me. I have never felt older, than I did last year, when a student very politely asked me to move out of the frame of the project that she and her video chat friends were working on. I shuffled into a corner, the project proceeded, and my lifetime of experience meant no more than a life spent shoeing horses or repairing buggy coaches. I have become extinct in my own lifetime.
posted by SPrintF at 10:46 AM on January 26 [9 favorites]


No background except a light beach read of The Art of Unix Programming .

I was thinking, they mean no background except a B.S. in mathematics.
posted by thelonius at 10:59 AM on January 26 [1 favorite]


Hah! I went straight to the PDF. That makes a lot more sense.


Note that the PDF is still evolving. Hit reload some time next week.

Oh, and also, Learn You a Haskell is good for this context too.
posted by ocschwar at 11:06 AM on January 26 [5 favorites]


Yes, please don't try to follow the PDF right now. On page two, this happens:

> let de-space = concat . words

Haskell doesn't allow hyphens in variable names, but this happens to be valid syntax anyway. If you try it, you don't get an error message right away, but … interesting … things will happen later since you just changed the definition of subtraction. Probably not the friendliest introduction to the language.
posted by you at 11:10 AM on January 26 [8 favorites]


I mean, seriously....how do you say "no background required" and then provide this as your basic introduction:
"The curse of knowledge is a cognitive bias that occurs when an individual, communicating with other individuals, unknowingly assumes that the others have the background to understand. For example, in a classroom setting, teachers have difficulty teaching novices because they cannot put themselves in the position of the student. [...]"
The Curse of Knowledge
posted by rhizome at 11:20 AM on January 26 [6 favorites]


I wish they could find a way to explain stuff like this in a way that sounded like something to me, it sounds so interesting but then the content is all words that mean something other than what they sound like and the meanings are never explained.

"Thus mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." –Bertrand Russell
posted by wildblueyonder at 11:22 AM on January 26 [2 favorites]


One thing that has always stood about to me about category theory in functional programming is just how different they way people talk about it is from category theory in math.

For some reason, I didn't see that coming, but in hindsight it does make sense. I have this pet idea that doing physics trains you to math in a certain way, doing comp sci trains you to math in an entirely different way, and both of those ways of mathing are different from someone who just maths all day.
posted by Jpfed at 11:30 AM on January 26 [2 favorites]



Back when I was young (and dinosaurs ruled the Earth), I knew programming down to the bare metal and logic circuits, which today seems as obtuse as thinking that you know biology because you studied chemistry.

(I studied up on how to grow strawberries this morning. Imagine that, 30 years ago.)

I have never felt older, than I did last year, when a student very politely asked me to move out of the frame of the project that she and her video chat friends were working on. I shuffled into a corner, the project proceeded, and my lifetime of experience meant no more than a life spent shoeing horses or repairing buggy coaches. I have become extinct in my own lifetime.


For what it's worth, if you're studying up on those strawberries via YouTube, you may have noticed that there are easily hundreds of thousands of people who — though they may not be in your classroom — greatly enjoy it when veteran technologists such as yourself fully occupy the frame.
posted by snuffleupagus at 11:39 AM on January 26 [2 favorites]


no background except a B.S. in mathematics

I have a BA in mathematics and category theory might as well be a long-con practical joke for all the sense I can make of it. That said, I bounced straight off group theory so it's clearly not my thing.
posted by BungaDunga at 11:51 AM on January 26 [4 favorites]


announcing up front that you assume no prior knowledge is stupid. Anyone who is really good at explaining category theory is very (very) unlikely to be the same person who is really good at giving you a crash course in, uh, mathematics and programming generally. Sure, "no prior knowledge" sounds good, but probably what you want is 1) a good solid class on the mathematics background you'd need, 2) a good solid class on the programming background you'd need and 3) a good solid class on category theory.

It's like trying to set up a class in Russian literature (in the original Russian) with "no prior knowledge of Russian required". Do you want to be taught Russian by a Russian literature professor, or by someone who teaches Russian to beginners every day?
posted by BungaDunga at 11:56 AM on January 26 [6 favorites]


Really I think most people would understand, with no background, imperative programming most naturally. "Do the thing. Do it again. Now stop."
posted by thelonius at 12:02 PM on January 26 [3 favorites]


> 1. Install Emacs and learn to use it. 2. Install Emacs Haskell-Mode. Haskell introductory exercises will instantly become a lot easier...

...because at this point you will have also taught yourself LISP, Unix shell programming, a smattering of C, and how to hold five keys down on the keyboard simultaneously.

The claim that this particular Haskell course can be taken with no prior knowledge of math and programming is untested when the students for the course can only access the classroom after extensive tutelage in advanced math, algebra, trig and calculus, and with years of experience in high school classrooms in programming, physics, chemistry and biology.

The problem with many introduction-to-programming courses (not merely this one) is the bootstrapping. And I wonder whether in some ways it's a harder problem than it was, say, thirty years ago when it was easier to assume that any well-educated person's first-hand exposure to computers might be limited to using ATM machines and their office's word processors, so ambitious "learn a language from scratch" courses (remember SAMS?) tended to start at a much more fundamental level and ramp up more gradually. These days, a selection of randomly-picked people might already have experience with programming expressions and functions through having to manage their office's Excel files, so learning can become a process of understanding the concepts underlying what they're already doing, rather than having to learn the concept and the application of it simultaneously.
posted by ardgedee at 12:02 PM on January 26 [5 favorites]


I skipped to page 30 to see where it goes, and here's a wonderful passage: "He says that Haskell can stand as the internal language of cartesian closed category, or perhaps a bicartesian closed category, or perhaps a bicartesian closed category with initial algebras for every finitary endofunctor. You don’t have to know what that means, but basically he’s saying that we should think of Haskell as telling us about the objects and morphisms in general (bi)cartesian closed categories."

This sort of wanky writing seems designed specifically to weed out people who don't enjoy being condescended to. "You don't have to know what that means"? Of course I don't know what that means! This course assumed no prior knowledge! Stop being a dick!
posted by BungaDunga at 12:05 PM on January 26 [8 favorites]


Really I think most people would understand, with no background, imperative programming most naturally. "Do the thing. Do it again. Now stop."

You'd think that. But then they wave their hands, "I didn't mean... STOP IT!"

It takes a certain mindset to think about data and it's relationship to reality. This is what analysts bring to the argument.
posted by SPrintF at 12:06 PM on January 26 [1 favorite]


how to hold five keys down on the keyboard simultaneously.

I still can't find the 'Meta' key on mine!
posted by thelonius at 12:07 PM on January 26 [3 favorites]


Oh, the P(T)SD. I may need a drink.
posted by kleinsteradikaleminderheit at 12:11 PM on January 26 [1 favorite]


In a similar vein, this course on Applied Category Theory is quite interesting and genuinely accessible if you have some undergrad level algebra. Seems to be lots going on in ACT at the moment which makes me sorry I lost touch with maths as a subject for the joys of project management.
posted by crocomancer at 12:32 PM on January 26 [2 favorites]


I wonder what proportion of uses of Haskell are purely performative.
posted by acb at 12:53 PM on January 26 [5 favorites]


HaskellWiki lists a number of commercial applications in Haskell. But there aren't a whole lot compared to other languages and they seem rather specialized. The somewhat related language OCaml is used extensively in automated theorem proving.

For me Haskell is a laboratory for thinking about types and programming, and my impression is that it for many others too. A major feature of Haskell is that it uses lazy evaluation. That has interesting consequences, including that it is hard to think about the time and, especially, space complexity of a program. For that reason, I'm not convinced that lazy evaluation is "ready for prime time" but in specific domains it's probably just fine.

I was toying with a sort algorithm for fun (and to "learn me a Haskell") and while testing it I was finding it to run unreasonably fast. Well, to force the sort to even run at all (thanks laziness!) I had it pick the first element of the result and print it. And somehow it ran in linear time. Due to laziness, Haskell "knew" it only had to find the minimum input value and didn't do any more than that! (As it turned out, I had reinvented the bottom-up mergesort for lists. I had written a version of this in the early 80's so I may have actually invented it first, but pics or it didn't happen as they say.)

Category theory is a very clarifying way of looking at generic types, and it's influenced languages like Swift and Scala significantly. C++ less so, I suppose, but I would claim that a lot of the improvements in the language over the last decade have been due to category-influenced thinking.
posted by sjswitzer at 1:51 PM on January 26 [3 favorites]


I will say this about Haskell, though: it's second only to Perl for how fast I forget the idioms if I don't use it regularly and I can no longer read the code that I've written. (Thanks to Python I never think about Perl anymore.)
posted by sjswitzer at 1:56 PM on January 26 [1 favorite]




HaskellWiki lists a number of commercial applications in Haskell. But there aren't a whole lot compared to other languages and they seem rather specialized. The somewhat related language OCaml is used extensively in automated theorem proving.


If you've done any formal methods work in a commercial venture, your work is very much a proprietary and valuable artifact that your boss will insist on guarding closely. This irritates me because so much of the learning material in this space is based on inane puzzle problems that I can barely make myself care enough to read.
posted by ocschwar at 2:21 PM on January 26 [3 favorites]


Even if Haskell is a "toy language" (and I'm not convinced that it is), there's a lot of value in toy languages. They can be used to explore ideas (like lazy evaluation, type systems, and functional purity) wherever they lead without being derailed by "practical concerns." The resulting ideas can then be imported into languages with a more practical bent and, indeed, this has already happened: Scala, Swift, Rust, and to some extent C++ have benefited from learnings from Haskell and category theory.
posted by sjswitzer at 3:04 PM on January 26 [5 favorites]


My experience with category theory is that there's a certain place you can get to where all of the intuition is basically diagrammatic, and the giant piles of jargon just describe different restrictions on the diagrams.

A category is just a 'directed graph': a bunch of points with arrows going from one point to another (and some notion of 'paths' that you get by following one arrow and then following another). How many points? Maybe one, maybe uncountably many. How many arrows between any particular pair of dots? Maybe none, maybe a few, maybe uncountably many. If there's an arrow from A->B, is there always an arrow from B back to A? Are some of the arrows colored, so that you can only put the ones of the same color together into a path? If you can solidly answer any of these questions (or a hundred more), there will be some bit of category theory jargon to describe that situation.

Now, it turns out that dots-connected-by-arrows is also incredibly important in computer science. Think of (finite) state machines, for example... Or suffix trees. Or the flow of data from a collection of databases, through a forest of SQL filters and joins, and into a model consisting of a pile of matrix multiplies which eventually outputs a decision as to whether someone should get a car loan. All of these are directed graphs that you can describe with category theory jargon.

AFAICT, the "main" point of attaching the jargon is mostly to prevent unexpected errors. If I know that the graph should be loop-free, I can encode that in category jargon, tell the program that the graph is loop-free, and throw an error when any loops are detected.

The other things that I think of in this context are finite directed graph algorithms, which don't really need the full force of category theory. For example, you've got a big graph of computations (hello, tensorflow!) and want to figure out how to split them out over a huge number of machines, with various degrees of communication overhead. It's a huge, important problem, but not one that 'real' category theory helps with much...

And that's actually a lot of the rap that category had when I was in math, too. You can, with a decent amount of effort, prove something 'once' and have that proof apply across a large range of other areas... But overall, it's mostly proving things that you already kinda knew anyway, and really making progress at the edges requires more specific knowledge than the category-level view is willing to delve into.

(caveat: all of this is spoken from the perspective of a former combinatorialist who now makes neural networks, and my biases are thus deep in both of those directions. I am very happy to hear that I'm completely wrong on the applications front.)
posted by kaibutsu at 3:12 PM on January 26 [10 favorites]


I would also distinguish toy languages from cult languages.

SETL, for instance, was a cult language promulgated at a particular institution by a particular professor and was transparently unsound (because the set isomorphism problem is not computationally tractable). It was a thesis factory inside a little research echo chamber. Haskell, on the other hand, is sound as far as we know and, whatever its practical value, a valuable and productive research vehicle.
posted by sjswitzer at 3:13 PM on January 26


The ability to import a result from one area of math to another would seem to be a huge advantage of category theory. But, yeah, if this was all ex-post-facto that would be kinda anticlimactic. Is anyone aware of a case where category theory was used in a new proof? I guess I assumed that it had--and hence all the interest--but maybe not? Surely something in algebraic topology?
posted by sjswitzer at 3:20 PM on January 26


It can't just be boxes and arrows right?
posted by bleep at 5:02 PM on January 26 [1 favorite]


Well, Go is just a game about stones on a grid...
posted by kaibutsu at 7:40 PM on January 26 [1 favorite]


Functors are pretty explicitly about how you move from one domain to another. They set the rules for how to "legally" turn one map of dots and arrows into a different map with dots and arrows. Homology, for example, is a functor from topological spaces (dots are topological spaces, arrows are continuous functions) to commutative groups (dots are groups, arrows are homomorphisms). The important part of being a functor is that arrows on one side "map" to arrows on the other side. So each of the (relatively few) group arrows correspond to whole classes of arrows on the topology side. So it's more efficient to understand the group side.

And that's another example of something that was concocted long before category theory was a thing, which has a lot of precise language built up around it now due to our current understanding of categories. But this is also kinda helpful: its knowing the rules for the game of translating one area of math into another. Category theory gives a better idea of what to expect, since it has a bunch of rules which things will generally follow.

Presumably, if you invent "new homology", the existence of lots of category theory means you get a lot of results for free, and maybe spend a lot less time on the basics as a result. It's like automation for math, in a sense. Which is cool! But also more like of advance in process, rather than mind shattering new results.
posted by kaibutsu at 7:54 PM on January 26 [4 favorites]


As an everyday programmer without a very deep math baclground, the world of Haskell is more like an esoteric secret society than a programming language. Not that you can't learn it but you need to enter into and study what for most of us is a whole new system of thought and understanding of computational reality.
posted by thefool at 3:47 AM on January 27 [2 favorites]


Yeah, the idea that this targets and is designed to be accessible to people with "no background in math or programming" is more or less laughable.

That usually seems to mean "those who only have an undergraduate degree in maths or CS".

(Or on reflection, what Theolonius said)
posted by 43rdAnd9th at 6:04 AM on January 27 [2 favorites]


Not that you can't learn it but you need to enter into and study what for most of us is a whole new system of thought and understanding of computational reality.

That's why there's a Simple Haskell movement now, calling on devs to publish more intro-level code in the language and facilitate more progress on the part of newbies.
posted by ocschwar at 7:44 AM on January 27 [2 favorites]


After letting it rattle around in my head for a night, I finally pinned down what bothered me about their intro.

has become useful for writing elegant and maintainable code

That's... quite a claim. Is it measurable?

(... okay, okay, also, their website bothered me. It's not that hard to add alt tags, folks. And certificates take an afternoon to learn from scratch now.)
posted by cowcowgrasstree at 8:25 AM on January 27 [1 favorite]


SETL, for instance, was a cult language promulgated at a particular institution by a particular professor and was transparently unsound (because the set isomorphism problem is not computationally tractable). It was a thesis factory inside a little research echo chamber.

I spent 5 years in that cult and never finished my thesis. It wasn't until just now that I learned I had been in a cult!
posted by Obscure Reference at 9:20 AM on January 27 [1 favorite]


One concerning thing about the Haskell community is that a significant proportion of visible Haskell work seems to be in blockchain/cryptocurrencies/smart contracts. It's like an illustration of the Dunning-Kruger principle, that brilliant category theoreticians can, outside their domain of expertise, fall for absolute dumb crap.
posted by acb at 9:32 AM on January 27 [1 favorite]


Well, if it makes you feel better I was in the transparent RPC/distributed objects cult for longer than that. Feels good to be free. :)
posted by sjswitzer at 9:59 AM on January 27 [1 favorite]


sjswitzer: "Is anyone aware of a case where category theory was used in a new proof? I guess I assumed that it had--and hence all the interest--but maybe not?"

For whatever it's worth, here's a question on the theoretical computer science stackexchange about applications of category theory in CS. And here's a similar question on MathOverflow about applications of category theory to more pure math. The answers may or may not be interpretable depending on your background.
posted by mhum at 6:02 PM on January 27 [1 favorite]


Thanks, mhum. The ones in CS I can grok, and are for the most part familiar to me. My math chops stop short of "sheafs" but from what I gathered it is indeed useful there too.
posted by sjswitzer at 6:36 PM on January 27


I have one rule regarding Haskell: Don't build anything with it that you intend for others to work with or depend on. Even the best-written Haskell will be nigh-impossible to maintain in a real-life work environment, with real people.
posted by Citrus at 7:40 PM on January 27


That's why there's a Simple Haskell movement now, calling on devs to publish more intro-level code in the language and facilitate more progress on the part of newbies.

Gonna spend the rest of the week shopping around my "Simple Haskell for Beginners" book.
posted by rhizome at 10:19 AM on January 28 [1 favorite]


I really like Learn You a Haskell for Great Good. I can't speak to whether it's really approachable to a beginner because I've lost perspective, but it spoke to me.

The problem is that you can only appreciate the approach that Haskell has taken if you've seen the limits of the other approaches. Yes, there are aspects of it that are pretty abstract. But perhaps these abstractions can reign in the complications that arise from traditional programming styles. You might have to stub your toes on them to appreciate it.
posted by sjswitzer at 3:29 PM on January 29 [2 favorites]


I wonder what proportion of uses of Haskell are purely performative.

Well, there's the window manager I use every day, xmonad
What is xmonad?

xmonad is a dynamically tiling X11 window manager that is written and configured in Haskell. In a normal WM, you spend half your time aligning and searching for windows. xmonad makes work easier, by automating this.
posted by mikelieman at 3:43 PM on January 29 [2 favorites]


I bounced off Learn You a Haskell the first time I tried it, but with the intention of coming back to it eventually.

I never managed to get through all that much of Why's (Poignant) Guide to Ruby either.

Maybe I'm weird, but IMHO one the best beginner languages I've encountered — especially in the functional area — is Racket. Not that I've learned enough to do anything useful with it on my own.
posted by snuffleupagus at 4:09 PM on January 29


Beatiful Racket: Why Racket? Why Lisp?

from the inimitable Butterick.
posted by snuffleupagus at 7:21 PM on January 29 [1 favorite]


Well, there's the window manager I use every day, xmonad

Doesn't that have the fatal flaw that, if you get a syntax error in your (strongly typed, compiled) configuration file, your whole window manager stops working?
posted by acb at 5:05 AM on January 31 [1 favorite]


Doesn't that have the fatal flaw that, if you get a syntax error in your (strongly typed, compiled) configuration file, your whole window manager stops working?

It depends. If it fails to compile while you're running, then it's not a showstopper, but if you do log out and find out that you keep returning to the login screen, I just pick a different window manager temporarily to get it fixed.

FWIW, the last time I changed my xmonad.hs was July 2017.
posted by mikelieman at 5:40 AM on January 31


« Older Formahoof   |   Fantastic beasts and someone to draw them Newer »


This thread has been archived and is closed to new comments