data Foo a = Foo a
我可以创建一个https://github.com/purescript/purescript-exists数组Exists
[(mkExists (Foo 0)), (mkExists (Foo "x"))]
如何使用类型类?我想得到["0", "x"]
getStrings :: Array (Exists Foo) -> Array String
getStrings list = map (runExists get) list
where
get :: forall a. Show a => Foo a -> String
get (Foo a) = show a
找不到类型类实例
Prelude.Show _0
实例头包含未知类型变量。考虑添加类型注释。