-- to bother to check the number of args
--------------
- go_sel [arg] = exprIsTrivial arg -- I'm experimenting with making record selection
+ go_sel [arg] = exprIsCheap arg -- I'm experimenting with making record selection
go_sel other = False -- look cheap, so we will substitute it inside a
-- lambda. Particularly for dictionary field selection.
-- BUT: Take care with (sel d x)! The (sel d) might be cheap, but
soon,
without raising an exception,
without causing a side effect (e.g. writing a mutable variable)
+
+NB: if exprIsHNF e, then exprOkForSpecuation e
+
E.G.
let x = case y# +# 1# of { r# -> I# r# }
in E
-- There is at least one value argument
app_is_value (Var fun) args
- | isDataConWorkId fun -- Constructor apps are values
+ | isDataConWorkId fun -- Constructor apps are values
|| idArity fun > valArgCount args -- Under-applied function
= check_args (idType fun) args
app_is_value (App f a) as = app_is_value f (a:as)