Section 10.16 of Purescript. For example, Phil Freeman shows an example of newtypewrapping a record:
newtype FormData = FormData
{ firstName :: String
, lastName :: String
, street :: String
, city :: String
, state :: String
, homePhone :: String
, cellPhone :: String
}
Then in section 10.18 he writes:
" FormData - , FormData, JSON.stringify, JSON. , newtypes , ."
, , psc, . data newtype,
newtype Author = Author { name :: String, interests :: Array String }
phil :: Author
phil = Author { name: "Phil", interests: ["Functional Programming", "JavaScript"] }
"use strict";
var Author = function (x) {
return x;
};
var phil = {
name: "Phil",
interests: [ "Functional Programming", "JavaScript" ]
};
module.exports = {
Author: Author,
phil: phil
};