Stream: beginners

Topic: recursive alias


view this post on Zulip Fabian Schmalzried (Mar 11 2023 at 13:54):

I just tried something recursive and noticed the following:

The following checks:
LinkedList a : [ Nil, Cons ({ value: a, next: (LinkedList a)})]

But this does not check with a "cyclic alias" error:

LinkedList a : [ Nil, Cons (Node a)]

Node a : { value: a, next: (LinkedList a)}

Is this a bug, or is my understanding wrong?

view this post on Zulip Brendan Hansknecht (Mar 11 2023 at 14:54):

I think bug. Could you file something on GitHub?

view this post on Zulip Brendan Hansknecht (Mar 11 2023 at 14:55):

I think current roc has some limitations.

view this post on Zulip Ayaz Hafiz (Mar 11 2023 at 15:04):

this is a known bug. unfortunately it is unlikely to be fixed soon. You can workaround it by inlining either “Node” or “LinkedList” into the other


Last updated: Jul 05 2025 at 12:14 UTC