pure -package:xmonad-contrib

Lift a value into the Structure.

Examples

>>> pure 1 :: Maybe Int
Just 1
>>> pure 'z' :: [Char]
"z"
>>> pure (pure ":D") :: Maybe [String]
Just [":D"]
Lift a value.
Variant of exp, for use with expressions known to have no side effects. BEWARE: Use this function with caution, only when you know what you are doing. If an expression does in fact have side-effects, then indiscriminate use of pure may endanger referential transparency, and in principle even type safety. Also note that the function might be called multiple times, given that unsafeDupablePerformIO is used to call the provided C code. Please refer to the documentation for unsafePerformIO for more details. unsafeDupablePerformIO is used to ensure good performance using the threaded runtime.
Variant of exp, for use with expressions known to have no side effects. BEWARE: Use this function with caution, only when you know what you are doing. If an expression does in fact have side-effects, then indiscriminate use of pure may endanger referential transparency, and in principle even type safety. Also note that the function may run more than once and that it may run in parallel with itself, given that unsafeDupablePerformIO is used to call the provided C code to ensure good performance using the threaded runtime. Please refer to the documentation for unsafeDupablePerformIO for more details.
Create an exceptional value without exception.
Lifted pure.
pure, but taking explicit add and zero.
pure, but with Num constraints instead of Backprop constraints.
Note that this tends to make little sense for non-endofunctors. Consider using constPure instead.
Lift a value.
This module supplies a 'pure' monad transformer that can be used for mock-testing code that throws exceptions, so long as those exceptions are always thrown with throwM. Do not mix CatchT with IO. Choose one or the other for the bottom of your transformer stack!