unordered-containers-0.2.20.1: Efficient hashing-based container types

Safe Haskell | None
Language | Haskell2010

Data.HashMap.Internal.Debug

Description

# WARNING

This module is considered internal.

The Package Versioning Policy does not apply.

The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.

Authors importing this module are expected to track development closely.

# Description

Debugging utilities for `HashMap`s.

Synopsis

- valid :: Hashable k => HashMap k v -> Validity k
- data Validity k
  - = Invalid (Error k) SubHashPath
  - | Valid
- data Error k
  - = INV1_internal_Empty
  - | INV2_Bitmap_unexpected_1_bits !Bitmap
  - | INV3_bad_BitmapIndexed_size !Int
  - | INV4_bitmap_array_size_mismatch !Bitmap !Int
  - | INV5_BitmapIndexed_invalid_single_subtree
  - | INV6_misplaced_hash !Hash
  - | INV7_key_hash_mismatch k !Hash
  - | INV8_bad_Full_size !Int
  - | INV9_Collision_size !Int
  - | INV10_Collision_duplicate_key k !Hash
- type SubHash = Word
- data SubHashPath

# Documentation

valid :: Hashable k => HashMap k v -> Validity k Source #

data Validity k Source #

Constructors

Invalid (Error k) SubHashPath |
Valid |

#### Instances

Instances details

Monoid (Validity k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods mempty :: Validity k Source # mappend :: Validity k -> Validity k -> Validity k Source # mconcat :: [Validity k] -> Validity k Source #
Semigroup (Validity k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods (<>) :: Validity k -> Validity k -> Validity k Source # sconcat :: NonEmpty (Validity k) -> Validity k Source # stimes :: Integral b => b -> Validity k -> Validity k Source #
Show k => Show (Validity k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods showsPrec :: Int -> Validity k -> ShowS Source # show :: Validity k -> String Source # showList :: [Validity k] -> ShowS Source #
Eq k => Eq (Validity k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods (==) :: Validity k -> Validity k -> Bool Source # (/=) :: Validity k -> Validity k -> Bool Source #

data Error k Source #

An error corresponding to a broken invariant.

See `HashMap` for the documentation of the invariants.

Constructors

INV1_internal_Empty |
INV2_Bitmap_unexpected_1_bits !Bitmap |
INV3_bad_BitmapIndexed_size !Int |
INV4_bitmap_array_size_mismatch !Bitmap !Int |
INV5_BitmapIndexed_invalid_single_subtree |
INV6_misplaced_hash !Hash |
INV7_key_hash_mismatch k !Hash |
INV8_bad_Full_size !Int |
INV9_Collision_size !Int |
INV10_Collision_duplicate_key k !Hash |

#### Instances

Instances details

Show k => Show (Error k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods showsPrec :: Int -> Error k -> ShowS Source # show :: Error k -> String Source # showList :: [Error k] -> ShowS Source #
Eq k => Eq (Error k) Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods (==) :: Error k -> Error k -> Bool Source # (/=) :: Error k -> Error k -> Bool Source #

type SubHash = Word Source #

A part of a `Hash` with `bitsPerSubkey` bits.

data SubHashPath Source #

#### Instances

Instances details

Show SubHashPath Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods showsPrec :: Int -> SubHashPath -> ShowS Source # show :: SubHashPath -> String Source # showList :: [SubHashPath] -> ShowS Source #
Eq SubHashPath Source # |
Instance details Defined in Data.HashMap.Internal.Debug Methods (==) :: SubHashPath -> SubHashPath -> Bool Source # (/=) :: SubHashPath -> SubHashPath -> Bool Source #