We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The documentation of Zip says an instance of Zip must satisfy the following Distributivity laws.
Zip
-- The distributivity laws of Zip f align (zip xs ys) zs ≡ undistrThesePair <$> zip (align xs zs) (align ys zs) distrPairThese <$> zip (align xs ys) zs ≡ align (zip xs zs) (zip ys zs) zip (align xs ys) zs ≡ undistrPairThese <$> align (zip xs zs) (zip ys zs)
Each of the three equations must hold. Let me name each equation as Distr(1) - Distr(3).
Distr(1)
Distr(3)
-- Distr(1) align (zip xs ys) zs ≡ undistrThesePair <$> zip (align xs zs) (align ys zs) -- Distr(2) distrPairThese <$> zip (align xs ys) zs ≡ align (zip xs zs) (zip ys zs) -- Distr(3) zip (align xs ys) zs ≡ undistrPairThese <$> align (zip xs zs) (zip ys zs)
But only Distr(2) is necessary among three, if I'm not mistaken. The rest follows from Distr(2).
Distr(2)
Gist: https://gist.github.com/viercc/5b79efc5c3593a1b487a51f04c2bffca#file-distributive-simplify-md
I propose changes to the documentation stating this.
undistrPairThese . distrPairThese = id
undistrPairThese
distrPairThese
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The documentation of Zip says an instance of
Zip
must satisfy the following Distributivity laws.Each of the three equations must hold. Let me name each equation as
Distr(1)
-Distr(3)
.But only
Distr(2)
is necessary among three, if I'm not mistaken. The rest follows fromDistr(2)
.Gist: https://gist.github.com/viercc/5b79efc5c3593a1b487a51f04c2bffca#file-distributive-simplify-md
I propose changes to the documentation stating this.
Distr(1)
from the law and add a note that it follows fromDistr(2)
.Distr(3)
. It is a direct consequence ofundistrPairThese . distrPairThese = id
.undistrPairThese
that it is a left inverse (but not the inverse) ofdistrPairThese
.The text was updated successfully, but these errors were encountered: