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

cycle detection #53

Open
vogler opened this issue May 23, 2017 · 0 comments
Open

cycle detection #53

vogler opened this issue May 23, 2017 · 0 comments

Comments

@vogler
Copy link

vogler commented May 23, 2017

Currently, cyclic values lead to a stack overflow. It would be nice to have some option (maybe just for debugging) to get some information where a cycle happened.

# type t = A of t | B [@@deriving to_yojson]
type t = A of t | B
val to_yojson : t -> Yojson.Safe.json = <fun>
# to_yojson B
- : Yojson.Safe.json = `List [`String "B"]
# let rec x = A x
val x : t = A <cycle>
# to_yojson x
Stack overflow during evaluation (looping recursion?).
Raised by primitive operation at file "//toplevel//", line 1, characters 0-42                                         Called from file "//toplevel//", line 1, characters 0-42
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

1 participant