flix / flix

The Flix Programming Language
https://flix.dev/
Other
2.14k stars 151 forks source link

Use regions and `MutList` in the implementation of `flatMap` on some data structures (e.g. `List`) #4226

Open magnus-madsen opened 2 years ago

magnus-madsen commented 2 years ago

@JonathanStarup Does this apply to all flatMaps or just some?

JonathanStarup commented 2 years ago

@JonathanStarup Does this apply to all flatMaps or just some?

the speed increase?

magnus-madsen commented 2 years ago

@JonathanStarup Does this apply to all flatMaps or just some?

the speed increase?

No, can all flatMaps be implemented this way?

JonathanStarup commented 2 years ago

Yes

No


In conclusion: We can do it for List and possibly Array. These same considerations apply to flatten. It seems no mutable structures have flatten/flatMap?