witch-1.1.3.0: Convert values from one type into another.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Witch.Lift

Synopsis

Documentation

liftedFrom :: forall source target m. (TryFrom source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target Source #

This is like unsafeFrom except that it works at compile time rather than runtime.

-- Avoid this:
unsafeFrom @s "some literal"

-- Prefer this:
$$(liftedFrom @s "some literal")

liftedInto :: forall target source m. (TryFrom source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target Source #

This is like unsafeInto except that it works at compile time rather than runtime.

-- Avoid this:
unsafeInto @t "some literal"

-- Prefer this:
$$(liftedInto @t "some literal")