| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Strongweak.Weaken
Documentation
Weaken some a, relaxing certain invariants.
See Strongweak for class design notes and laws.
Instances
liftWeakF :: Weaken a => (Weakened a -> b) -> a -> b Source #
Lift a function on a weak type to the associated strong type by weakening first.
newtype SWCoercibly a Source #
A "via type" newtype for defining strongweak instances for zero-invariant, coercible newtypes.
Use like so:
derivingWeakenviaSWCoerciblya
Or standalone:
viaSWCoerciblya instanceWeaken(Identitya)
Note that usage of this incurs UndecidableInstances. That's life. You can write the trivial instances this generates yourself if you so wish.
Constructors
| SWCoercibly | |
Fields
| |
Instances
| Strengthen (SWCoercibly a) Source # | |||||
Defined in Strongweak.Strengthen Methods strengthen :: Weakened (SWCoercibly a) -> Either StrengthenFailure' (SWCoercibly a) Source # | |||||
| UnsafeStrengthen (SWCoercibly a) Source # | |||||
Defined in Strongweak.Strengthen.Unsafe Methods unsafeStrengthen :: Weakened (SWCoercibly a) -> SWCoercibly a Source # | |||||
| Weaken (SWCoercibly a) Source # | |||||
Defined in Strongweak.Weaken Associated Types
Methods weaken :: SWCoercibly a -> Weakened (SWCoercibly a) Source # | |||||
| type Weakened (SWCoercibly a) Source # | |||||
Defined in Strongweak.Weaken | |||||