Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fO {k = 996} -- strange output #95

Closed
zenon opened this issue Nov 24, 2012 · 4 comments
Closed

fO {k = 996} -- strange output #95

zenon opened this issue Nov 24, 2012 · 4 comments

Comments

@zenon
Copy link

zenon commented Nov 24, 2012

If I type, e.g. in the REPL, fO {k = 996}, the output contains some strange items:

... (S (boolElim (Builtins.!>#@Builtins.Ord$[Int] 1 0 (boolElim (intToBool (prim__eqInt 1 0)) EQ (boolElim (intToBool (prim__ltInt 1 0)) Builtins.LT Builtins.GT))) (S O) O) ...

Until 995 it is fine :)

Thank you, and kind regards. Zenon

@edwinb
Copy link
Contributor

edwinb commented Nov 24, 2012

Indeed - that's because there is a built in limit on how deeply the REPL will evaluate recursive functions, and you just happen to have hit it…

Edwin.

On 24 Nov 2012, at 17:08, Falko notifications@github.com wrote:

If I type, e.g. in the REPL, fO {k = 996}, the output contains some strange items:

... (S (boolElim (Builtins.!>#@Builtins.Ord$[Int] 1 0 (boolElim (intToBool (prim__eqInt 1 0)) EQ (boolElim (intToBool (prim__ltInt 1 0)) Builtins.LT Builtins.GT))) (S O) O) ...

Until 995 it is fine :)

Thank you, and kind regards. Zenon


Reply to this email directly or view it on GitHub.

@zenon
Copy link
Author

zenon commented Nov 24, 2012

So its a feature then?

@edwinb
Copy link
Contributor

edwinb commented Nov 25, 2012

Not really a feature, though the behaviour is intentional - it is left over from before the totality checker could decide for itself whether something was guaranteed to terminate. It should only behave like this on expressions that aren't known to terminate - so I will fix it now that the totality checker is more reliable.

@david-christiansen
Copy link
Contributor

As far as I can tell, this issue has been fixed. In latest master:

Idris> fO {k=996}
fO : Fin 997
Idris> fO {k=2000}
fO : Fin 2001

@edwinb edwinb closed this as completed Jul 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants