
6 Apr
2025
6 Apr
'25
12:07 p.m.
On Sun, Apr 06, 2025 at 12:27:04AM +0200, Zoran BoĆĄnjak wrote:
is it possible to write a type/kind level function that returns types of different kinds for different inputs. Either by using open/closed type families, a typeclass, extensions or any other type level magic.
The way you do this at the type level is with Dynamic: https://www.stackage.org/haddock/lts-23.17/base-4.19.2.0/Data-Dynamic.html#t... Or equivalently, something like data SomeTypeable where MkSomeTypeable :: Typeable a => a -> SomeTypeable So if you can work out how to promote one of those to the kind level then yes. If not then probably no! Tom