Homomorphic static analysis
Haskell Community [Unofficial]
May 31, 2026
Hi!
Nice question! And I need to admit that I don’t have a clear answer.
Just two thoughts:
- We wouldn’t have this issue if
Strongwas defined in terms of***instead offirst'andsecond'(and similarly forChoicedefined in terms of+++). - One potential solution to the issue is to have an intermediate step to a data structure like
data StrongData a b =
Fun :: (a -> b) -> Fun a b
Compose :: Fun b c -> Fun a b -> Fun c d
DiMap :: ...
First :: Fun a b -> Fun (a, c) (b, c)
Second :: Fun a b -> Fun (c, a) (c, b)
and every time you have a Compose (First ...) (Second ...) you optimize it to a parallel computation
Discussion in the ATmosphere