roc/compiler/builtins/standard_library/Box.roc
2022-03-23 17:13:16 +01:00

11 lines
258 B
Text

box : a -> Box a
unbox : Box a -> a
# we'd need reset/reuse for box for this to be efficient
# that is currently not implemented
map : Box a, (a -> b) -> Box b
map = \boxed, transform =
boxed
|> Box.unbox
|> transform
|> Box.box