Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot smap tuple #124

@joneshf

Description

@joneshf

Am I doing something wrong here, or is there an actual bug?

  ~  npm i jsverify
jsverify@0.6.2 node_modules/jsverify
├── rc4@0.1.5
├── lazy-seq@0.2.0
├── trampa@1.0.0
└── typify-parser@0.0.1
  ~  node
> var jsv = require('jsverify');
undefined
> jsv.pair(jsv.nat, jsv.bool).smap(function(x) { return x; }, function(x) { return x; })
{ generator: 
   { [Function]
     map: [Function: generatorProtoMap],
     flatmap: [Function: generatorProtoFlatMap],
     flatMap: [Function: generatorProtoFlatMap] },
  shrink: { [Function] smap: [Function: shrinkProtoIsoMap] },
  show: [Function: showDef],
  smap: [Function: arbitraryProtoSMap] }
> jsv.tuple([jsv.nat, jsv.bool]).smap(function(x) { return x; }, function(x) { return x; })
TypeError: undefined is not a function
    at Object.arbitraryProtoSMap [as smap] (/home/joneshf/node_modules/jsverify/lib/arbitraryBless.js:16:24)
    at repl:1:32
    at REPLServer.defaultEval (repl.js:132:27)
    at bound (domain.js:254:14)
    at REPLServer.runBound [as eval] (domain.js:267:12)
    at REPLServer.<anonymous> (repl.js:279:12)
    at REPLServer.emit (events.js:107:17)
    at REPLServer.Interface._onLine (readline.js:214:10)
    at REPLServer.Interface._line (readline.js:553:8)
    at REPLServer.Interface._ttyWrite (readline.js:830:14)
> jsv.tuple(jsv.nat, jsv.bool).smap(function(x) { return x; }, function(x) { return x; })
TypeError: undefined is not a function
    at Object.tuple (/home/joneshf/node_modules/jsverify/lib/arbitrary.js:74:15)
    at repl:1:5
    at REPLServer.defaultEval (repl.js:132:27)
    at bound (domain.js:254:14)
    at REPLServer.runBound [as eval] (domain.js:267:12)
    at REPLServer.<anonymous> (repl.js:279:12)
    at REPLServer.emit (events.js:107:17)
    at REPLServer.Interface._onLine (readline.js:214:10)
    at REPLServer.Interface._line (readline.js:553:8)
    at REPLServer.Interface._ttyWrite (readline.js:830:14)
> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions