mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-24 08:47:19 +03:00
use more robust check for whether a binding is a function
This commit is contained in:
parent
8bb95293ae
commit
408c52a0a1
@ -51,9 +51,7 @@ minimize (Term.LetRecNamedAnnotatedTop' isTop ann bs e) =
|
||||
-- Here `foo` and `blah` are part of a cycle, but putting `foo`
|
||||
-- first at least lets the program run (though it has an infinite
|
||||
-- loop).
|
||||
cs = map (sortOn lambdasFirst) cs0 where
|
||||
lambdasFirst (_, Term.Lam' _) = 0 :: Int
|
||||
lambdasFirst _ = 1
|
||||
cs = sortOn (\(_,e) -> Term.arity e == 0) <$> cs0
|
||||
varAnnotations = Map.fromList ((\((a, v), _) -> (v, a)) <$> bs)
|
||||
annotationFor v = fromJust $ Map.lookup v varAnnotations
|
||||
annotatedVar v = (annotationFor v, v)
|
||||
|
Loading…
Reference in New Issue
Block a user