strongweak-0.2.0: Convert between strong and weak representations of types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Strongweak.Strengthen.Unsafe

Synopsis

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.

Methods

unsafeStrengthen :: w -> s Source #

Instances

Instances details
UnsafeStrengthen Integer Int16 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Integer Int32 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Integer Int64 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Integer Int8 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Natural Word16 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Natural Word32 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Natural Word64 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen Natural Word8 Source # 
Instance details

Defined in Strongweak.Strengthen.Unsafe

UnsafeStrengthen a (Refined p a) Source #

Obtain a refined type by ignoring the predicate.

Instance details

Defined in Strongweak.Strengthen.Unsafe

Methods

unsafeStrengthen :: a -> Refined p a Source #

UnsafeStrengthen w s => UnsafeStrengthen [w] [s] Source #

Unsafely strengthen each element of a list.

Instance details

Defined in Strongweak.Strengthen.Unsafe

Methods

unsafeStrengthen :: [w] -> [s] Source #

UnsafeStrengthen [a] (Vector n a) Source #

Obtain a sized vector by unsafely assuming the size of a plain list. Extremely unsafe.

Instance details

Defined in Strongweak.Strengthen.Unsafe

Methods

unsafeStrengthen :: [a] -> Vector n a Source #

unsafeStrengthen' :: forall s w. UnsafeStrengthen w s => w -> s Source #

unsafeStrengthen with reordered type variables for more convenient visible type application.