[Haskell-cafe] Free theorem for `forall z. (A,z) -> (B,z)`?
Conal Elliott
conal at conal.net
Mon Jul 23 04:29:17 UTC 2018
Suppose `g :: forall z. (A,z) -> (B,z)`. Is it necessarily the case that `g
= first f` for some `f :: A -> B` (where `first f (a,b) = (f a, b)`),
perhaps as a free theorem for the type of `g`?
Note that `(A,)` and `(B,)` are functors and that `g` is a natural
transformation, so `g . fmap h == fmap h . g` for any `h :: u -> v`.
Equivalently, `g . second h == second h . g` (where `second h (a,b) = (a, h
b)`).
Thanks, -- Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180722/169496fa/attachment.html>
More information about the Haskell-Cafe
mailing list