4 ms·
Some Notes on Haskell Pedagogy
- stewbrew 9y ago"Pedagogy" is the art/science to guide kids, literally speaking. First, I wasn't sure if he didn't actually mean "didactics" but then he talked about "students" so he probably just talks about "kids" of computer science. Why are all thoughts about how to teach/promote Haskell centered on the language itself as if it were only an academic tool? If you want students to get excited about Haskell, don't make it look like an academic tool that's only useful as a didactic device in university classes on functional programming.
- twblalock 9y ago> "Pedagogy" is the art/science to guide kids, literally speaking. First, I wasn't sure if he didn't actually mean "didactics" but then he talked about "students" so he probably just talks about "kids" of computer science. Literally speaking, you may be right, but who cares? "Pedagogy" means "teaching" to anyone who is seriously engaged with the topic of conversation here. Etymology is not meaning. Defining words by their etymology alone ignores history, culture, and the context of modern word use.
- stewbrew 9y agoIt matters when you're teaching professionally.
- kmicklas 9y agoSome good thoughts in here. However I feel like when I learned Haskell (which was actually my first serious foray into programming) the hard parts were not this high level functional language philosophy stuff, but rather not knowing how to appropriately use the tooling. It took me years to finally write cabal files, QuickCheck tests, Traversable instances, etc. In that regard, this guide has been immensely useful: http://dev.stephendiehl.com/hask/ http://dev.stephendiehl.com/hask/
- brudgers 9y agoI've had very similar experiences. I took a Scala course on Coursera back in 2014 and at the end I realized I couldn't really write a Scala program because the course had provided all SBT files for everything...and because they enabled all sorts of functionality related to autograding, they were impenetrably complex in addition to the necessary complexity of a build tool (which requires a willingness to read a technical manual that assumes I high level of experience and sophistication). A lot of the difficulty is that it is relatively easy for a two pizza team to have enough experience and knowledge to collectively figure out how to get all the moving parts moving more or less in the right direction at more or less the right time. For an individual, it's always going to take years to achieve the equivalent knowledge of a team after six months.
- deleted 9y ago[deleted]
- plandis 9y agofunctor, sum type, recursively defined. This teaching opportunity is already lost. Who are you teaching to? Someone new to programming is going to be lost by the first example.
- runeks 9y agoI agree. From the article: > The | operator indicates that this is a sum type [..] This doesn't explain what's going on; it references terminology used only by people who already know what's going on. A pedagogical explanation would say: the | operator means "or", in that you can use multiple different constructors (separated by |) to construct the type in question (whose name is to the left of the '=' operator). For example: data Bool = True | False means that you can construct a value of type Bool using one of the constructors True or False.
- danieldk 9y agoBut the constructor approach does not explain what makes a sum type a sum. If the readers already have some background in a programming language, you could also start with e.g. a struct from an imperative language: struct Foo { X x; Y y; } This is a so-called product type, because the number of possible values of Foo is the number of values of type X times the number of values of type Y. So if X = {Red, Green, Blue} and Y = {Light, Dark}, then this product type has 3 x 2 = 6 different values: Foo {Red, Light} Foo {Green, Light} Foo {Blue, Light} Foo {Red, Dark} Foo {Green, Dark} Foo {Blue, Dark} What if instead, we wanted to have the sum of the possible values of X and Y? In other words, where we'd have to choose between a value from X or from Y? Foo {Red} Foo {Green} Foo {Blue} Foo {Light} Foo {Dark} That's a sum type: it is a type where you can pick a value from X or Y, giving a total of 3 + 2 = 5 possible values. Then give a motivating example where one would need such a type (e.g. trees nodes) and introduce proper notation.
- hcs 9y agoI agree with your approach, one suggestion: If you're using struct to introduce product, does it make sense to use union to explain sum? Although maybe that's too complicated given the need to tag it?