Re: [Haskell-cafe] Grabbing list of functions from current module

2007-05-10 Thread Jason Dagit

On 4/9/07, Joel Reymont [EMAIL PROTECTED] wrote:

Folks,

Does anyone have code that can grab a list of functions named with a
certain prefix from the current (or given) module? I want to find
functions named, say, ast_* and produce a list of tuples like
(input1, ast_input1).


I wrote some code to do this once.  I can send you the source if you
like.  I wrote about my approach for doing this on my blog some time
back.  I hope this is helpful:

http://blog.codersbase.com/2006/09/01/simple-unit-testing-in-haskell/

HTH,
Jason
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Grabbing list of functions from current module

2007-04-09 Thread Joel Reymont

Folks,

Does anyone have code that can grab a list of functions named with a  
certain prefix from the current (or given) module? I want to find  
functions named, say, ast_* and produce a list of tuples like  
(input1, ast_input1).


Thanks, Joel

--
http://wagerlabs.com/





___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Grabbing list of functions from current module

2007-04-09 Thread John Meacham
On Mon, Apr 09, 2007 at 01:39:55PM +0100, Joel Reymont wrote:
 Folks,
 
 Does anyone have code that can grab a list of functions named with a  
 certain prefix from the current (or given) module? I want to find  
 functions named, say, ast_* and produce a list of tuples like  
 (input1, ast_input1).


sed -ne 's/^ast_\([a-z0-9_A-Z]\+\).*$/(\1,ast_\1)/p'  File.hs

note the two occurances of 'ast_'. 

John

-- 
John Meacham - ⑆repetae.net⑆john⑈
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Grabbing list of functions from current module

2007-04-09 Thread Joel Reymont

Mea culpa! I meant Template Haskell code :-).

Thanks John!

On Apr 9, 2007, at 2:02 PM, John Meacham wrote:


sed -ne 's/^ast_\([a-z0-9_A-Z]\+\).*$/(\1,ast_\1)/p'  File.hs

note the two occurances of 'ast_'.


--
http://wagerlabs.com/





___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe