Functional coverage tree: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
→‎{{header|JavaScript}}: Added a JavaScript draft.
Hout (talk | contribs)
Line 542:
 
{{Trans|Haskell}}
{{Trans|Python}}
<lang javascript>(() => {
'use strict';
Line 724 ⟶ 725:
root: v, // any type of value (consistent across tree)
nest: xs || []
});
 
// Nothing :: Maybe a
const Nothing = () => ({
type: 'Maybe',
Nothing: true,
});
 
// Right :: b -> Either a b
const Right = x => ({
type: 'Either',
Right: x
});