quipper-cabal-0.9.0.0: Some functions to aid in the creation of Cabal packages for Quipper.

Safe HaskellNone
LanguageHaskell98

Quipper.Distribution.Preprocessor

Description

This module provides access to the Quipper preprocessor, in a format that can be used in custom Setup scripts to teach Cabal to compile Quipper programs.

Synopsis

Documentation

ppQuipper :: PreProcessor Source #

The Quipper preprocessor, in the format required by Cabal. This can be used in the Setup.hs file of Cabal packages, for example like this:

{-# LANGUAGE CPP #-}

import Distribution.Simple
import Quipper.Distribution.Preprocessor

-- The following is needed because of an incompatible change in Cabal 2.
#if MIN_VERSION_Cabal(2,0,0)
wrap x = \_ _ _ -> x
#else
wrap x = \_ _ -> x
#endif

main = defaultMainWithHooks simpleUserHooks {
  hookedPreProcessors = [("hs", wrap ppQuipper)]
  }