public static <A> F<Reader, F<IterV<Character, A>, IO<IterV<Character, A>>>> charChunkReader2() {
    final F<IterV<Character, A>, Boolean> isDone =
      new F<Iteratee.IterV<Character, A>, Boolean>() {
        final F<P2<A, Input<Character>>, P1<Boolean>> done = constant(P.p(true));
        final F<F<Input<Character>, IterV<Character, A>>, P1<Boolean>> cont = constant(P.p(false));

        @Override
        public Boolean f(final IterV<Character, A> i) {
          return i.fold(done, cont)._1();
        }
      };

    return new F<Reader, F<IterV<Character, A>, IO<IterV<Character, A>>>>() {
      @Override
      public F<IterV<Character, A>, IO<IterV<Character, A>>> f(final Reader r) {
        return new F<IterV<Character, A>, IO<IterV<Character, A>>>() {
          final F<P2<A, Input<Character>>, IterV<Character, A>> done = errorF("iteratee is done"); //$NON-NLS-1$

          @Override
          public IO<IterV<Character, A>> f(final IterV<Character, A> it) {
            // use loop instead of recursion because of missing TCO
            return new IO<Iteratee.IterV<Character, A>>() {
              @Override
              public IterV<Character, A> run() throws IOException {
                
                IterV<Character, A> i = it;
                while (!isDone.f(i)) {
                  char[] buffer = new char[DEFAULT_BUFFER_SIZE];
                  final int numRead = r.read(buffer);
                  if (numRead == -1) { return i; }
                  if(numRead < buffer.length) {
                    buffer = Arrays.copyOfRange(buffer, 0, numRead);
                  }
                  for(int c = 0; c < buffer.length; c++) {
                    final Input<Character> input = Input.el(buffer[c]);
                    final F<F<Input<Character>, IterV<Character, A>>, IterV<Character, A>> cont =
                        Function.<Input<Character>, IterV<Character, A>>apply(input);
                    i = i.fold(done, cont);
                  }
                }
                return i;
              }
            };
          }
        };
      }
    };
  }