Re: Or-patterns

2000-12-06 Thread Marcin 'Qrczak' Kowalczyk

Mon, 04 Dec 2000 17:17:42 +0100, George Russell <[EMAIL PROTECTED]> pisze:

> Where you have variables in the patterns, you bind only the
> variables which appear in all the patterns, and you unify the
> types accordingly.

Or bind them all (otherwise there would be _ written) and get bottom
in case the matching subpattern did not bind the given variable.

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^  SYGNATURA ZASTÊPCZA
QRCZAK


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Or-patterns

2000-12-06 Thread Simon Peyton-Jones

Sensible suggestion

No technical problem, just one more thing to do.
If anyone feels inclined to implement it I'll gladly incorporate 
the fruits of their labours in the GHC code base.

Simon

| -Original Message-
| From: George Russell [mailto:[EMAIL PROTECTED]]
| Sent: 04 December 2000 16:18
| To: [EMAIL PROTECTED]
| Subject: Or-patterns
| 
| 
| Why not steal a good idea from Standard ML/New Jersey now and 
| again?  This has
| "Or-patterns" which allow you to match against a disjunction 
| of patterns,
| EG
| 
| fun sleepIn (Date.Sat | Date.Sun) = true
| |   sleepIn _ = false
| 
| Where you have variables in the patterns, you bind only the 
| variables which appear 
| in all the patterns, and you unify the types accordingly.
| 
| Of course you can do without this feature, but I feel it 
| shouldn't be too hard
| to implement and for me at least it would be occasionally useful.
| 
| ___
| Glasgow-haskell-users mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| 

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users