Under this question, leftarounabout left a pretty clear explanation why we actually consider ArrowApply
and Monad
equivalent.
The idea is in not losing any information during round trips:
arrAsFunction :: Arrow k => k x y -> (x -> k () y)
arrAsFunction φ x = φ <<< arr (const x)
retrieveArrowFromFunction :: ∀ k x y .
ArrowApply k => (x -> k () y) -> k x y
retrieveArrowFromFunction f = arr f' >>> app
where f' :: x -> (k () y, ())
f' x = (f x, ())
I (probably) understand, why we started speaking of (x -> k () y)
- a wrapped \ ~() -> ...
does not make a great arrow, therefore we would like it to depend on the environment.
My question is: how can we be sure that the following function does not exist:
retrieveArrowFromFunction :: ∀ k x y .
Arrow k => (x -> k () y) -> k x y
I tried coming up with some arrows which would mess up the Curry-Howard correspondence for the type. Is this a proper lead? Could it be done more easily?