我想创建一个
TDictionary<string, class of TControl>
Run Code Online (Sandbox Code Playgroud)
- 正如您所看到的 - 保存字符串对和对TControl类定义的引用,以便能够在运行时调用字典元素上的Create方法.
我可以吗?
我得到a.responseXML的“未定义”,我也不知道为什么,因为a.responseText包含它,但是包含字符串。我发现responseType是一个空字符串,并且我知道responseXML对于类型很明智。
我做错了什么?
为什么之间的关系a,并b不能推断出?
class Vector a where
(<.>) :: Num b => a -> a -> b
data Vec2 a
= Vec2 (a, a)
deriving Show
instance Num a => Vector (Vec2 a) where
Vec2 (a, b) <.> Vec2 (c, d) = a * c + b * d
Run Code Online (Sandbox Code Playgroud)
我想有一个Vec2代数数据结构,其中组件可以是任何数字.