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,11 +58,10 @@ portTypes rules expr =
|
|||
|
||||
T.Var _ -> err "free type variables"
|
||||
|
||||
T.Lambda t1 t2 ->
|
||||
T.Lambda _ _ ->
|
||||
case direction of
|
||||
In -> err "functions"
|
||||
Out | firstOrder -> do isValid False direction name t1
|
||||
valid t2
|
||||
Out | firstOrder -> mapM_ (isValid False direction name) (T.collectLambdas tipe)
|
||||
| otherwise -> err "higher-order functions"
|
||||
|
||||
T.Record _ (Just _) -> err "extended records with free type variables"
|
||||
|
|
Loading…
Reference in a new issue