Write fromFunction