I wonder how AI would have reacted to
exOr :: Bool -> Bool -> Bool
exOr = (/=)
or equivalently
exOr = (not .) . (==)
Thanks! It took me a minute to locate exercises: maybe they could be featured more prominently (shown in the outline in the sidebar for instance).
Using AI to check it is an interesting idea. Here's what I got for:
> 3.1 Give another version of the definition of ‘exclusive or’ which works informally like this: ‘exclusive or of x and y will be True if either x is True and y is False, or x is False and y is True’.
I put:
exOr :: Bool -> Bool -> Bool
exOr x y = (x && not y) || (not x && y)
AI said:> Great job! Your implementation of
exOris completely correct and accurately translates the English description given in the exercise. It's concise, readable, and handles all possible boolean inputs properly.> As a quick style and alternative thought for the future: while your approach using
&&,||, andnotis very standard, you might also consider how the inequality operator (/=) behaves withBoolvalues in Haskell. How does it compare to exclusive or?The first sentence is fine even if moughtfull (but I came to accept this shortcoming of the modern LLMs). The second seems to suggest something that the textbook didn't mean perhaps? In general, it may be useful to thing about the connection it mentions but I'm not sure it's a good time or place. But it's not bad.
Thanks again, and I already posted a bug report: https://github.com/simonjohnthompson/haskellcraft/issues/3
~ best, Artem
On Fri, Oct 16, 2026 at 1:14 PM Simon Thompson <S.J.Thompson@kent.ac.uk> wrote:
Sorry, I should have been clearer. The “interactive” feature is the AI-based feedback available on all the exercises. I’d welcome your feedback on how you find that works in practice.
Simon
London and South East University Group, a charity and company limited by guarantee registered in England (company number 00986729). Registered Office: Old Royal Naval College, Park Row, Greenwich, London SE10 9LS
Sent from my iPhone
On 16 Oct 2026, at 18:03, Artem Pelenitsyn <a.pelenitsyn@gmail.com> wrote:
Hey Simon,
This is great! Thank you for sharing it and for the generous gift of open-sourcing the book!
My mild confusion is around the word "interactive" in the announcement (the subject says "Interactive online text", and it's repeated in the text).Are there any means to interact with the text other than read it and watch the accompanying videos (which are great on their own, thank you for them!)?When I hear "interactive textbook", I (came to) expect quizzes or small coding exercises embedded inline or on a separate page linked from the text. Some examples:
- https://diveintosystems.org/exercises/section-1_2.html (a separate subsite from the actual textbook)
~ best, Artem
On Fri, Oct 16, 2026 at 5:28 AM Simon Thompson via Haskell-Cafe <haskell-cafe@haskell.org> wrote:
_______________________________________________Haskell the Craft of Functional Programming. Interactive online text
This is a substantially revised version of the third edition (2011) of Haskell: the Craft of Functional Programming bringing the book up to date with changes in Haskell and its infrastructure: implementations, editor support, discussion channels etc. More substantially it is now available online, and is freely available under a Creative Commons licence.
The book is also available as a PDF,
as part of the github repository for the text.
<haskellcraft.png>
The book is supported by a YouTube video lecture course: Introduction to Functional Programming.
<hqdefault.jpg>
Comments, and github issues and pull requests very welcome.
Enjoy!
Simon
Simon Thompson | Professor Emeritus of Logic and Computation | University of Kent, UK
Professor Emeritus of Computer Science | Eötvös Loránd University, Budapest
London and South East University Group, a charity and company limited by guarantee registered in England (company number 00986729). Registered Office: Old Royal Naval College, Park Row, Greenwich, London SE10 9LS
Haskell-Cafe mailing list -- haskell-cafe@haskell.org
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.
_______________________________________________ Haskell-Cafe mailing list -- haskell-cafe@haskell.org To (un)subscribe, modify options or view archives go to: Only members subscribed via the mailman list are allowed to post.
-- Matti Nykänen