[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Auxillary bindings again.



Date: 30 May 91 22:18
From: haskell-request@cs.glasgow.ac.uk
Sender: john peterson <peterson-john@cs.yale.edu>
To: haskell@cs.yale.edu
Subject: Auxillary bindings again.

Original-Via: uk.ac.nsf; Thu, 30 May 91 22:13:53 BST
Original-Sender: peterson-john@cs.yale.edu

Two issues:
 Syntax:
  Should we use `=' or something else?  I personally like `='; the
  chances of  confusing = with == without a type error or undefined
  variable seem minimal to me.  The only real problem would be
  `==' converted to `=' but this doesn't alarm me.  Any suggestions
  for an alternate syntax??
 Semantics:
  I'll strongly argue against the translation
     [ e | p = v ]   =   [ let p = v in e ]
  When pattern matching fails in p, the effect should be to resume the
  generator instead of cause an error.  To have <- and = fail in
  different ways would be a major mistake.  In programming, I've often
  needed the p <- [e] idiom but never found myself wishing for
  recursive bindings.  I won't argue against recursive bindings in
  addition to the p <- [e] style binding but I feel the need for 
     [ e | p = v ]   =   [ e | p <- [v]]
  has been demonstrated and that pattern match failure in = should be
  treated in the same manner as <-.

   John