Non-deterministic operation

From: Michael Hanus <mh_at_informatik.uni-kiel.de>
Date: Mon, 07 Jun 2004 17:17:13 +0200

Dear Colleagues,

after some discussion with Tim Barbour and Wolfgang Lux
I'd like to propose the inclusion of a new basic
non-deterministic operation into the prelude of Curry.

The basic non-deterministic operation already used in a
couple of papers is a binary function that returns
either its first or right argument. Sergio already
used the infix operator (!) for this purpose, see
http://www.informatik.uni-kiel.de/~pakcs/lib/CDOC/Combinatorial.html
However, Wolfang pointed out that (!) is used for the array subscript
operator in MCC's and Haskell's Array libraries. Thus, we propose
the name (?) instead, i.e., we like to add the following definitions
to the standard prelude:

  infixl 0 ?

  (?) :: a -> a -> a
  x ? _ = x
  _ ? y = y


Thus, the expression "1 ? 2 ? 3" non-deterministically evaluates
to 1, 2, or 3. Nevertheless, we are open for other suggestions.

Best regards,

Michael


_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Di Jun 08 2004 - 08:55:01 CEST

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:06 CEST