Note, however, that it is not difficult to implement the following, even
without circular references:

```
reader : Library -> Book -> Maybe Reader
borrowing : Library -> Reader -> List Book
checkOut : Reader -> Book -> Library -> Maybe Library
checkIn : Reader -> Book -> Library -> Library
```

On Thu, Mar 16, 2017 at 10:06 AM, 'Rupert Smith' via Elm Discuss <
[email protected]> wrote:

> I am guessing the answer is no.
>
> type alias Reader { borrowing : List Book }
> type alias Book { reader : Maybe Reader }
>
> newBob = { bob | borrowing = [ warAndPeace ] }
> newWarAndPeace = { warAndPeace | reader = Just newBob }
>
> but the book that bob is borrowing will not have the link back to himself,
> as it was only added to the new version.
>
> Is the Elm heap therefore always cycle free?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to