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

Re: Pattern Binding



Date: Thu, 28 May 1992 18:19:56 +0200
From: Kevin Hammond <kh@dcs.glasgow.ac.uk>
Sender: haskell-request@dcs.glasgow.ac.uk
To: brian@comp.vuw.ac.nz, norman@a.cs.okstate.edu
Cc: haskell@dcs.glasgow.ac.uk
Subject: Re: Pattern Binding

> An alternative to allow my second example to match on the third
> clause might be:
> [...]
> where (p',gi') = (p,gi) with variables renamed consistently.

Actually, it isn't necessary to rename in this translation (the
condition was left over from a previous version).  Apologies if this
confused anyone.

	p | g1 = e1
	    ...
	    gn = en

==	p = let t1 = case e1 of
                        x1@p | g1 -> x1
	                     | otherwise -> t2
	                _ -> t2
		...
		tn = case en of xn@p | gn -> xn
            in t1

Kevin