Copyright | © 2022–2025 Jonathan Knowles |
---|---|
License | Apache-2.0 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Provides unsafe operations for the MonoidMap
type.
Synopsis
- unsafeFromMap :: Map k v -> MonoidMap k v
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.