[Haskell-cafe] EduHaskell

Chris Smith cdsmith at gmail.com
Sun Sep 24 01:22:31 UTC 2017


Hi!

For some of your ideas, let me suggest looking at CodeWorld, at
http://code.world.  I use it to teach middle school students, ages around
11 to 14.  It has some of the properties you are looking for.  Notably:

- No type classes are defined in the standard library.
- It offers a fully polymorphic equality operator, with no type class
constraint.  (This is implemented with runtime-aware logic specific to
GHCJS.)
- It avoids the need for many other type classes by simplifying the
available types.  For instance, there is one Number type so that math
operators are monomorphic.  Comparison operators only work on Number, and
there are separate monomorphic "Show"-like functions for different types.
- The prelude is uncurried, because accidentally partially applying a
function is another mistake that new programmers make that can lead to poor
error messages.
- A pre-compile step enforces that function application should use
parentheses around arguments.  CodeWorld is designed to be used with a
math-like notation -- such as "f(x)" -- rather than just "f x".
- There are post-processing rules that rewrite some error messages to be
beginner-friendly.

This is likely not *exactly* what you want.  For instance, there is no REPL
at all, and programs are designed to be run in a web browser panel (and
soon exported to Android) rather than used from the command line.  But it
might be a source of ideas for what is possible to accomplish on top of GHC.

Hope that helps,
Chris

On Sat, Sep 23, 2017 at 6:02 PM, erwig <erwig at oregonstate.edu> wrote:

> Dear Haskell aficionados,
>
> We will be using Haskell in an introductory course to computer science for
> college freshmen. From my past experience in using Haskell for students,
> the biggest hurdle and source of frustration is the type checker, or more
> precisely, the error messages generated. I see three major kinds of errors
> that get in the way of a smoother programming experience:
>
> * Errors resulting from overloading
> * Errors due to undefined type class instances (specifically, Eq and Show)
> * Errors in the context of parametric polymorphism
>
> While these problems are not unsurmountable, having to talk about these
> errors is a distraction from the major goal of explaining basics of
> (functional) programming. It would be great to have a Haskell compiler that
> offers the following features (and maybe others):
>
> * Type classes and overloading could be turned off
> * Eq and Show (and maybe Ord) instances would be automatically defined for
> any data type definition (when type classes are enabled)
>
> My questions are:
>
> (1) Does there exist a good solution to this problem already?
>
> Should one use Helium? I haven't checked lately, but it used to avoid type
> classes. This might have the disadvantage of having to switch to GHC in
> case one wants to use overloading. (I have used Helium in the past, and
> while I admire the effort, I am not sure it's the best option.)
>
> Are there versions of the Prelude available that accomplish some of this?
>
> (2) Are there other Haskellers out there who also want a simpler, more
> educationally suited version of GHCi?
>
> (3) If the answer to (1) is NO and to (2) is YES, is there any interest in
> forming a group for creating something like "EduHaskell"?
>
>
> I'd be grateful for any comments or suggestions!
>
>
> Thanks,
> Martin
>
> _______________________________________________
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170923/52171e96/attachment.html>


More information about the Haskell-Cafe mailing list