29 Mar
2013
29 Mar
'13
5:20 p.m.
Hi Jamie, On Thu, Mar 28, 2013 at 10:34:26PM +0000, Jamie F Olson wrote:
Thank you! I think the two strange things as an outsider particularly from more OO languages are that types aren't objects, and then the strangeness of the naming convention.
In C++ you could have something like: class JSObject { public: typedef std::map<std::string, JSValue> Map_t; static JSObject JSONObject(const Map_t& m); ... }; class JSValue { public: static JSValue JSNull(); static JSValue JSBool(bool b); static JSValue JSObject(const JSObject& obj); ... }; The data constructors of Haskell have some similarity to these constructor functions. Greetings, Daniel