One use case for dynamic types is dynamic function resolution. We already have a typeclass based dynamic dispatch, but what if we could be even more generic? E.g. the find function that works for any Foldable. It's not a function from the Foldable type class, but we should be able to generate a dispatch table for it. Similarly for functions that require multiple constraints. Essentially, we need a satisfying :: [Constraint] -> [Type] function that finds all the types that could work, and use that to generat the dispatch table to be used at runtime.
One use case for dynamic types is dynamic function resolution. We already have a typeclass based dynamic dispatch, but what if we could be even more generic? E.g. the
findfunction that works for anyFoldable. It's not a function from theFoldabletype class, but we should be able to generate a dispatch table for it. Similarly for functions that require multiple constraints. Essentially, we need asatisfying :: [Constraint] -> [Type]function that finds all the types that could work, and use that to generat the dispatch table to be used at runtime.