Skip to content

Commit 20c9040

Browse files
committed
Fixed a bunch of documentation typos in 'Data.BitSet.Generic'
1 parent 26027b7 commit 20c9040

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/Data/BitSet/Generic.hs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
-- independent of container choice, the maximum number of elements in a
2626
-- bit set is bounded by @maxBound :: Int@.
2727

28+
{-# LANGUAGE BangPatterns #-}
2829
{-# LANGUAGE CPP #-}
30+
{-# LANGUAGE DeriveDataTypeable #-}
2931
{-# LANGUAGE GADTs #-}
30-
{-# LANGUAGE BangPatterns #-}
3132
{-# LANGUAGE NamedFieldPuns #-}
32-
{-# LANGUAGE DeriveDataTypeable #-}
3333

3434
module Data.BitSet.Generic
3535
(
@@ -92,16 +92,14 @@ import qualified Data.Foldable as Foldable
9292
import qualified Data.List as List
9393

9494
-- | A bit set with unspecified container type.
95-
data GBitSet c a =
96-
(Enum a, Bits c, Num c) =>
97-
BitSet { _n :: {-# UNPACK #-} !Int -- ^ Number of elements in the bit set.
95+
data GBitSet c a = (Enum a, Bits c, Num c) => BitSet
96+
{ _n :: {-# UNPACK #-} !Int -- ^ Number of elements in the bit set.
9897
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 708)
99-
, _bits :: {-# UNPACK #-} !c -- ^ Bit container.
98+
, _bits :: {-# UNPACK #-} !c -- ^ Bit container.
10099
#else
101-
, _bits :: !c -- ^ Bit container.
100+
, _bits :: !c -- ^ Bit container.
102101
#endif
103-
}
104-
deriving Typeable
102+
} deriving Typeable
105103

106104
instance Eq c => Eq (GBitSet c a) where
107105
BitSet { _n = n1, _bits = b1 } == BitSet { _n = n2, _bits = b2 } =
@@ -165,12 +163,12 @@ member :: (Enum a , Bits c) => a -> GBitSet c a -> Bool
165163
member x = (`testBit` fromEnum x) . _bits
166164
{-# INLINE member #-}
167165

168-
-- | /O(d)/. Ask whether the item is in the bit set.
166+
-- | /O(d)/. Ask whether the item is not in the bit set.
169167
notMember :: (Enum a, Bits c) => a -> GBitSet c a -> Bool
170168
notMember x = not . member x
171169
{-# INLINE notMember #-}
172170

173-
-- | /O(max(n, m))/. Is this a subset? (@s1 isSubsetOf s2@) tells whether
171+
-- | /O(max(n, m))/. Is this a subset? (@s1 `isSubsetOf` s2@) tells whether
174172
-- @s1@ is a subset of @s2@.
175173
isSubsetOf :: GBitSet c a -> GBitSet c a -> Bool
176174
isSubsetOf (BitSet { _n = n1, _bits = b1 }) (BitSet { _n = n2, _bits = b2 }) =

0 commit comments

Comments
 (0)