implementing lazy functional language