我目前正在尝试模仿enyo.Popup的行为。我在github上看过,但很难理解它。
尤其是这是我遇到麻烦的代码:
handlers: {
//...
onRequestShow: "requestShow",
onRequestHide: "requestHide"
},
//* @public
events: {
//* Fires after the popup is shown.
onShow: "",
//* Fires after the popup is hidden.
on
因此,我计划使用一个类来进行简单的JSON序列化。
public class Thing {
private int field1;
private String some_other_field;
private List<SubType> subs;
private list<AnotherType> another;
public String toJson() {
Gson g = new Gson();
g.toJson(this);
}
}
因此,文档显示,如果您想序列化泛型类型,则需要指定一个TypeToken:
class Hello a where
method1 :: a -> String
method1 a = "Hello"
data World s = World [s]
instance Hello a => World a where
method1 a = "Hello World"
当我将代码加载到Haskell中时,我得到了以下错误:
“method1”不是类“World”的(visible)方法
有人能告诉我错误在哪里吗?
谢谢。