-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Deriver for Data.Vector.Unboxed using Template Haskell
--   
--   A Template Haskell deriver for unboxed vectors, given a pair of
--   coercion functions to and from some existing type with an Unbox
--   instance.
--   
--   Refer to Data.Vector.Unboxed.Deriving for documentation and
--   examples.
@package vector-th-unbox
@version 0.2.2

module Data.Vector.Unboxed.Deriving

-- | Let's consider a more complex example: suppose we want an
--   Unbox instance for Maybe a. We could encode this
--   using the pair (Bool, a), with the boolean indicating whether
--   we have Nothing or Just something. This encoding
--   requires a dummy value in the Nothing case, necessitating an
--   additional Default constraint. Thus:
--   
--   
--   derivingUnbox "Maybe"
--       [t| ∀ a. (Default a, Unbox a) ⇒ Maybe a → (Bool, a) |]
--       [| maybe (False, def) (\ x → (True, x)) |]
--       [| \ (b, x) → if b then Just x else Nothing |]
--   
derivingUnbox :: String -> TypeQ -> ExpQ -> ExpQ -> DecsQ
