Skip to content

Commit

Permalink
[#34,#30] Added a hack to get unitFn working in context
Browse files Browse the repository at this point in the history
See #34 for all the information about why this hack is necessary

Closes #30
  • Loading branch information
JustusAdam committed Feb 22, 2019
1 parent 722ba8f commit dd23e84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/Ohua/ALang/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ findLonelyLiterals =
f@Apply {} ->
const $
if areAllLits args
then args
then take 1 $
-- HACK see #34
filter
(\case
Lit (FunRefLit _) -> False
_ -> True)
args
-- We could also return `[]` in the else branch, because the
-- expression should be normalized, but this is cleaner
else args >>= findLonelyLiterals
Expand Down

0 comments on commit dd23e84

Please sign in to comment.