Last active
November 24, 2025 05:22
-
-
Save yurrriq/cb4f870d42057a10201a5c92b1c6a3fc to your computer and use it in GitHub Desktop.
AllEq.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| same :: (Functor f, Foldable f, Eq a) => Lens' s a -> f s -> Bool | |
| same l xs = allEq (view l <$> xs) | |
| allEq :: (Foldable t, Eq a) => t a -> Bool | |
| allEq xs = | |
| maybe True (\x -> getAll (foldMap (All . (== x)) xs)) | |
| $ getFirst (foldMap (First . Just) xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment