lookup package:base

lookup key assocs looks up a key in an association list. For the result to be Nothing, the list must be finite.

Examples

>>> lookup 2 []
Nothing
>>> lookup 2 [(1, "first")]
Nothing
>>> lookup 2 [(1, "first"), (2, "second"), (3, "third")]
Just "second"
Return the value of the environment variable var, or Nothing if there is no such value. For POSIX users, this is equivalent to getEnv.
Looks up a StaticPtr by its StaticKey. If the StaticPtr is not found returns Nothing. This function is unsafe because the program behavior is undefined if the type of the returned StaticPtr does not match the expected one.