Safe API wrappers for IntDict
s build and query operators
to prevent integer overflows with JavaScripts number type.
Prior to delegating to their 'unsafe' equivalent, these functions verify
the validity of the key via IntDict.isValidKey
.
An error type signaling an invalid key.
Result InvalidKey a
A value of this type is returned by all functions in this module.
See the core libraries' Result
documentation for how to cope with it.
safeInsert : Basics.Int -> v -> IntDict v -> SafeKeyResult (IntDict v)
Version of IntDict.insert
that validates the key.
safeUpdate : Basics.Int -> (Maybe v -> Maybe v) -> IntDict v -> SafeKeyResult (IntDict v)
Version of IntDict.update
that validates the key.
safeRemove : Basics.Int -> IntDict v -> SafeKeyResult (IntDict v)
Version of IntDict.remove
that validates the key.
safeMember : Basics.Int -> IntDict v -> SafeKeyResult Basics.Bool
Version of IntDict.member
that validates the key.
safeGet : Basics.Int -> IntDict v -> SafeKeyResult (Maybe v)
Version of IntDict.get
that validates the key.