
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I made a script for testing QuickCheck properties in a module by adding a line to that file that contains a function _automatedQuickCheckMainWhichCanBeDeletedWheneverYouWantButPleaseDoNotChangeThisLineBecauseItMightConfuseTheStupidScriptThatProcessesIt :: IO () which tests all properties found in the file when run. (let us call that ridiculously long name $TESTMAIN_NAME from now on) To test using ghc, I pass the argument - -main-is $MODULE_NAME.$TESTMAIN_NAME (where $MODULE_NAME is found out by the script). To test using Hugs, I do `echo "$TESTMAIN_NAME" | hugs`. Any advice on how to do the same thing for Yhc -- execute an IO action defined in the top level of an arbitrary module, but not exported from the module? Isaac P.S. I'm attaching the script... I'll probably release it officially some time if I clean it up (e.g. find a good way to do it in a better and more portable language, like Haskell, maybe? and add some options) P.P.S. I made this because I didn't like the only existing one I could find, which didn't even work for me without some hacking. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFUmdbHgcxvIWYTTURAoJZAJ9L4Tlrnxmt2ugneJaDnlt6IMQNgACfdHmq UOAvdTJ5TSIQBtkroMLArsI= =neb8 -----END PGP SIGNATURE-----

isaacdupree:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I made a script for testing QuickCheck properties in a module by adding a line to that file that contains a function _automatedQuickCheckMainWhichCanBeDeletedWheneverYouWantButPleaseDoNotChangeThisLineBecauseItMightConfuseTheStupidScriptThatProcessesIt :: IO ()
Prize for longest identifier ever written in a Haskell program goes to.... :) -- Don

Hi
To test using ghc, I pass the argument - -main-is $MODULE_NAME.$TESTMAIN_NAME (where $MODULE_NAME is found out by the script).
I guess we need a --main-is flag as well. I have openned a bug for it: http://code.google.com/p/yhc/issues/detail?id=79 How critical is this to you? I've openned it as Priority-Low, but if its important to you am happy to bump that a bit.
Any advice on how to do the same thing for Yhc -- execute an IO action defined in the top level of an arbitrary module, but not exported from the module?
We also have -exportall, which makes everything exported from a module, if that gives you any luck. Thanks Neil

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Neil Mitchell wrote:
Hi
To test using ghc, I pass the argument - -main-is $MODULE_NAME.$TESTMAIN_NAME (where $MODULE_NAME is found out by the script).
I guess we need a --main-is flag as well.
I have openned a bug for it: http://code.google.com/p/yhc/issues/detail?id=79
Should this be a yhc or a yhi option, or both... do the bytecode files have enough information in them? Just wondering...
How critical is this to you? I've openned it as Priority-Low, but if its important to you am happy to bump that a bit.
Any advice on how to do the same thing for Yhc -- execute an IO action defined in the top level of an arbitrary module, but not exported from the module?
We also have -exportall, which makes everything exported from a module, if that gives you any luck.
"-exportall" was enough of a workaround that I found out that I couldn't use QuickCheck with Yhc yet... Yhc doesn't have it directly, and the implementation uses System.Random, which Yhc doesn't have and whose implementation needs IORefs and probably time primitives, neither of which I could find in Yhc. Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFVJ3wHgcxvIWYTTURAr6VAJ4z8akBKNUrvo5F/Y8Paj9YlJ3wbQCgl3mg yIMGYrz1vJn8Ngb9zxSHEHw= =P9uY -----END PGP SIGNATURE-----

Hi
I have openned a bug for it: http://code.google.com/p/yhc/issues/detail?id=79
Should this be a yhc or a yhi option, or both... do the bytecode files have enough information in them? Just wondering...
Turns out yhi could happily do this. Yhi just executes <module name>.main already, so adding -main-is is pretty easy.
We also have -exportall, which makes everything exported from a module, if that gives you any luck.
"-exportall" was enough of a workaround that I found out that I couldn't use QuickCheck with Yhc yet...
Yes, the lack of haskell.org libraries is starting to get increasingly annoying... Thanks Neil
participants (3)
-
dons@cse.unsw.edu.au
-
Isaac
-
Neil Mitchell