Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data Uniq s
- getUniq :: PrimMonad m => m (Uniq (PrimState m))
- unsafeMkUniq :: Integer -> Uniq s
- unsafeShowsPrecUniq :: Int -> Uniq s -> ShowS
- unsafeShowUniq :: Uniq s -> String
Documentation
A Uniq
is a value that can only be constructed under controlled
conditions (in IO or ST, basically), and once constructed can only be
compared to Uniq
values created under the same conditions (in the same
monad). Upon comparison, a Uniq
is ONLY ever equal to itself. Beyond
that, no promises regarding ordering are made except that once constructed
the order is deterministic and a proper ordering relation (eg, > is
transitive and irreflexive, etc.)
Instances
Eq (Uniq s) Source # | |
Ord (Uniq s) Source # | |
Show (Uniq RealWorld) Source # | There is only one |
unsafeMkUniq :: Integer -> Uniq s Source #
For the implementation of Uniq
construction in new monads, this operation
is exposed. Users must accept responsibility for ensuring true uniqueness
across the lifetime of the resulting Uniq
value. Failure to do so could
lead to type unsoundness in code depending on uniqueness as a type witness
(eg, Data.Unique.Tag).
unsafeShowUniq :: Uniq s -> String Source #
See unsafeShowsPrecUniq
.