export const simpleMemoize = < A , R > ( fn ) : ( ( arg : A ) => R ) => { let lastResult = null ; let lastArg = null ; return ( arg ) => { if ( arg === lastArg ) { return lastResult as R ; } lastArg = arg ; return ( lastResult = fn ( arg ) ) ; } ; } ;