[Haskell-cafe] Defining Haskell using "arrows"

Andy Elvey andy.elvey at paradise.net.nz
Sat Nov 6 13:28:50 EST 2004

Hi all - 
   I'm a first-timer here, and am *very* much attracted by Haskell's elegance 
and power ... :-)  
  I have only poked around briefly with Haskell so far (at the "hello world" 
level).  One thing that I have come across, and which really got me thinking, 
was the page on the Haskell website about "arrows".  They really seem to take 
elegance and the "generic-ness" of algorithms to a new level.  
  I was thinking - arrows are a relatively recent concept.  Haskell's grammar 
(as defined in the Haskell report) has now been around for quite some time. 
So - I thought "what if?"  What if Haskell were to be defined (er, 
*re*-defined) in terms of arrows?  In other words, what if it were possible 
to start totally "from scratch", re-defining Haskell's grammar using arrows? 
(and preferably, *only* arrows ... ). 
  This would presumably involve somehow coding up the arrows first, and then 
(haivng got them), using them to create/define the rest of the language. 
  My reason for suggesting this - simply to see if it were possible to do a 
very small (but still quite comprehensive) Haskell implementation. Small 
meaning maybe 2-3 MB or so ...  As an interesting "benchmark" of this, the 
Rebol language (though proprietary - sigh!) - comes in at 0.5 Mb or so, 
including a GUI.  So, "very small but very powerful" is possible (although 
undoubtedly pretty difficult ... ) 
  As a Haskell newbie, I have to defer to everyone else on this list (in terms 
of my Haskell ability), but just thought I'd post this idea anyway.  I was 
thinking " I wonder if anyone has thought of this? ....... " .  
  Arrows seem to be a recent "add-on", as it were, so I thought  -given their 
power and flexibility, why not turn things totally around, and put them at 
the *very core* of the language, using them to define the language itself.  
  Anyway, I'm keen to hear people's thoughts on this!  Very many thanks in 
advance ...  :-) 
  - Andy 

More information about the Haskell-Cafe mailing list