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


-- | Module to automatically extract functions from the local code.
--   
--   <tt>language-haskell-extract</tt> contains some useful helper
--   functions on top of Template Haskell.
--   
--   <tt>functionExtractor</tt> extracts all functions after a
--   regexp-pattern.
--   
--   <pre>
--   foo = "test"
--   boo = "testing"
--   bar = $(functionExtractor "oo$")
--   </pre>
--   
--   will automagically extract the functions ending with <tt>oo</tt> such
--   as
--   
--   <pre>
--   bar = [("foo",foo), ("boo",boo)]
--   </pre>
--   
--   This can be useful if you wish to extract all functions beginning with
--   test (for a test-framework) or all functions beginning with wc (for a
--   web service).
--   
--   <tt>functionExtractorMap</tt> works like <tt>functionsExtractor</tt>
--   but applies a function over all function-pairs.
--   
--   This functions is useful if the common return type of the functions is
--   a type class.
--   
--   Example:
--   
--   <pre>
--   secondTypeclassTest =
--     do let expected = ["45", "88.8", "\"hej\""]
--            actual = $(functionExtractorMap "^tc" [|\n f -&gt; show f|] )
--        expected @=? actual
--   
--   tcInt :: Integer
--   tcInt = 45
--   
--   tcDouble :: Double
--   tcDouble = 88.8
--   
--   tcString :: String
--   tcString = "hej"
--   </pre>
@package language-haskell-extract
@version 0.2.4

module Language.Haskell.Extract

-- | Extract the names and functions from the module where this function is
--   called.
--   
--   <pre>
--   foo = "test"
--   boo = "testing"
--   bar = $(functionExtractor "oo$")
--   </pre>
--   
--   will automagically extract the functions ending with "oo" such as
--   
--   <pre>
--   bar = [("foo",foo), ("boo",boo)]
--   </pre>
functionExtractor :: String -> ExpQ

-- | Extract the names and functions from the module and apply a function
--   to every pair.
--   
--   Is very useful if the common denominator of the functions is just a
--   type class.
--   
--   <pre>
--   secondTypeclassTest =
--     do let expected = ["45", "88.8", "\"hej\""]
--            actual = $(functionExtractorMap "^tc" [|\n f -&gt; show f|] )
--        expected @=? actual
--   
--   tcInt :: Integer
--   tcInt = 45
--   
--   tcDouble :: Double
--   tcDouble = 88.8
--   
--   tcString :: String
--   tcString = "hej"
--   </pre>
functionExtractorMap :: String -> ExpQ -> ExpQ

-- | Extract the name of the current module.
locationModule :: ExpQ
