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

Strongweak

Synopsis

Documentation

restrengthen :: forall w s. (Weaken s w, Strengthen w s) => s -> Validation (NonEmpty StrengthenError) s Source #

Weaken and re-strengthen a strong value.

In correct operation, restrengthen === Right. If your value was strengthened incorrectly, or perhaps you cheated via UnsafeStrengthen, this may not be the case. For example:

>>> restrengthen $ unsafeStrengthen' @(Vector 2 Natural) [0]
Failure ...