Correct check for outgoing higher order functions
A function can appear arbitrarily nested in a data structure, but that function cannot have more functions within it.
This commit is contained in:
parent
6c1d2d7bf3
commit
461abc0c6f
1 changed files with 3 additions and 4 deletions
|
@ -58,12 +58,11 @@ portTypes rules expr =
|
||||||
|
|
||||||
T.Var _ -> err "free type variables"
|
T.Var _ -> err "free type variables"
|
||||||
|
|
||||||
T.Lambda t1 t2 ->
|
T.Lambda _ _ ->
|
||||||
case direction of
|
case direction of
|
||||||
In -> err "functions"
|
In -> err "functions"
|
||||||
Out | firstOrder -> do isValid False direction name t1
|
Out | firstOrder -> mapM_ (isValid False direction name) (T.collectLambdas tipe)
|
||||||
valid t2
|
| otherwise -> err "higher-order functions"
|
||||||
| otherwise -> err "higher-order functions"
|
|
||||||
|
|
||||||
T.Record _ (Just _) -> err "extended records with free type variables"
|
T.Record _ (Just _) -> err "extended records with free type variables"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue