Commit 203c00b1 authored by ross's avatar ross
Browse files

[project @ 2005-03-15 11:59:36 by ross]

Fix (and test) for SourceForge bug 1161624: erroneous rejection of

	foo = proc x -> arr (\y -> y-1) -< x

Now open a new level for the left side of -<, so that variables bound
in the proc are illegal, but variables bound in the expression are OK.

Note that the levels gimmick doesn't really implement holes in the
scope: it rules out nasty obfuscations like

	foo x = proc x -> arr (\y -> x-1) -< x

Also added the same treatment to the head of a `form', where it was
missing.

(for STABLE)
parent b1e7bfe9
......@@ -4,6 +4,7 @@ test('arrowapply1', normal, compile, [''])
test('arrowapply2', normal, compile, [''])
test('arrowapply3', normal, compile, [''])
test('arrowapply4', normal, compile, [''])
test('arrowapply5', normal, compile, [''])
test('arrowcase1', normal, compile, [''])
test('arrowdo1', normal, compile, [''])
test('arrowdo2', normal, compile, [''])
......
{-# OPTIONS -farrows #-}
module ShouldCompile where
-- variables bound inside the left argument of -< should be in scope
import Control.Arrow
f :: (Num b, Arrow a) => a b b
f = proc x -> arr (\y -> y-1) -< x
g :: (Num b, Arrow a) => a b b
g = proc x -> (proc y -> returnA -< y-1) -< x
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment