monoidmap-0.0.1.9: Monoidal map type
Copyright© 2022–2025 Jonathan Knowles
LicenseApache-2.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.MonoidMap.Unsafe

Contents

Description

Provides unsafe operations for the MonoidMap type.

Synopsis

Construction

unsafeFromMap :: Map k v -> MonoidMap k v Source #

\(O(1)\). Unsafely constructs a MonoidMap from an ordinary Map.

Constructs a MonoidMap in constant time, without imposing the burden of a canonicalisation step to remove null values.

When applied to a given Map m, this function expects but does not check the following pre-condition:

all (not . null) m

Not satisfying this pre-condition will result in undefined behaviour.

See fromMap for a safe version of this function.