Mapping changes contained data without altering the computation s structural success or failure shape uses functor map for the successful channel and for the error channel Key principles of mapping preserves the carrier family its member form never leaves its own carrier type Success and error states are preserved A bare has a member to map across alternatives but takes no pipeline functor as it is data not a carrier Heterogeneous results inside or form a normalized Applying to a carrier with no error side such as or is ill formed When a side is uninhabited transformation is well formed but vacuous neither the member nor the pipeline form is reachable and the callback is not instantiated This applies to and on the value side and on the error side TIP Mathematical note functorial action on the initial object In implements the functorial map Its action on the initial object the uninhabited is forced rather than chosen for every object there is exactly one morphism so a callback out of carries no information Any two candidates denote the same morphism and the result is determined without consulting either Haskell spells this unique morphism Nothing can therefore be asked of the callback not even that it be callable the same vacuity The identity cluster describes for libfn transform transform_error auto mapping_values_and_errors > void fn expected<UserId fn copack_for<Missing IoError>> ex auto mapped_val ex | fn transform UserId return User static_assert std same_as<decltype mapped_val fn expected<User fn copack_for<IoError Missing>>> auto mapped_err ex | fn transform_error fn overload Missing return BadSyntax IoError e return e static_assert std same_as<decltype mapped_err fn expected<UserId fn copack_for<BadSyntax IoError>>> transform copack transform transform transform_error copack transform_error just choice copack<> optional<copack<>> expected<copack<> E> expected<T copack<>> libfn transform copack<> absurd Void > a or_else