Skip to content

Instantly share code, notes, and snippets.

@t3chnoboy
Created March 29, 2014 18:35
Show Gist options
  • Select an option

  • Save t3chnoboy/9859920 to your computer and use it in GitHub Desktop.

Select an option

Save t3chnoboy/9859920 to your computer and use it in GitHub Desktop.
Haskell unicode symbols
( (∈), (∋), (∉), (∌)
, (∅)
, (∪), (∖), (∆), (∩)
{-|
(∈) = 'member'
U+2208, ELEMENT OF
-}
(∈) ∷ Int → IntMap α → Bool
(∈) = member
{-# INLINE (∈) #-}
{-|
(∋) = 'flip' (∈)
U+220B, CONTAINS AS MEMBER
-}
(∋) ∷ IntMap α → Int → Bool
(∋) = flip (∈)
{-# INLINE (∋) #-}
{-|
(∉) = 'notMember'
U+2209, NOT AN ELEMENT OF
-}
(∉) ∷ Int → IntMap α → Bool
(∉) = notMember
{-# INLINE (∉) #-}
{-|
(∌) = 'flip' (∉)
U+220C, DOES NOT CONTAIN AS MEMBER
-}
(∌) ∷ IntMap α → Int → Bool
(∌) = flip (∉)
{-# INLINE (∌) #-}
{-|
(∅) = 'empty'
U+2205, EMPTY SET
-}
(∅) ∷ IntMap α
(∅) = empty
{-# INLINE (∅) #-}
{-|
(∪) = 'union'
U+222A, UNION
-}
(∪) ∷ IntMap α → IntMap α → IntMap α
(∪) = union
{-# INLINE (∪) #-}
{-|
(∖) = 'difference'
U+2216, SET MINUS
-}
(∖) ∷ IntMap α → IntMap β → IntMap α
(∖) = difference
{-# INLINE (∖) #-}
{-|
Symmetric difference
a ∆ b = (a ∖ b) ∪ (b ∖ a)
U+2206, INCREMENT
-}
(∆) ∷ IntMap α → IntMap α → IntMap α
a ∆ b = (a ∖ b) ∪ (b ∖ a)
{-# INLINE (∆) #-}
{-|
(∩) = 'intersection'
U+2229, INTERSECTION
-}
(∩) ∷ IntMap α → IntMap β → IntMap α
(∩) = intersection
{-# INLINE (∩) #-}
U+2208, ELEMENT OF
-}
(∈) ∷ Int → IntSet → Bool
(∈) = member
{-# INLINE (∈) #-}
{-|
(∋) = 'flip' (∈)
U+220B, CONTAINS AS MEMBER
-}
(∋) ∷ IntSet → Int → Bool
(∋) = flip (∈)
{-# INLINE (∋) #-}
{-|
(∉) = 'notMember'
U+2209, NOT AN ELEMENT OF
-}
(∉) ∷ Int → IntSet → Bool
(∉) = notMember
{-# INLINE (∉) #-}
{-|
(∌) = 'flip' (∉)
U+220C, DOES NOT CONTAIN AS MEMBER
-}
(∌) ∷ IntSet → Int → Bool
(∌) = flip (∉)
{-# INLINE (∌) #-}
{-|
(∅) = 'empty'
U+2205, EMPTY SET
-}
(∅) ∷ IntSet
(∅) = empty
{-# INLINE (∅) #-}
{-|
(∪) = 'union'
U+222A, UNION
-}
(∪) ∷ IntSet → IntSet → IntSet
(∪) = union
{-# INLINE (∪) #-}
{-|
(∖) = 'difference'
U+2216, SET MINUS
-}
(∖) ∷ IntSet → IntSet → IntSet
(∖) = difference
{-# INLINE (∖) #-}
{-|
Symmetric difference
a ∆ b = (a ∖ b) ∪ (b ∖ a)
U+2206, INCREMENT
-}
(∆) ∷ IntSet → IntSet → IntSet
a ∆ b = (a ∖ b) ∪ (b ∖ a)
{-# INLINE (∆) #-}
{-|
(∩) = 'intersection'
U+2229, INTERSECTION
-}
(∩) ∷ IntSet → IntSet → IntSet
(∩) = intersection
{-# INLINE (∩) #-}
{-|
(⊆) = 'isSubsetOf'
U+2286, SUBSET OF OR EQUAL TO
-}
(⊆) ∷ IntSet → IntSet → Bool
(⊆) = isSubsetOf
{-# INLINE (⊆) #-}
{-|
(⊇) = 'flip' (⊆)
U+2287, SUPERSET OF OR EQUAL TO
-}
(⊇) ∷ IntSet → IntSet → Bool
(⊇) = flip (⊆)
{-# INLINE (⊇) #-}
{-|
a ⊈ b = (a ≢ b) ∧ (a ⊄ b)
U+2288, NEITHER A SUBSET OF NOR EQUAL TO
-}
(⊈) ∷ IntSet → IntSet → Bool
a ⊈ b = (a ≢ b) ∧ (a ⊄ b)
{-# INLINE (⊈) #-}
{-|
a ⊉ b = (a ≢ b) ∧ (a ⊅ b)
U+2289, NEITHER A SUPERSET OF NOR EQUAL TO
-}
(⊉) ∷ IntSet → IntSet → Bool
a ⊉ b = (a ≢ b) ∧ (a ⊅ b)
{-# INLINE (⊉) #-}
{-|
(⊂) = 'isProperSubsetOf'
U+2282, SUBSET OF
-}
(⊂) ∷ IntSet → IntSet → Bool
(⊂) = isProperSubsetOf
{-# INLINE (⊂) #-}
{-|
(⊃) = 'flip' (⊂)
U+2283, SUPERSET OF
-}
(⊃) ∷ IntSet → IntSet → Bool
(⊃) = flip (⊂)
{-# INLINE (⊃) #-}
{-|
a ⊄ b = 'not' (a ⊂ b)
U+2284, NOT A SUBSET OF
-}
(⊄) ∷ IntSet → IntSet → Bool
a ⊄ b = not (a ⊂ b)
{-# INLINE (⊄) #-}
{-|
a ⊅ b = 'not' (a ⊃ b)
U+2285, NOT A SUPERSET OF
-}
(⊅) ∷ IntSet → IntSet → Bool
a ⊅ b = not (a ⊃ b)
{-# INLINE (⊅) #-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment