Re: Limiting resources on a per-function basis?

2004-01-05 Thread Ketil Malde
Jeff Newbern [EMAIL PROTECTED] writes:

 Thanks for your input.  I am mainly interested in this functionality to
 enhance my unit tests.  I want to be able to run test cases with limits
 on time, heap, stack, etc. and fail the test if it exceeds the limits.

Well, if you can isolate the tests well enough (i.e. not run too many
other parts of your program), you could possibly get by with GHC's
options for limiting resources (for the whole program)?  In particular
the +RTS -K and -M options would be useful, see
http://www.haskell.org/ghc/docs/6.2/html/users_guide/runtime-control.html#RTS-OPTIONS-GC
for details. 

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Perspectives on learning and using Haskell

2004-01-05 Thread Shae Matijs Erisson
[EMAIL PROTECTED] writes:

 There is only one problem I've found with test-driven development in
 Haskell.  In C++, it's possible to break the module abstraction
 (yes, I know, C++ doesn't have modules; it has classes, which are really
 instantiable modules) by using friend.  In Haskell, I find myself
 occasionally having to expose parts of a module which I would prefer not
 to, in order for the unit tests suite to do their job effectively.

My one problem with test-driven Haskell is, how to do it with QuickCheck tests?
It's easy enough with HUnit, but I'd like to try it with QuickCheck, any
suggestions?

 I wonder if there might be a way to fix this, say, by allowing modules
 to selectively expose parts of their interface depending on who wants
 to use it.

What about GHC's new -main-is flag to specify a test main function? Then you
may be able to write test code without exporting internal functions.


As for tighter integration of tests with code, I wrote an example of one-button
unit-testing in emacs on the HaskellMode page on the HaWiki, and the
Programatica editor, as demonstrated at Haskell Workshop 2003 has the ability
to embed 'certificates' that can be proofs, unit tests, etc.
Check out the Evidence Management section here:
http://www.cse.ogi.edu/~hallgren/Programatica/HW2003/demoabstract.html 

There's also the darcs_test parts of darcs, you can assign a script to run
tests after a variety of darcs commands. 

None of these run the tests at compile time, but it's better than manually
running the tests.
-- 
Shae Matijs Erisson - 2 days older than RFC0226
#haskell on irc.freenode.net - We Put the Funk in Funktion
10 PRINT HELLO 20 GOTO 10 ; putStr $ fix (HELLO\n++)

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


pet project - 7 Millennium Prize problemss

2004-01-05 Thread Christopher Milton
Folks,

I think  Haskell can be used to solve several, if not all, of
the seven problems.

Now I have to decide which problem to tackle first.

Chris


=
Christopher Milton
[EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Perspectives on learning and using Haskell

2004-01-05 Thread Sven Panne
Duncan Coutts wrote:
On Sun, 2004-01-04 at 10:20, Graham Klyne wrote:
[...]  I would expect that when using GHC to compile a 
stand-alone Haskell program, any expressions that are not referenced are 
not included in the final object program, so leaving these test cases 
uncommented would be harmless:  is this so?
If your test functions are not exported, I would expect that this is the
case. [...]
Yes, unused functions which are not exported are nuked during compilation,
even without using the -O flag. But don't guess, just ask GHC itself via its
-ddump-occur-anal flag. (DISCLAIMER: I'm not responsible for the, well,
slightly obscure name of this flag! :-)   There are a lot more flags of this
kind, see:
   http://haskell.org/ghc/docs/latest/html/users_guide/options-debugging.html#DUMPING-OUTPUT

When you are *really* curious, use -v5.

Simon^2: The -ddump-all and -ddump-most flags mentioned on the page above are
not working anymore, -v5 / -v4 seem to do their job now. Should the documentation
be fixed or GHC?
Cheers,
   S.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: pet project - 7 Millennium Prize problemss

2004-01-05 Thread Ketil Malde
Christopher Milton [EMAIL PROTECTED] writes:

 I think  Haskell can be used to solve several, if not all, of
 the seven problems.

What's this?  Is there an URL with more information?

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: pet project - 7 Millennium Prize problemss

2004-01-05 Thread Christopher Milton
--- Ketil Malde [EMAIL PROTECTED] wrote:
 Christopher Milton [EMAIL PROTECTED] writes:
 
  I think  Haskell can be used to solve several, if not all, of
  the seven problems.
 
 What's this?  Is there an URL with more information?

Sorry, I meant to include the URL, but I got distracted.

http://www.claymath.org/Millennium_Prize_Problems/

=
Christopher Milton
[EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


HSQL Linking Problem with ghc6

2004-01-05 Thread Charles Perkins
Hello Haskellians,

I have been looking for a way to get ghc-compiled haskell programs to
talk to a PostgreSQL database, and HSQL seems to be exactly what I
need... And what's more, it appears to have downloaded and installed
with minimal hassle...

Alas (and I am sure this is a problem with my own lack of knowledge or
misconfiguration of my system) I can't get ghc to link my program to the
HSQL libHSSql.a library. At least I think that is the problem.

On my debian-stable system, with some packages and libraries upgraded to
-testing so I could install ghc6, I downloaded HSQL 1.0 from sourceforge
and then ./configured with --enable-postgress and told it to make and
then make -install the HSQL package. When I put an import HSQL statement
in my program ghc compiles it without errors but the Linking phase
reports the following (my program name is EnvPassed:)

Linking ...
EnvPassed.o: In function `__stginit_main_':
EnvPassed.o(.text+0x25): undefined reference to `__stginit_HSQL_'
Collect2: ld returned 1 exit status

I get the same error when I do a standard compile and when I specify the
library to link to as follows: ghc --make EnvPassed.hs -o EnvPassed
-lHSsql -L/software/HSQL/

(I had expanded and built HSQL in the /software directory.)

Am I doing something stupid? What should I check for this kind of error?

Any help would be appreciated.

Chuck

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: HSQL Linking Problem with ghc6

2004-01-05 Thread Christopher Milton
Nevermind, I found it. http://htoolkit.sourceforge.net/
--- Christopher Milton [EMAIL PROTECTED] wrote:
 I keep only finding a Java SQL interface on SourceForge
 when I look for HSQL. What is the URL?
 
 --- Charles Perkins [EMAIL PROTECTED] wrote:
  Hello Haskellians,
  
  I have been looking for a way to get ghc-compiled haskell programs to
  talk to a PostgreSQL database, and HSQL seems to be exactly what I
  need... And what's more, it appears to have downloaded and installed
  with minimal hassle...
  
  Alas (and I am sure this is a problem with my own lack of knowledge or
  misconfiguration of my system) I can't get ghc to link my program to the
  HSQL libHSSql.a library. At least I think that is the problem.
  
  On my debian-stable system, with some packages and libraries upgraded to
  -testing so I could install ghc6, I downloaded HSQL 1.0 from sourceforge
  and then ./configured with --enable-postgress and told it to make and
  then make -install the HSQL package. When I put an import HSQL statement
  in my program ghc compiles it without errors but the Linking phase
  reports the following (my program name is EnvPassed:)
  
  Linking ...
  EnvPassed.o: In function `__stginit_main_':
  EnvPassed.o(.text+0x25): undefined reference to `__stginit_HSQL_'
  Collect2: ld returned 1 exit status
  
  I get the same error when I do a standard compile and when I specify the
  library to link to as follows: ghc --make EnvPassed.hs -o EnvPassed
  -lHSsql -L/software/HSQL/
  
  (I had expanded and built HSQL in the /software directory.)
  
  Am I doing something stupid? What should I check for this kind of error?
  
  Any help would be appreciated.
  
  Chuck
  
  ___
  Haskell-Cafe mailing list
  [EMAIL PROTECTED]
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 ___
 Haskell-Cafe mailing list
 [EMAIL PROTECTED]
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe