[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sections
Original-Via: uk.ac.nsf; Tue, 9 Oct 90 05:04:09 BST
Date: Tue, 9 Oct 90 15:56:59 NZS
From: E.Ireland@massey.ac.nz
To: haskell@cs.glasgow.ac.uk
Subject: Sections
Sender: haskell-request@cs.glasgow.ac.uk
Hi,
A simple question? Why were sections not included in Haskell? For
example, I would have liked to be able to write
(+ 9) for (\ x -> x + 9)
(9 +) for (\ x -> 9 + x)
I think I remember seeing sections in an early draft of the Haskell
report, but they do not appear in version 1, so I suppose my question
becomes "why were sections removed"?
I realise that special consideration is required for unary -, however
I think it would be reasonable to state that (- 9) is not a section,
but rather the integer -9, and to state that all other cases to denote
sections.
As a related point, I believe that Hope allows a `?' to be used for
a form of currying, such that for some three argument function f:
f ? 1 2 denotes (\ x -> f x 1 2)
I wouldn't mind `?' being taken for this purpose, since `!' has
already been taken by module Prelude for array indexing, and so I
cannot use the pair of identifiers (`?', '!) for my CSP-like I/O
scheme anyway.
Perhaps these items could be considered for Haskell 2. Comments please.
Evan Ireland (E.Ireland@massey.ac.nz),
School of Information Sciences, Massey University, Palmerston North, NZ.