Mapping fpinscala to Swift lang