From 80c0696e2259b0558c6c64204ff697ed545edec2 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Sat, 4 Feb 2017 15:12:44 +0100 Subject: [PATCH] test: use internal map function in place of Z.map --- test/chainRec.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/chainRec.js b/test/chainRec.js index 296e2ef0..0759fd6d 100644 --- a/test/chainRec.js +++ b/test/chainRec.js @@ -1,10 +1,9 @@ 'use strict'; -var Z = require('sanctuary-type-classes'); - var S = require('..'); var eq = require('./internal/eq'); +var map = require('./internal/map'); test('chainRec', function() { @@ -14,15 +13,15 @@ test('chainRec', function() { eq(S.chainRec.toString(), 'chainRec :: ChainRec m => TypeRep m -> (a -> m (Either a b)) -> a -> m b'); function permute(s) { - return s.length === 2 ? Z.map(S.Right, [s + '!', s + '?']) - : Z.map(S.Left, [s + 'o', s + 'n']); + return s.length === 2 ? map(S.Right)([s + '!', s + '?']) + : map(S.Left)([s + 'o', s + 'n']); } eq(S.chainRec(Array, permute, ''), ['oo!', 'oo?', 'on!', 'on?', 'no!', 'no?', 'nn!', 'nn?']); function stepper(n) { - return n === 3000 ? Z.map(S.Right, function(env) { return n + env.inc; }) - : Z.map(S.Left, function(env) { return n + env.step; }); + return n === 3000 ? map(S.Right)(function(env) { return n + env.inc; }) + : map(S.Left)(function(env) { return n + env.step; }); } eq(S.chainRec(Function, stepper, 0)({step: 2, inc: 100}), 3100);