Skip to content

Commit

Permalink
sizing by evaluation, doesn't work because insufficiently lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
sfultong committed Jan 17, 2024
1 parent 7dae821 commit 627a97a
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 171 deletions.
3 changes: 2 additions & 1 deletion src/Telomare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,14 @@ unsizedRecursionWrapper urToken t r b =
fourthArgF = pure . LeftFrag . RightFrag . RightFrag . RightFrag $ EnvFrag
fifthArgF = pure . LeftFrag . RightFrag . RightFrag . RightFrag . RightFrag $ EnvFrag
abortToken = PairFrag ZeroFrag ZeroFrag
-- b is on the stack when this is called, so args are (i, (b, 0))
abrt = lamF (SetEnvFrag <$> (PairFrag (SetEnvFrag (PairFrag AbortFrag abortToken)) <$> appF secondArgF firstArgF))
applyF = SetEnvFrag $ RightFrag EnvFrag
env' = RightFrag (RightFrag (RightFrag EnvFrag))
-- takes (rf, (f', (x, env'))), executes f' with (x, env') and creates a new frame
rf = deferF . pure $ PairFrag (LeftFrag EnvFrag) (PairFrag (LeftFrag EnvFrag) (PairFrag (LeftFrag (RightFrag EnvFrag))
(PairFrag applyF env')))
-- construct the initial frame from f and x
-- construct the initial frame from f and x ((b, (rWrap, 0)) -> (rf, (rf, (f', (x, env')))))
frameSetup = (\ff a -> PairFrag ff (PairFrag ff (PairFrag (LeftFrag (LeftFrag (RightFrag EnvFrag)))
(PairFrag a (RightFrag (LeftFrag (RightFrag EnvFrag)))))))
<$> rf <*> abrt
Expand Down
Loading

0 comments on commit 627a97a

Please sign in to comment.