Jump to content

Functional coverage tree: Difference between revisions

m
(→‎{{header|JavaScript}}: Added a JavaScript draft.)
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
});
 
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.