[Haskell-cafe] Mapping string to a function

Haisheng Wu freizl at gmail.com
Thu Mar 15 05:59:51 CET 2012


Hi there,
  Do you have any comments / suggestions for the following scenario?

  I have two list and a function over list
  testdata :: [Int]
  testdata2 :: [Int]
  f testdata = map g testdata

 What I like to do is choosing what test data via command line arguments.
 i.e. test.hs testdata2 will run against testdata2

 I could make it using pattern match between argument and data
definition but it is annoy.
 code here: https://github.com/freizl/dive-into-haskell/blob/master/sandbox/one-in-arith-seq.hs

 I'm wondering it can be done simply in haskell.

 Thanks a lot.
-Haisheng



More information about the Haskell-Cafe mailing list