{-# LANGUAGE NoImplicitPrelude, UnicodeSyntax #-} {-| Module : Data.Map.Unicode Copyright : 2009–2011 Roel van Dijk License : BSD3 (see the file LICENSE) Maintainer : Roel van Dijk -} module Data.Map.Unicode ( (∈), (∋), (∉), (∌) , (∅) , (∪), (∖), (∆), (∩) ) where ------------------------------------------------------------------------------- -- Imports ------------------------------------------------------------------------------- -- from base: import Data.Bool ( Bool ) import Data.Ord ( Ord ) import Data.Function ( flip ) -- from containers: import Data.Map ( Map , member, notMember , empty , union, difference, intersection ) ------------------------------------------------------------------------------- -- Fixities ------------------------------------------------------------------------------- infix 4 ∈ infix 4 ∋ infix 4 ∉ infix 4 ∌ infixl 6 ∪ infixr 6 ∩ infixl 9 ∖ infixl 9 ∆ ------------------------------------------------------------------------------- -- Symbols ------------------------------------------------------------------------------- {-| (∈) = 'member' U+2208, ELEMENT OF -} (∈) ∷ Ord k ⇒ k → Map k α → Bool (∈) = member {-# INLINE (∈) #-} {-| (∋) = 'flip' (∈) U+220B, CONTAINS AS MEMBER -} (∋) ∷ Ord k ⇒ Map k α → k → Bool (∋) = flip (∈) {-# INLINE (∋) #-} {-| (∉) = 'notMember' U+2209, NOT AN ELEMENT OF -} (∉) ∷ Ord k ⇒ k → Map k α → Bool (∉) = notMember {-# INLINE (∉) #-} {-| (∌) = 'flip' (∉) U+220C, DOES NOT CONTAIN AS MEMBER -} (∌) ∷ Ord k ⇒ Map k α → k → Bool (∌) = flip (∉) {-# INLINE (∌) #-} {-| (∅) = 'empty' U+2205, EMPTY SET -} (∅) ∷ Map k α (∅) = empty {-# INLINE (∅) #-} {-| (∪) = 'union' U+222A, UNION -} (∪) ∷ Ord k ⇒ Map k α → Map k α → Map k α (∪) = union {-# INLINE (∪) #-} {-| (∖) = 'difference' U+2216, SET MINUS -} (∖) ∷ Ord k ⇒ Map k α → Map k β → Map k α (∖) = difference {-# INLINE (∖) #-} {-| Symmetric difference a ∆ b = (a ∖ b) ∪ (b ∖ a) U+2206, INCREMENT -} (∆) ∷ Ord k ⇒ Map k α → Map k α → Map k α a ∆ b = (a ∖ b) ∪ (b ∖ a) {-# INLINE (∆) #-} {-| (∩) = 'intersection' U+2229, INTERSECTION -} (∩) ∷ Ord k ⇒ Map k α → Map k β → Map k α (∩) = intersection {-# INLINE (∩) #-}