Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c5e72241bb
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 57 lines (53 sloc) 1.617 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
{-# LANGUAGE TypeFamilies #-}

-----------------------------------------------------------------------------
-- |
-- Module : Data.EnumMapSet
-- Copyright : (c) Daan Leijen 2002
-- (c) Joachim Breitner 2011
-- (c) Matthew West 2012
-- License : BSD-style
-- Stability : experimental
-- Portability : Uses GHC extensions
--
-- Based on "Data.IntSet", this module provides multi-dimensional sets of
-- 'Enums'. Keys are built using ':&' and terminated with 'S'. They are stored
-- using 'Int's so 2 keys that 'Enum' to the same 'Int' value will overwrite
-- each other. The intension is that the 'Enum' types will actually be @newtype
-- 'Int'@s.
--
--
-- > newtype AppleID = AppleID Int
-- > newtype TreeID = TreeID Int
-- > type Orchard = EnumMapSet (TreeID :& S AppleID)
-- > applePresent = member (TreeID 4 :& K AppleID 32) orchard
--
-----------------------------------------------------------------------------

module Data.EnumMapSet (
            EnumMapSet,
            S(..), (:&)(..),
            -- * Query
            EMS.null,
            size,
            member,
            EMS.lookup,
            -- * Construction
            empty,
            singleton,
            insert,
            delete,
            -- * Combine
            union,
            difference,
            intersection,
            -- * Map
            EMS.map,
            -- * Folds
            EMS.foldr,
            -- * Lists
            toList,
            fromList,
            keys,
            -- * Min/Max
            findMin
) where

import Data.EnumMapSet.Base as EMS
Something went wrong with that request. Please try again.