Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
import Data.Set
|
||||
|
||||
a = fromList ["John", "Bob", "Mary", "Serena"]
|
||||
b = fromList ["Jim", "Mary", "John", "Bob"]
|
||||
|
||||
(-|-) :: Ord a => Set a -> Set a -> Set a
|
||||
x -|- y = (x \\ y) `union` (y \\ x)
|
||||
-- Equivalently: (x `union` y) \\ (x `intersect` y)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
*Main> a -|- b
|
||||
fromList ["Jim","Serena"]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
*Main> a \\ b
|
||||
fromList ["Serena"]
|
||||
|
||||
*Main> b \\ a
|
||||
fromList ["Jim"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue