old_contents: // @flow
  import { HKT } from './HKT'
  import type { HKT2 } from './HKT'
  import { compose } from './Fun'
  import { id } from './Identity'
  import type { Monad } from './Monad'
  
  class IsReader {}
  
  export type ReaderV<R, A> = (r: R) => A;
  export type Reader<R, A> = HKT2<IsReader, R, A>;
  
  export function inj<R, A>(a: ReaderV<R, A>): Reader<R, A> {
    return ((a: any): Reader<R, A>)
  }
  
  export function prj<R, A>(fa: Reader<R, A>): ReaderV<R, A> {
    return ((fa: any): ReaderV<R, A>)
  }
  
  export const runReader = prj
  
  // reads the current context
  export function ask<R>(): Reader<R, R> {
    return inj(id)
  }
  
  // changes the value of the local context during the execution of the action `fa`
  export function local<R, A>(f: (r: R) => R, fa: Reader<R, A>): Reader<R, A> {
    return inj((r) => prj(fa)(f(r)))
  }
  
  export function map<R, A, B>(f: (a: A) => B, fa: Reader<R, A>): Reader<R, B> {
    return inj(compose(f, prj(fa)))
  }
  
  export function ap<R, A, B>(fab: Reader<R, (a: A) => B>, fa: Reader<R, A>): Reader<R, B> {
    return chain((f) => map(f, fa), fab) // <= derived
  }
  
  export function of<R, A>(a: A): Reader<R, A> {
    return inj(() => a)
  }
  
  export function chain<R, A, B>(f: (a: A) => Reader<R, B>, fa: Reader<R, A>): Reader<R, B> {
    return inj((r) => prj(f(prj(fa)(r)))(r))
  }
  
  if (false) { // eslint-disable-line
    ({
      map,
      ap,
      of,
      chain
    }: Monad<HKT<IsReader, *>>)
  }
  
new_contents: // @flow
  import { HKT } from './HKT'
  import type { HKT2 } from './HKT'
  import { compose } from './Fun'
  import { id } from './Identity'
  import type { Monad } from './Monad'
  
  class IsReader {}
  
  export type ReaderV<E, A> = (e: E) => A;
  export type Reader<E, A> = HKT2<IsReader, E, A>;
  
  export function inj<E, A>(a: ReaderV<E, A>): Reader<E, A> {
    return ((a: any): Reader<E, A>)
  }
  
  export function prj<E, A>(fa: Reader<E, A>): ReaderV<E, A> {
    return ((fa: any): ReaderV<E, A>)
  }
  
  export function runReader<E, A>(r: Reader<E, A>, e: E): A {
    return prj(r)(e)
  }
  
  // reads the current context
  export function ask<E>(): Reader<E, E> {
    return inj(id)
  }
  
  // changes the value of the local context during the execution of the action `fa`
  export function local<E, A>(f: (e: E) => E, fa: Reader<E, A>): Reader<E, A> {
    return inj((e) => runReader(fa, f(e)))
  }
  
  export function map<E, A, B>(f: (a: A) => B, fa: Reader<E, A>): Reader<E, B> {
    return inj(compose(f, prj(fa)))
  }
  
  export function ap<E, A, B>(fab: Reader<E, (a: A) => B>, fa: Reader<E, A>): Reader<E, B> {
    return chain((f) => map(f, fa), fab) // <= derived
  }
  
  export function of<E, A>(a: A): Reader<E, A> {
    return inj(() => a)
  }
  
  export function chain<E, A, B>(f: (a: A) => Reader<E, B>, fa: Reader<E, A>): Reader<E, B> {
    return inj((e) => prj(f(runReader(fa, e)))(e))
  }
  
  if (false) { // eslint-disable-line
    ({
      map,
      ap,
      of,
      chain
    }: Monad<HKT<IsReader, *>>)
  }
  
subject: change runReader signature