elm-physics icon indicating copy to clipboard operation
elm-physics copied to clipboard

Body.map

Open adauguet opened this issue 4 years ago • 1 comments

Would it make sense to have a map : (a -> b) -> Body a -> Body b function?

Inspiration comes from classic TEA, Html.map, Cmd.map, etc.

I would like to define some bodies outside the main module but it is hard because there are bind by the same data.

It looks trivial to implement, but can only be done at package level since the Body type is opaque.

adauguet avatar Oct 06 '21 14:10 adauguet

It could also allow sharing some bodies code between packages.

adauguet avatar Oct 06 '21 14:10 adauguet