Re: ghc on Win32

2000-08-07 Thread Zhanyong Wan

Matthias,

 I've just installed ghc-4.08 / binary release for Win32.

 When compiling a file Type.hs, the following happens:

 START
 Compiling Type.hs

 does not exist
 Action: openFile
 Reason: file does not exist /tmp/ghc1096.cpp
 END

I had the same problem, until I read the following from
http://www.haskell.org/ghc/docs/latest/set/book-users-guide.html :

##

Furthermore, it seems that TMPDIR must be set to a directory in the same
file system in which you invoke GHC. Otherwise you get very werid
messages when you invoke GHC, such as: does not exist
Action: openFile
Reason: file does not exist /tmp/ghc11068.cpp

We think this is due to a bug in Cygwin.

##

So if your source file is in d:/src, and your TMPDIR is c:/tmp, you
probably need to:

cd c:
path/to/ghc/bin/ghc //d/src/Type.hs

--
Zhanyong Wan
Dept of Computer Science, Yale University





form of class constraints

2000-08-07 Thread Zhanyong Wan

I'm using the GHC 4.08 binary distribution on Windows.

According to the Haskell 98 report, class constraints are of the form C
(a t1 ... tn), where C is a class, a is a type variable, and t1, ..., tn
are arbitrary types (including type variables, n = 0).  However, the
following code failed to compile:

##
module Test where

newtype StateT s t b x = StateT (s - t b (s, x))
instance Functor (t b) = Functor (StateT s t b)
##

Illegal constraint `Functor (t b)' in instance context
(Instance contexts must constrain only type variables)

I have no problem with the same code in Hugs.  Is this a GHC bug?

--
Zhanyong Wan
Dept of Computer Science, Yale University







Time profiling interval?

2000-08-07 Thread Alastair Reid


While trying to generate a heap profile for a large run, I was getting
lots of floating point exceptions when running hp2ps.  Normally, I'd
have used "+RTS -i5" (or the like) to reduce the number of samples
being generated (which, I think, avoids the heap overflow and would
also reduce runtime to an acceptable amount).

So, the question is: how do I set the profiling interval?
(btw the online users guide still documents the -i flag)


-- 
Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/




RE:

2000-08-07 Thread Chris Angus



 -Original Message-
 From: Matthias Kilian [mailto:[EMAIL PROTECTED]]
 Sent: 06 August 2000 22:01
 To: Mirko Pracht
 Cc: [EMAIL PROTECTED]
 Subject: Re: 
 
 
 On Sun, 6 Aug 2000, Mirko Pracht wrote:
 
  average x  | null x= 0.0
 
 What does you make thinking the average of an empty list is 0? Its'
 obviously _|_, thus
 
 average xs = sum xs / length xs

does this not need a "fromInt" to keep it happy
I seem to remember a function genericLength once upon
a type ... has this been removed nowadays?


 
 [which is inefficient, but simple]
 
 Kili
 
 -- 
 _|_ is pronounced 'bottom', and is the greatest lower bound of a
 complete lattice.
 
 Nick Williams in comp.lang.functional
 
 




Re: Haskell and the NGWS Runtime

2000-08-07 Thread Ketil Malde

"Chris Saunders" [EMAIL PROTECTED] writes:

 It seems to me that this .Net thingy is a runtime and therefore
 could potentially be as portable as anything from Java.

Potentially, yes.

 This runtime just needs to be ported to other operating systems
 similarily to the Java runtime.

So it's a question of either source availability - or at least a very
complete specification - or Microsoft strategy.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants




RE: Haskell and the NGWS Runtime

2000-08-07 Thread Doug Ransom

It is not what language that you want on your phone that matters -- you
didn't write the software.  What matters is any development team can pick
the language they prefer to use and make their software portable to your
phone or your PC.







-Original Message-
From: Nigel Perry [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 12:54 AM
To: [EMAIL PROTECTED]
Subject: Re: Haskell and the NGWS Runtime


We're drifting a bit off Haskell here, but...

At 10:57 am +1000 4/8/00, Kevin Glynn wrote:
I don't believe this says anything about support for other OS's.  I
think the devices here are hardware, (PCs, handhelds, phones, fridge
interfaces, ...)  Of course Microsoft believes that some day, very
soon, all devices will run (a version of) Windows.  Hence this
statement refers to Microsoft's announced plans to port .NET to all
Windows OS's, including WinCE.

Do you have another reference which is more convincing?

I haven't seen a WinCE version but at a recent conference one of the 
exhibitors was offering a .NET on WindowsCE course - however when I 
inquired they just said "ask MS, we don't know, we just teach the 
courses" (somehow I don't think I'll be recommending them!) So that's 
not too convincing!

They are talking phones - but that has to be a stripped down version. 
However I'm not sure why I want Haskell on my phone ("the phone with 
higher-order polymorphic lazy dialing"?)

As to others OSES...

At 10:24 pm -0400 3/8/00, Chris Saunders wrote:
It seems to me that this .Net thingy is a runtime
and therefore could potentially be as portable
as anything from Java.  This runtime just needs
to be ported to other operating systems similarily
to the Java runtime.

Porting JVM is a big enough job (you find a lot of "native" 
methods...) .NET has more paraphernalia than the JVM so it will be 
quite a job. However I think MS is moving to "standardise" the IL 
(the byte codes) which I guess is to suggest it is not a moving 
target (not the the JVM really is but I hear the lack of JVM 2's has 
been blamed on lack of info out of Sun - but that might be just 
passing the blame)

At 5:59 pm +0200 3/8/00, Juan J. Quintela wrote:
nigel Disclaimer, as Fergus added one: I am working with Microsoft on .NET
nigel implementation, but I run Windows 2000 on my G3 PowerBook and take
it
nigel to Microsoft with me. I'm biased on everything :-)

Windows 2000 in a G3 Powerbook? I am lost here :((

Why have any other computer when you can have a Mac?

Mine runs:
DVD Movies
MacOS
JVM
Playstation games
Windows 95
Windows 2000 (a bit slugglish)
and could run:
Linux (but I have no use for it at present)

At 2:07 am +1000 4/8/00, Fergus Henderson wrote:
 Note that on x86 there are only six general purpose registers,
 so you very quickly run out...

Who uses the x86? Oh I remember... ;-)

Cheers,
Nigel
-- 
--
Dr Nigel PerryEmail: [EMAIL PROTECTED]
IIST  Tel: +64 6 350 5799 2477
Massey University Fax: +64 6 350 2259
Palmerston North  FTP/WWW: smis-asterix.massey.ac.nz
New Zealand

It makes as much sense to wear a "cycle" style helmet in a car as on a
bike...
Choosing to wear one on a bike but not in a car is mere inconsistency.
Refusing to wear one in a car while insisting others do so on a bike 
is pure hypocrisy.

Will the new Labour government repeal the National government's hypocrisy,
or will they insult cyclists' like their predecessors?

Politics and hypocrisy before safety - the NZ Helmet Law, NZ's Shame




RE: Haskell and the NGWS Runtime

2000-08-07 Thread Doug Ransom

Back to the language wars then.

It does seem like integration of Haskell and the NGWS is a graunch, largely
because Haskell is not OO.

Is there anything preventing Haskell from becoming OO and seamlessly fitting
into the NGWS? Or from designing a functional language that would be a good
fit into the NGWS.

A major problem I see is that there is probably a standard set of container
classes in NGWS which have a high impedance mismatch with the lists
functional languags use for their constructions.

Can we ever have functional programming "in the large" given the OO paradigm
and NGWS are both here to stay?  This can not happen until I can get a
language which seamlessly fits into NGWS (or some similar thing on a
non-windows platform).












-Original Message-
From: Antony Courtney [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 06, 2000 3:49 PM
To: Jürgen A. Erhard
Cc: [EMAIL PROTECTED]
Subject: Re: Haskell and the NGWS Runtime


"Jürgen A. Erhard" wrote:
 
  "Manuel" == Manuel M T Chakravarty [EMAIL PROTECTED] writes:
 
 Manuel "Erik Meijer" [EMAIL PROTECTED] wrote,
  [...] The lab is *sponsored* by Microsoft, but definitively not
*at*
  Microsoft. I doubt there are any Linux boxes at Microsoft :-)
 
 Manuel [...] There have also been reports of Linux boxes in the main
 Manuel company, but the validity of these reports is of course not
 
 But easy to believe... I mean, wouldn't you take a good look at your
 competition? 

Having spent five years doing Windows and Win32 hacking, and 10+ years
doing Unix hacking before that, I can assure you there is little evidence
that Microsoft are interested in learning anything whatsoever from Linux
or any other Unix work-alike.  Rather than re-iterate the argument, I'll
simply point interested readers towards the excellent article
"Working with Win32: the good, the bad and the ugly"
by David G. Korn
http://www.usenix.org/publications/login/1997-11/win32.html  

which mostly reinforces the quote:
Those who do not understand Unix are condemned to reinvent 
it, poorly. -- Henry Spencer

Now that I've gotten MY little barb in, can we PLEASE end this tangent on
OS wars, and return to our regularly scheduled language wars?  :-)

Thanks,

-Antony
(haskell list lurker)

-- 
Antony Courtney
[EMAIL PROTECTED]
http://www.apocalypse.org/pub/u/antony




unlines: the mystery of the trailing \n

2000-08-07 Thread Sigbjorn Finne


Here's a Prelude inconsistency that's been irking me once 
in a while for a loong time - today it came up again, so here goes:

  unlines   ["a","b"]   == "a\nb\n"
  unwords ["a","b"]   == "a b"

I like that 

  unwords (ls1 ++ [unwords ls2]) == unwords (ls1 ++ ls2)

but not that 'unlines' doesnt' obey the same rule, i.e.,

   unlines [line1, unlines [line2,line3]]  /= unlines [line1,line2,line3]

Is this by design? I notice that 'unlines' mirrors Miranda's 'lay', but
I'd find it a little more useful without the trailing \n (esp. considering
now that putStrLn is std.)

The current defn of 'unlines' doesn't keep me up at night, but still.

--sigbjorn





Re: unlines: the mystery of the trailing \n

2000-08-07 Thread Brian Boutel


Here is a concern:

At present, a final \n in lines' input is optional, because a line is
ended by either a \n or the end of the string. Consequently lines "a"
and lines "a\n" have the same value ( ["a"] ). This seems a desirable
feature that is worth preserving.

Consider the composition lines.unlines, and what happens when the last
line is empty. unlines ["a", ""] is "a\n\n", and lines correctly
reconstructs the two lines from this. 
With this suggestion, unlines ["a", ""] becomes "a\n", which, unless you
change its behaviour, lines interprets as representing a single line
["a"], and lines.unlines is no longer the identity function.

--brian


Sigbjorn Finne wrote:
 
 Here's a Prelude inconsistency that's been irking me once
 in a while for a loong time - today it came up again, so here goes:
 
   unlines   ["a","b"]   == "a\nb\n"
   unwords ["a","b"]   == "a b"
 
 I like that
 
   unwords (ls1 ++ [unwords ls2]) == unwords (ls1 ++ ls2)
 
 but not that 'unlines' doesnt' obey the same rule, i.e.,
 
unlines [line1, unlines [line2,line3]]  /= unlines [line1,line2,line3]
 
 Is this by design? I notice that 'unlines' mirrors Miranda's 'lay', but
 I'd find it a little more useful without the trailing \n (esp. considering
 now that putStrLn is std.)
 
 The current defn of 'unlines' doesn't keep me up at night, but still.
 
 --sigbjorn




RE: unlines: the mystery of the trailing \n

2000-08-07 Thread Mark P Jones

Hi Sigbjorn,

| Here's a Prelude inconsistency that's been irking me once 
| in a while for a loong time - today it came up again, so here goes:
| 
|   unlines   ["a","b"]   == "a\nb\n"
|   unwords ["a","b"]   == "a b"
|
| [... unwords adds space between items, not at the beginning or end;
| unlines puts a newline after each item, including at the end ...]

I quite like the fact that the definition for unlines gives us laws
like:

  unlines (xs ++ ys) = unlines xs ++ unlines ys
  unlines . concat   = concat . map unlines

Of course, the fact that unwords doesn't add a terminating space
means that we don't get quite such nice laws for unwords ...

All the best,
Mark