Last active
March 5, 2017 14:39
-
-
Save joneshf/5841de0d567202e1c80e to your computer and use it in GitHub Desktop.
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
module A3gis where | |
import Data.Traversable | |
import Data.Map | |
import Data.Maybe | |
foo :: forall k v. (Eq v, Ord k) => Map k v -> Map k v -> Maybe (Map k v) | |
foo m1 m2 = sequence $ unionWith go (Just <$> m1) (Just <$> m2) | |
where | |
go x y = if x == y then x else Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment