monad transformer for arrays