Add an option to evaluate a result strictly (Eval with lazy semantics, then force evaluation)
Closed this issue · 0 comments
kmels commented
dart-haskell -f $FILE -e $FUN_NAME -strict
should force the evaluation of $FUN_NAME (don't return thunks)
Example without -strict:
dart-haskell -f examples/interpreter/Lists.hs -e first5nats
> [Left Thunk(exp=xanG),Left Thunk(exp=App(App(take1anP,App(App(App(appt(-,aaqzz),$dNumaqB),nanE),App(App(appt(fromInteger,aaqzz),$dNumaqB),1))),xs1anH))]
With -strict, visible should be:
dart-haskell -f examples/interpreter/Lists.hs -e first5nats -strict
> [1,2,3,4,5]