w0rm/elm-physics

Body.map

adauguet opened this issue · 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.

It could also allow sharing some bodies code between packages.