Skip to content

Instantly share code, notes, and snippets.

@hmaurer
Forked from joneshf/a3gis.purs
Last active August 29, 2015 14:13
Show Gist options
  • Save hmaurer/0ef87815f37b03fb3206 to your computer and use it in GitHub Desktop.
Save hmaurer/0ef87815f37b03fb3206 to your computer and use it in GitHub Desktop.
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