<p>In what seems like a past life, I taught functional programming as part of a Programming Languages course. Most of the students had no exposure to functional programming but did have experience in languages like C++ or Java. Those language have a very different underlying mental model, but use lots of syntax. I thought it a mistake to drop both of those (mental model, concrete syntax) for a new language so chose Standard <a href="https://en.wikipedia.org/wiki/ML_(programming_language)" rel="nofollow noreferrer">ML</a> as the language, as it has the right mental model, but uses concrete syntax to help guide the user and reader. Lisp and its immediate variants use only abstract syntax (basically nested parentheses and indentation) in place of concrete syntax.</p>
<p>Modern functional programming languages that use concrete syntax are the ML variants, including OCaML, as well as Haskell, and Clojure. I'd suggest that you explore each of those, rather than LISP itself.</p>
<p>As a personal note, I found that I could program quite effectively in ML, but remain very unskilled in LISP.</p>
<p>You could, of course, also, teach in one of the more modern functional programming languages and periodically show how the same things are expressed in LISP with only abstract syntax. There is a close overlap in the concepts.</p>
<p>I have a friend who was a student of McCarthy (inventor of LISP) and who, himself, did some important work with the language and its libraries. He once told me that he could look at a LISP program and its indentation structure and know, pretty much, what it did. I was skeptical, but he was good enough generally to be believed when he said such things. I never got close to that level.</p>

CC BY-SA 4.0
2024-11-19T16:40:38.977Z
2024-11-20T13:49:12.797Z
2024-11-20T13:49:12.797Z
Buffy
<p>This is not an area where my expertise runs deep, but it seems to me that you want a functional language that supports types, and also works well for program verification.  On that basis alone, I'd steer clear of LISP/Scheme, as it does you no favors when studying types.  My understanding is that OCaml and Haskell both have strong type systems, and also work well for program verification, so I would steer strongly towards something of that ilk.</p>
<p>Given the focus on functors as well, I might head to OCaml, since my understanding is that it makes functors more obvious and explicit than Haskell.</p>
<p>Again, I am no authority on this topic, but OCaml seems like a strong starting point to me for your learning goals.</p>

CC BY-SA 4.0
2024-11-18T12:00:19.153Z
Thank you. Please note that I have been informed students are particularly interested in learning LISP.
alper
CC BY-SA 4.0
2024-11-19T21:00:32.240Z
@alper They may be interested, but I'd avoid it given the rest of that curriculum list. I suspect they'd have a fair amount of difficulty with those concepts in that language.
Ben I.
CC BY-SA 4.0
2024-11-15T21:33:07.163Z
2024-11-15T21:33:07.163Z
Ben I.
<p>I took the following two courses when I was studying for an MSc in Software Engineering many years ago:</p>
<ul>
<li>Advanced Functional Programming</li>
<li>Formal Basis for Computation</li>
</ul>
<p>These were courses given to BSc Computer Science students at the same time (who had studied these subjects earlier in their studies).</p>
<p>The book we used for Advanced Functional Programming was <strong>Elements of Functional Programming</strong> by Chris Reade (who was our lecturer for both courses). We also used Standard ML as the programming language for examples and coursework and I do remember our lecturer not being very keen on using LISP (assuming my memory is serving me well), so I can confirm the information given in <a href="https://cseducators.stackexchange.com/a/8164/16225">another answer to your question</a>.</p>
<p>I cannot remember much about the Formal Basis for Computation course, but I do remember it was about Formal Methods and Z, however, I can no longer remember the book the course was based on.</p>
<p>Each course was based on their respective books and we really needed to learn no more than what was contained in the books.</p>
<p>I had a background in C++, Assembly Language, BASIC, and FORTRAN so these courses showed me a different way of thinking about programming.</p>

CC BY-SA 4.0
2024-11-22T11:12:54.673Z
2024-11-22T11:12:54.673Z
PeterJames
<p>I have been told to teach a <strong>Functional Programming and Verification</strong> course that specifies the following topics:</p>
<ul>
<li><strong>Correctness of imperative programs</strong>
<ul>
<li>Verification according to Floyd or Hoare</li>
<li>Termination</li>
<li>Procedures</li>
</ul>
</li>
<li><strong>Basic concepts of functional programming</strong>
<ul>
<li>Values, variables, functions</li>
<li>Data structures, pattern matching</li>
<li>Higher order functions</li>
<li>Polymorphic types</li>
<li>Programming in the large: Structures and Functors</li>
<li>Correctness of functional programs
<ul>
<li>Semantics of functional programs</li>
<li>Verification of functional programs</li>
</ul>
</li>
</ul>
</li>
</ul>
<h5>How can I teach Functional Programming and Verification?</h5>
<p>And in particular:</p>
<ul>
<li>Which programming language should I use for programming assignments?</li>
<li>Are there any suggested tools and resources?</li>
</ul>
<hr />
<p>The only course I have found online is: <a href="https://www21.in.tum.de/teaching/fpv/WS20/" rel="nofollow noreferrer">Functional Programming and Verification</a></p>

CC BY-SA 4.0
2024-11-15T14:07:04.870Z
How versed are you in FP and the topics listed?
Buffy
CC BY-SA 4.0
2024-11-15T14:30:01.727Z
I am not that versed/experienced in them :-( But I have 3 months to study.
alper
<programming><teaching-analogy><functional-programming>
How can I teach Functional Programming and Verification
# How can I teach Functional Programming and Verification

(Asked by: username_0 on 2024-11-15)

I have been told to teach a **Functional Programming and Verification** course that specifies the following topics:

* **Correctness of imperative programs**
  + Verification according to Floyd or Hoare
  + Termination
  + Procedures
* **Basic concepts of functional programming**
  + Values, variables, functions
  + Data structures, pattern matching
  + Higher order functions
  + Polymorphic types
  + Programming in the large: Structures and Functors
  + Correctness of functional programs
    - Semantics of functional programs
    - Verification of functional programs

##### How can I teach Functional Programming and Verification?

And in particular:

* Which programming language should I use for programming assignments?
* Are there any suggested tools and resources?

---

The only course I have found online is: [Functional Programming and Verification](https://www21.in.tum.de/teaching/fpv/WS20/)

**Tags:** programming, teaching-analogy, functional-programming

> **Comments:**
> **username_1**: How versed are you in FP and the topics listed?  
> **username_0**: I am not that versed/experienced in them :-( But I have 3 months to study.  

---

## 3 answers

### Answer by username_1 on 2024-11-19. Score: 3 | Accepted answer

In what seems like a past life, I taught functional programming as part of a Programming Languages course. Most of the students had no exposure to functional programming but did have experience in languages like C++ or Java. Those language have a very different underlying mental model, but use lots of syntax. I thought it a mistake to drop both of those (mental model, concrete syntax) for a new language so chose Standard [ML](https://en.wikipedia.org/wiki/ML_(programming_language)) as the language, as it has the right mental model, but uses concrete syntax to help guide the user and reader. Lisp and its immediate variants use only abstract syntax (basically nested parentheses and indentation) in place of concrete syntax.

Modern functional programming languages that use concrete syntax are the ML variants, including OCaML, as well as Haskell, and Clojure. I'd suggest that you explore each of those, rather than LISP itself.

As a personal note, I found that I could program quite effectively in ML, but remain very unskilled in LISP.

You could, of course, also, teach in one of the more modern functional programming languages and periodically show how the same things are expressed in LISP with only abstract syntax. There is a close overlap in the concepts.

I have a friend who was a student of McCarthy (inventor of LISP) and who, himself, did some important work with the language and its libraries. He once told me that he could look at a LISP program and its indentation structure and know, pretty much, what it did. I was skeptical, but he was good enough generally to be believed when he said such things. I never got close to that level.


---

### Answer by username_2 on 2024-11-15. Score: 3

This is not an area where my expertise runs deep, but it seems to me that you want a functional language that supports types, and also works well for program verification. On that basis alone, I'd steer clear of LISP/Scheme, as it does you no favors when studying types. My understanding is that OCaml and Haskell both have strong type systems, and also work well for program verification, so I would steer strongly towards something of that ilk.

Given the focus on functors as well, I might head to OCaml, since my understanding is that it makes functors more obvious and explicit than Haskell.

Again, I am no authority on this topic, but OCaml seems like a strong starting point to me for your learning goals.

> **Comments:**
> **username_0**: Thank you. Please note that I have been informed students are particularly interested in learning LISP.  
> **username_2**: @username_0 They may be interested, but I'd avoid it given the rest of that curriculum list. I suspect they'd have a fair amount of difficulty with those concepts in that language.  

---

### Answer by username_3 on 2024-11-22. Score: 2

I took the following two courses when I was studying for an MSc in Software Engineering many years ago:

* Advanced Functional Programming
* Formal Basis for Computation

These were courses given to BSc Computer Science students at the same time (who had studied these subjects earlier in their studies).

The book we used for Advanced Functional Programming was **Elements of Functional Programming** by Chris Reade (who was our lecturer for both courses). We also used Standard ML as the programming language for examples and coursework and I do remember our lecturer not being very keen on using LISP (assuming my memory is serving me well), so I can confirm the information given in [another answer to your question](https://cseducators.stackexchange.com/a/8164/16225).

I cannot remember much about the Formal Basis for Computation course, but I do remember it was about Formal Methods and Z, however, I can no longer remember the book the course was based on.

Each course was based on their respective books and we really needed to learn no more than what was contained in the books.

I had a background in C++, Assembly Language, BASIC, and FORTRAN so these courses showed me a different way of thinking about programming.


---

