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

Safe HaskellNone
LanguageHaskell2010

Instances.TH.Lift

Contents

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)

ByteString (both strict/lazy)

Text (both strict/lazy)

Vector (Boxed, Unboxed, Storable, Primitive)

Orphan instances

Lift Void Source # 

Methods

lift :: Void -> Q Exp #

Lift ByteString Source # 

Methods

lift :: ByteString -> Q Exp #

Lift ByteString Source # 

Methods

lift :: ByteString -> Q Exp #

Lift IntSet Source # 

Methods

lift :: IntSet -> Q Exp #

Lift Text Source # 

Methods

lift :: Text -> Q Exp #

Lift Text Source # 

Methods

lift :: Text -> Q Exp #

Lift a => Lift (Identity a) Source # 

Methods

lift :: Identity a -> Q Exp #

Lift a => Lift (NonEmpty a) Source # 

Methods

lift :: NonEmpty a -> Q Exp #

Lift a => Lift (Tree a) Source # 

Methods

lift :: Tree a -> Q Exp #

Lift a => Lift (Seq a) Source # 

Methods

lift :: Seq a -> Q Exp #

Lift v => Lift (IntMap v) Source # 

Methods

lift :: IntMap v -> Q Exp #

Lift a => Lift (Set a) Source # 

Methods

lift :: Set a -> Q Exp #

Lift a => Lift (Vector a) Source # 

Methods

lift :: Vector a -> Q Exp #

(Prim a, Lift a) => Lift (Vector a) Source # 

Methods

lift :: Vector a -> Q Exp #

(Storable a, Lift a) => Lift (Vector a) Source # 

Methods

lift :: Vector a -> Q Exp #

(Unbox a, Lift a) => Lift (Vector a) Source # 

Methods

lift :: Vector a -> Q Exp #

(Lift k, Lift v) => Lift (Map k v) Source # 

Methods

lift :: Map k v -> Q Exp #

Lift a => Lift (Const * a b) Source # 

Methods

lift :: Const * a b -> Q Exp #