Instances.TH.Lift

th-lift-instances-0.1.19: Lift instances for template-haskell for common data types.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Instances.TH.Lift

Contents

- Base
- Containers (both strict/lazy)
- ByteString (both strict/lazy)
- Text (both strict/lazy)
- Vector (Boxed, Unboxed, Storable, Primitive)
- Orphan instances

Synopsis

# Documentation

This module provides orphan instances for the `Lift` class from template-haskell. Following is a list of the provided instances.

Lift instances are useful to precompute values at compile time using template haskell. For example, if you write the following code, you can make sure that `3 * 10` is really computed at compile time:

    {-# LANGUAGE TemplateHaskell #-}

    import Language.Haskell.TH.Syntax

    expensiveComputation :: Word32
    expensiveComputation = $(lift $ 3 * 10) -- This will computed at compile time

This uses the Lift instance for Word32.

The following instances are provided by this package:

# Base

- `Word8`, `Word16`, `Word32`, `Word64`
- `Int8`, `Int16`, `Int32`, `Int64`
- `NonEmpty` and `Void`, until provided by `template-haskell-2.15`

# Containers (both strict/lazy)

- `IntMap`
- `IntSet`
- `Map`
- `Set`
- `Tree`
- `Seq`

# ByteString (both strict/lazy)

- `ByteString`

# Text (both strict/lazy)

- `Text`

# Vector (Boxed, Unboxed, Storable, Primitive)

- `Vector`

# Orphan instances

Lift ByteString # |
Instance details Methods lift :: Quote m => ByteString -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString #
Lift ByteString # |
Instance details Methods lift :: Quote m => ByteString -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString #
Lift IntSet # |
Instance details Methods lift :: Quote m => IntSet -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => IntSet -> Code m IntSet #
Lift a => Lift (Identity a :: Type) # |
Instance details Methods lift :: Quote m => Identity a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Identity a -> Code m (Identity a) #
Lift v => Lift (IntMap v :: Type) # |
Instance details Methods lift :: Quote m => IntMap v -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => IntMap v -> Code m (IntMap v) #
Lift a => Lift (Seq a :: TYPE LiftedRep) # |
Instance details Methods lift :: Quote m => Seq a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Seq a -> Code m (Seq a) #
Lift a => Lift (Set a :: Type) # |
Instance details Methods lift :: Quote m => Set a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Set a -> Code m (Set a) #
Lift a => Lift (Tree a :: Type) # |
Instance details Methods lift :: Quote m => Tree a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Tree a -> Code m (Tree a) #
Lift a => Lift (Vector a :: Type) # |
Instance details Methods lift :: Quote m => Vector a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Vector a -> Code m (Vector a) #
(Prim a, Lift a) => Lift (Vector a :: Type) # |
Instance details Methods lift :: Quote m => Vector a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Vector a -> Code m (Vector a) #
(Storable a, Lift a) => Lift (Vector a :: Type) # |
Instance details Methods lift :: Quote m => Vector a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Vector a -> Code m (Vector a) #
(Unbox a, Lift a) => Lift (Vector a :: Type) # |
Instance details Methods lift :: Quote m => Vector a -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Vector a -> Code m (Vector a) #
(Lift k, Lift v) => Lift (Map k v :: Type) # |
Instance details Methods lift :: Quote m => Map k v -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Map k v -> Code m (Map k v) #
Lift a => Lift (Const a b :: Type) # |
Instance details Methods lift :: Quote m => Const a b -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Const a b -> Code m (Const a b) #