Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Witch.Lift
Synopsis
- liftedCast :: forall source target m. (TryCast source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target
- liftedFrom :: forall s target m source. (Identity s ~ source, TryCast source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target
- liftedInto :: forall t source m target. (Identity t ~ target, TryCast source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target
Documentation
liftedCast :: forall source target m. (TryCast source target, Lift target, Show source, Typeable source, Typeable target, Quote m) => source -> Code m target Source #
This is like unsafeCast
except that it works at compile time
rather than runtime.
-- Avoid this: unsafeCast "some literal" -- Prefer this: $$(liftedCast "some literal")
liftedFrom :: forall s target m source. (Identity s ~ source, TryCast 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 t source m target. (Identity t ~ target, TryCast 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")