Consider the following existential data model:
data Node a = Node a (Map TypeRep AnyNode) data AnyNode = forall a. Show a => AnyNode a
The rules for standard memory types have been explained previously . Now, what are the rules for existential types like AnyNode ?
Are there any optimization methods, for example. some workarounds using unsafeCoerce to escape an existential declaration? I ask about this because a type like Node will be placed in the cost center with intensive intensive lib memory, so the whole memory trace is why the dirtiest hacks are welcome.
optimization memory haskell
Nikita Volkov
source share