Intermediate Modern Haskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Intermediate Modern Haskell

Jacques Carette

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types


(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour


would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes


I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.


Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)


Jacques


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Tikhon Jelvis
What kind of projects and applications are you focused on? In my experience, the difficulty in learning—and teaching—"advanced" Haskell topics is less in the topic itself and more in the level of abstraction involved. I know that I struggled with GADTs and even existential types not because of the features themselves but because I had real trouble putting the features into context and understanding how I would use them. Just *why* are those abstractions in particular interesting?

I can recommend some of my personal favorite topics like streaming libraries, FRP, automatic differentiation and the probability monad, but whether that recommendation makes sense depends on how you want to use those topics. Alternatively, if you have some specific things you would want to build with the class, we could suggest topics that fit those goals.

On Wed, Dec 16, 2020, 19:22 Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types


(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour


would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes


I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.


Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)


Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Johannes Waldmann-2
In reply to this post by Jacques Carette
Hi,

when I was in a similar situation two years ago
(an advanced course, after something basic) I had this list of topics
https://imweb.imn.htwk-leipzig.de/~waldmann/edu/modul/seminar/fkps/

This was not a lecture but "Seminar", meaning that students give talks.
Not all topics were actually presented -
depending on number, and preferences, of participants.

Meanwhile, I would probably add something on Foldable
(cf. Section 7 of https://arxiv.org/abs/1808.08329)

and I do plan to use https://thinkingwithtypes.com/ next time.

Best regards, Johannes.


PS: overview of my basic course:
https://imweb.imn.htwk-leipzig.de/~waldmann/talk/17/wflp/

with that regard - on your list of topics:

"Basic: ... algebraic data types" - comes last - good heavens!
For me, it's first. See also Joachim's CIS 194.

"likely cover: ... recursion schemes" - by all means do!
Second lecture of basic course! Full marks for Brent's version
of CIS194 https://www.cis.upenn.edu/~cis194/spring13/lectures.html
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

David Feuer
In reply to this post by Jacques Carette
Okasaki's debit analysis!

On Wed, Dec 16, 2020, 10:20 PM Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types


(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour


would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes


I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.


Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)


Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Jacques Carette
In reply to this post by Tikhon Jelvis

Excellent question. I am not focused on any project/applications in particular. I do have a personal bias towards “languages” and processing of them. Haskell really excels at that.  I’m getting the students in my *grad* class (on generative programming) to do partial evaluators using finally tagless the way “it should have been done” in the paper, if we’d been all-knowing 10 years ago 😉 .  I don’t think we’ll get to that in the undergrad class. Maybe as bonus questions.

 

Thanks for the timely reminder to try extra-hard to put all the features in context. My background being Pure Math (long ago), that sometimes leads me to forget that abstraction for abstraction’s sake isn’t everyone’s cup of tea!

 

Certainly things like you mention are excellent topics that fits well with the kinds of programs that I like to write, and that Haskell is fairly well suited for (I’m become an Agda fanboy, so it feels like I’m really slumming it by coding in Haskell, even worse when I’m working in my metaocaml code base).

 

From: Tikhon Jelvis <[hidden email]>
Sent: December 16, 2020 10:42 PM
To: Carette, Jacques <[hidden email]>
Cc: haskell-cafe <[hidden email]>
Subject: Re: [Haskell-cafe] Intermediate Modern Haskell

 

What kind of projects and applications are you focused on? In my experience, the difficulty in learning—and teaching—"advanced" Haskell topics is less in the topic itself and more in the level of abstraction involved. I know that I struggled with GADTs and even existential types not because of the features themselves but because I had real trouble putting the features into context and understanding how I would use them. Just *why* are those abstractions in particular interesting?

 

I can recommend some of my personal favorite topics like streaming libraries, FRP, automatic differentiation and the probability monad, but whether that recommendation makes sense depends on how you want to use those topics. Alternatively, if you have some specific things you would want to build with the class, we could suggest topics that fit those goals.

 

On Wed, Dec 16, 2020, 19:22 Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types

 

(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour

 

would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes

 

I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.

 

Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)

 

Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Jacques Carette
In reply to this post by David Feuer

Which also reminds me of the Hinze-Paterson paper on Finger Trees. Excellent.

 

From: David Feuer <[hidden email]>
Sent: December 17, 2020 8:59 AM
To: Carette, Jacques <[hidden email]>
Cc: haskell-cafe <[hidden email]>
Subject: Re: [Haskell-cafe] Intermediate Modern Haskell

 

Okasaki's debit analysis!

 

On Wed, Dec 16, 2020, 10:20 PM Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types

 

(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour

 

would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes

 

I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.

 

Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)

 

Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Jacques Carette
In reply to this post by Johannes Waldmann-2

Hurray for google translate... I could have dealt with French easily, deciphered quite a few other Romance languages, but German isn't in my bag of tricks. Oh, it wasn't hard to mostly guess, but since I didn't have to...

 

Nice list of topics. I should get a copy of Thinking with Types and officially review it for this purpose. To late for this year, maybe next time.

 

On the topic list: this is the TOC of Thompson's book. Naturally algebraic data types show up already in chapter 1, but are not named as such until later, and then keep getting revisited.  So it's not as bad as that! 😉

 

Yes, Brent's version of CIS194 is brilliant. I could probably use material from the latter half of that course too. [Brent and I go way back - look at the 2nd paragraph of the Acknowledgements in his PhD thesis for details.]

 

> -----Original Message-----

> From: Haskell-Cafe <[hidden email]> On Behalf Of Johannes

> Waldmann

> Sent: December 17, 2020 6:50 AM

> To: Haskell Cafe <[hidden email]>

> Subject: Re: [Haskell-cafe] Intermediate Modern Haskell

>

> Hi,

>

> when I was in a similar situation two years ago (an advanced course, after

> something basic) I had this list of topics https://imweb.imn.htwk-

> leipzig.de/~waldmann/edu/modul/seminar/fkps/

>

> This was not a lecture but "Seminar", meaning that students give talks.

> Not all topics were actually presented - depending on number, and preferences,

> of participants.

>

> Meanwhile, I would probably add something on Foldable (cf. Section 7 of

> https://arxiv.org/abs/1808.08329)

>

> and I do plan to use https://thinkingwithtypes.com/ next time.

>

> Best regards, Johannes.

>

>

> PS: overview of my basic course:

> https://imweb.imn.htwk-leipzig.de/~waldmann/talk/17/wflp/

>

> with that regard - on your list of topics:

>

> "Basic: ... algebraic data types" - comes last - good heavens!

> For me, it's first. See also Joachim's CIS 194.

>

> "likely cover: ... recursion schemes" - by all means do!

> Second lecture of basic course! Full marks for Brent's version of CIS194

> https://www.cis.upenn.edu/~cis194/spring13/lectures.html

> _______________________________________________

> Haskell-Cafe mailing list

> To (un)subscribe, modify options or view archives go to:

> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

> Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Haskell - Haskell-Cafe mailing list
In reply to this post by Jacques Carette
Speaking of finger trees, this video does an excellent job of explaining them, if you're looking for another angle on the idea (either use the accompanying paper, or mine the video for lecture ideas):

https://www.youtube.com/watch?v=ip92VMpf_-A

HTH,

-- Jack

December 18, 2020 8:51 AM, "Carette, Jacques" <[hidden email]> wrote:

> Which also reminds me of the Hinze-Paterson paper on Finger Trees. Excellent.
>
> On Wed, Dec 16, 2020, 10:20 PM Jacques Carette <[hidden email]> wrote:
>
>> I will be teaching a second Haskell course next semester.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Richard O'Keefe
In reply to this post by Jacques Carette
Have you looked at Richard Bird's "Thinking Functionally"?

On Fri, 18 Dec 2020 at 11:53, Carette, Jacques <[hidden email]> wrote:

Excellent question. I am not focused on any project/applications in particular. I do have a personal bias towards “languages” and processing of them. Haskell really excels at that.  I’m getting the students in my *grad* class (on generative programming) to do partial evaluators using finally tagless the way “it should have been done” in the paper, if we’d been all-knowing 10 years ago 😉 .  I don’t think we’ll get to that in the undergrad class. Maybe as bonus questions.

 

Thanks for the timely reminder to try extra-hard to put all the features in context. My background being Pure Math (long ago), that sometimes leads me to forget that abstraction for abstraction’s sake isn’t everyone’s cup of tea!

 

Certainly things like you mention are excellent topics that fits well with the kinds of programs that I like to write, and that Haskell is fairly well suited for (I’m become an Agda fanboy, so it feels like I’m really slumming it by coding in Haskell, even worse when I’m working in my metaocaml code base).

 

From: Tikhon Jelvis <[hidden email]>
Sent: December 16, 2020 10:42 PM
To: Carette, Jacques <[hidden email]>
Cc: haskell-cafe <[hidden email]>
Subject: Re: [Haskell-cafe] Intermediate Modern Haskell

 

What kind of projects and applications are you focused on? In my experience, the difficulty in learning—and teaching—"advanced" Haskell topics is less in the topic itself and more in the level of abstraction involved. I know that I struggled with GADTs and even existential types not because of the features themselves but because I had real trouble putting the features into context and understanding how I would use them. Just *why* are those abstractions in particular interesting?

 

I can recommend some of my personal favorite topics like streaming libraries, FRP, automatic differentiation and the probability monad, but whether that recommendation makes sense depends on how you want to use those topics. Alternatively, if you have some specific things you would want to build with the class, we could suggest topics that fit those goals.

 

On Wed, Dec 16, 2020, 19:22 Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types

 

(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour

 

would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes

 

I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.

 

Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)

 

Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Intermediate Modern Haskell

Artem Pelenitsyn
In reply to this post by Jacques Carette
Dear Jacques,

You may be interested in browsing through the table of contents (and maybe the actual contents) of the Haskell in Depth book by Vitaly Bragilevsky 
It will soon be out from Manning (currently finishing the preview phase called MEAP). It has a good selection of "advanced" topics (including ones you mentioned) supported by a set of interesting projects.

--
Kind regards,
Artem 

On Wed, Dec 16, 2020, 10:22 PM Jacques Carette <[hidden email]> wrote:

I will be teaching a second Haskell course next semester.  Let's assume that

Introducing functional programming

Getting started with Haskell and GHCi

Basic types and definitions

Designing and writing programs

Data types, tuples and lists

Programming with lists

Defining functions over lists

Playing the game: I/O in Haskell

Reasoning about programs

Generalization: patterns of computation

Higher-order functions

Developing higher-order programs

Overloading, type classes and type checking

Algebraic types


(i.e. the first chapters of Thompson's Haskell: the Craft of Functional Programming book is "beginner, classic Haskell".  The next few chapters, namely

Abstract data types

Lazy programming

Programming with monads

Domain-Specific Languages

Time and space behaviour


would be (re)done at the start of such a second course. The question for cafe is: what else? I will likely cover:
- Typeclassopedia
- finally tagless
- Template Haskell
- Optics
- GADTs
- recursion schemes


I should probably cover parser combinators, pretty-printing, cabal&stack. I know that http://dev.stephendiehl.com/hask/ gives me one heck of a smorgasbord of options, which is kind of a problem.


Things I know I will not cover:
- dependent types (if I was going to do that, I'd switch to Idris/Agda)
- concurrency (don't ask)


Jacques

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.