Can create from PartialFunction[A, B]