Closed davidchambers closed 5 years ago
This pull request brings $.NullaryType into line with $.UnaryType and $.BinaryType, which as of #244 do not type-check predicate functions.
$.NullaryType
$.UnaryType
$.BinaryType
On my computer, the following program takes about 40 seconds to run on this branch compared with about 140 seconds on master:
master
'use strict'; const $ = require ('.'); const a = $.TypeVariable ('a'); const zeros = []; for (let x = 0; x < 1e6; x += 1) zeros.push (0); $.create ({checkTypes: true, env: [$.Array ($.Unknown), $.NullaryType ('Zero') ('') ([]) (x => x === 0)]}) ('I') ({}) ([a, a]) (x => x) (zeros);
This pull request brings
$.NullaryType
into line with$.UnaryType
and$.BinaryType
, which as of #244 do not type-check predicate functions.On my computer, the following program takes about 40 seconds to run on this branch compared with about 140 seconds on
master
: