|
205b posted:
|
# ¿ Aug 29, 2017 22:20 |
|
|
# ¿ Apr 28, 2024 20:31 |
|
205b posted:Is it a problem specifically because I'm trying to pattern match in getParents? Otherwise, I thought mutually dependent declarations were ok. I'm not sure what you're after but would it be enough to have a leaf that looks like this instead? code:
|
# ¿ Aug 30, 2017 19:43 |
|
205b posted:I did need a distinct value for each node, but it turned out I could get away with a singly-linked tree, so I went with that. Just trying to wrap my head around what I did wrong. I think I get it now! What you're saying is that let x = 0:y; y = 1:x in x doesn't give you two nodes pointing at each other, but a chain of infinitely many nodes. I hadn't noticed that it didn't consume any CPU in ghci, but I suspect it has to do with that the RTS can detect that something is wrong and stops executing. When I build and run your program it will fail with "project-exe: <<loop>>".
|
# ¿ Sep 1, 2017 08:15 |