Skip to content
New issue

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

Fix Semialign doc #194

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions semialign/src/Data/Semialign/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import qualified Data.IntMap as IntMap

#if !(MIN_VERSION_base(4,16,0))
import Data.Semigroup (Option (..))
#endif
#endif

import Data.These
import Data.These.Combinators
Expand All @@ -95,7 +95,7 @@ oops = error . ("Data.Align: internal error: " ++)
-- The laws of 'align' and 'zip' resemble lattice laws.
-- There is a plenty of laws, but they are simply satisfied.
--
-- And an addition property if @f@ is 'Foldable',
-- And an additional property if @f@ is 'Foldable',
-- which tries to enforce 'align'-feel:
-- neither values are duplicated nor lost.
--
Expand Down Expand Up @@ -139,16 +139,6 @@ oops = error . ("Data.Align: internal error: " ++)
-- ≡ mapMaybe justHere (toList (align x y))
-- @
--
--
-- And an addition property if @f@ is 'Foldable',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the sentence and the law are duplicated above.

-- which tries to enforce 'align'-feel:
-- neither values are duplicated nor lost.
--
-- @
-- toList x = toListOf (folded . here) (align x y)
-- = mapMaybe justHere (toList (align x y))
-- @
--
class Functor f => Semialign f where
-- | Analogous to @'zip'@, combines two structures by taking the union of
-- their shapes and using @'These'@ to hold the elements.
Expand Down
Loading