Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class UnsafeStrengthen w s | s -> w where
- unsafeStrengthen :: w -> s
- unsafeStrengthen' :: forall s w. UnsafeStrengthen w s => w -> s
Documentation
class UnsafeStrengthen w s | s -> w where Source #
Any w
can be unsafely "strengthened" into an s
by pretending that we've
asserted some properties.
For example, you may unsafely strengthen some Natural
n
into a Word8
by
unsafely coercing the value, ignoring the possibility that n >= 255
.
Currently, this class is more of a thought experiment than something to use. That is to say, do not use this.
This typeclass should probably follow its big sis Strengthen
. Only provide
UnsafeStrengthen
instances for types that have similar Strengthen
instances.
unsafeStrengthen :: w -> s Source #
Instances
unsafeStrengthen' :: forall s w. UnsafeStrengthen w s => w -> s Source #
unsafeStrengthen
with reordered type variables for more convenient
visible type application.