needle-0.1.0.1: ASCII-fied arrow notation

Copyright(c) 2014 Josh Kirklin
LicenseMIT
Maintainerjjvk2@cam.ac.uk
Safe HaskellNone
LanguageHaskell2010

Control.Arrow.Needle.TH

Description

This module combines the parsing from Control.Arrow.Needle.Parse with Template Haskell.

Synopsis

Documentation

nd :: QuasiQuoter Source

The inline needle quasi-quoter.

{-# LANGUAGE QuasiQuotes #-}

exampleArrow :: Num c => (a,b,c) -> (a,a,b,c,c)
exampleArrow = [nd|
   }===========>
      \========>
   }===========>
   }==={negate}>
      \========>
 |]

ndFile :: FilePath -> ExpQ Source

Load a needle from a file.

{-# LANGUAGE TemplateHaskell #-}

exampleArrow :: Float -> Float
exampleArrow = $(ndFile "example.nd")