code: function chainRec(typeRep) {
      return function(f) {
        return function(x) {
          return Z.chainRec (typeRep, step, x);
        };
        function step(next, done, x) {
          return Z.map (either (next) (done), f (x));
        }
      };
    }
docs: # chainRec :: ChainRec m => TypeRep m -> (a -> m (Either a b)) -> a -> m b . . Performs a [`chain`](#chain)-like computation with constant stack usage. . Similar to [`Z.chainRec`][], but curried and more convenient due to the . use of the Either type to indicate completion (via a Right). . . ```javascript . > S.chainRec (Array) . .            (s => s.length === 2 ? S.map (S.Right) ([s + '!', s + '?']) . .                                 : S.map (S.Left) ([s + 'o', s + 'n'])) . .            ('') . ['oo!', 'oo?', 'on!', 'on?', 'no!', 'no?', 'nn!', 'nn?'] . ```