[Haskell-cafe] I think someone had a complicated program to use brackets for array indexing - is it possible to use a DSL for this?

Tikhon Jelvis tikhon at jelv.is
Tue Jun 2 00:52:41 UTC 2015

If you teach them about how operators are normal functions in Haskell,
using an operator to index into an array makes the indexing operation less
magical—a big pedagogical boon, in my view. The fewer special cases in the
language you're teaching, the better, and looking similar to other
languages is not a good reason for a special case.

Especially since the similarity could be misleading!)

On Mon, Jun 1, 2015 at 5:48 PM, <ok at cs.otago.ac.nz> wrote:

> > I'm a part time tutor even though I don't look Elizabethan
> >
> > I was trying to lower the learning curve for students
> Using square brackets for array indexing in Haskell
> would be more a case of putting a stumbling block in
> their way than lowering the learning curve.
> Fortran uses A(I), not A[I], and has for the last fifty-some
> years.  The official definition of Simula 67 uses A(I) as
> well, despite its predecessor Algol 60 using a[i].  COBOL
> uses A(I), and has done so nearly as long as Fortran.  PL/I
> (yes, it still exists) uses A(I), not A[I].  BASIC uses
> A(I), this is still so in Visual Basic.NET.  If memory
> serves me correctly, MINITAB uses parentheses, not brackets.
> Is a pattern beginning to emerge?
> Lying to the students by implicitly telling them "all programming
> languages use square brackets for array indexing" will be doing
> them no favour.  Even lying about Haskell is no kindness.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150601/d6dfbcae/attachment.html>

More information about the Haskell-Cafe mailing list