Main.hs:3: parse error on input ';' (inserted by layout)
Incomplete expression on previous line or incorrect
indentation of the current line.
I think Manuel's suggestion is a definite improvement here.
For interest, another Haskell compiler, nhc98, gives the message
4:5
Sigh. I guess we need real IO versions of readStuffOffAddr. That means
adding another 9 primops, taking the total to 260 :-(
Am I not right in thinking that read/writeStuffOffAddr is now obsolete
anyway? Looking at Sven's FFI proposal, all the variations are now
subsumed under the Storable
Sven writes:
Does ghc have a problem with the 'primitive' declaration? [...]
Exactly. In GHC (and probably already in NHC, too. Malcolm?) you
have to write
foreign import unsafe getRandomSeed :: IO Int
Yes, since 1999-11-19, nhc98 also supports the new FFI.
Regards,
Malcolm
Depending on the OpenGL version there are #defines
or a big enum. So the only portable way without litlits would be a
small automatically generated C program that is run as part of
HOpenGL's configuration process and outputs Haskell definitions or
#defines for all needed constants.
It appears that the library Native has disappeared between 4.04 and
4.06, in the big hslibs reorganisation. Can we expect it to return,
and if so, when will it come back?
Regards,
Malcolm
(P.S. I'm mainly interested in showBytes, which is used within the
nhc98 compiler. If it's not
Sven writes:
Both GHC and Hugs have a bug in their Prelude for Ratio's Enum
instance. ... The reason for this
is that the default method for enumFromThenTo is used, which truncates
4%3 to 1 (same for enumFromTo).
I'd say that this is a bug in the Library
ghc-4.06 (downloaded from the ftp site; I haven't tried the current
CVS version) appears to have a bug in the FFI, demonstrated by the
following code using Floats.
float.c
int floatToInt (float fl) {
union {
float f;
int i;
} tmp;
tmp.f = fl;
return tmp.i;
}
end
[Thread moving to [EMAIL PROTECTED] - please follow-up there.]
| It seems rather horrible to me, but I imagine the rationale is
| that the primitive FFI should not be C-specific.
|
| Not only that: You can't dictate that all implementations of Haskell
| have to use e.g. int for Int.
I
Fail: Prelude.chr: bad argument
nofib/real/compress2 fails with the same message, for us.
We haven't investigated. Perhaps it's the same bug.
With a quick grep through the two programs, my guess is that 'toEnum'
is being specialised at type Char to an internal function 'chr', and
that
The ``foreign import'' bug for Float types is still present in ghc-4.08.
(I think Floats are being silently promoted to Doubles, which as far
as I can tell is wrong - this is a difference between KR1 and ANSI C.)
Regards,
Malcolm
Main.hs
module Main where
foreign import floatToInt
| The ``foreign import'' bug for Float types is still present
| in ghc-4.08.
This bug is definitely present in the native code route.
It would be good to know if the bug exists on the via-C route.
If you recompile with -fvia-C (perhaps check with -v to be sure
it really does go via C),
Going via C is fine, as long as you -#include the relevant prototype for the
C function you're calling. Otherwise the C compiler automatically promotes
the arguments/result to doubles and you're hosed.
There's been a great deal of discussion on the FFI list (as I'm sure you've
seen) about
The program shown below elicits a complaint about pattern overlap for
doMem1. I don't expect any complaint.
doMem1 (NUMOP ADD e1 (CONST i)) = 1
doMem1 (NUMOP ADD (LREF lab) (CONST i)) = 4
doMem1 (NUMOP SUB e1 (CONST i)) = 3
doMem1 (NUMOP SUB (LREF lab) (CONST i)) = 6
I
I just tried to compile this:
module Fib where
foreign export fib :: Int - Int
fib 0 = 1
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
using GHC 4.08 under Linux,
$ ghc -c Fib.hs -fglasgow-exts
panic! (the `impossible' happened):
tcLookupGlobalValue: THIS.PrelIOBase.returnIO{-0B,s-}
-- broken fragment
instance (Typeable a, Typeable b) = Typeable (a,b) where
typeOf (x,y) = "("++(typeOf x)++ ","++(typeOf y)++")"
--
Is this too strict? It never uses the tuple or its arguments yet
tries to construct the tuple anyway.
Yes, this is too strict, but no, Haskell is
But we're not changing any of the terminal flags, simply setting
the same ones again.
I'm totally stumped! Any ideas, anyone?
According to the manual page,
tcgetattr() ... This function may be invoked
from a background process; however, the terminal
I downloaded the 4.08.2 binary bundle for sparc, and did
./configure
make install
For some reason it appears to want to rebuild lots of things.
Anyway, after some time, I get
../../ghc/driver/ghc-inplace -recomp -cpp -optC-fglasgow-exts -fvia-C
-Rghc-timing -I../../ghc/includes
I don't understand this. Since the binary bundle does not
include any source code, how can it start to compile bits of
itself at installation time?
That puzzled me too. It's egg-on-face time. (But whose face? :-)
After unbundling the binary package, I cd'd to the fptools directory,
just
of hmake
interactive for some time, and is also attached below if you want
to steal and modify it.
Regards,
Malcolm
cut here
{- Either use ReadLine, or a dumb replacement.
-- Copyright Malcolm Wallace, 2000.
-- Open source licensed under the same terms as nhc98.
-}
module SimpleLineEditor
Thomas Hallock [EMAIL PROTECTED] gets the following error on
MacOS X when trying to build nhc98 with ghc. I think this must
either be a bug in ghc, or some incompatibility between ghc and zsh.
Bug report forwarded to the glasgow-haskell-bugs list for comments
from the ghc folks.
I get this
I discovered a problem with Xml2Haskell which is possibly a (small) bug.
You are right. Thanks for the report. I have made a patch available
atftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/patch-1.02-dtdtohaskell
By the way,
| Here's the DTD:
|
| !DOCTYPE Root [
| !ELEMENT Root (
foo :: Int - Int
foo (i+1) = i
foo 0 = -10
Q.lhs:5: Warning: Pattern match(es) are overlapped in the definition of
function `foo':
foo 0 = ...
| This is acceptbale behaviour, since the first equation can match with i = -1.
| The type is Int, not Nat.
No, it is not
My understanding is that the following script:
- cut here -
foo :: Int - Int
foo _ = 2
\begin{code}
bar :: Int - Int
bar _ = 1
\end{code}
- cut here -
should be valid and define foo and bar (although the report does say It
is not advisable to mix these
% cat manyfiles.hs
main :: IO ()
main = do
readFile manyfiles.hs
main
% ghc -o manyfiles manyfiles.hs
% ./manyfiles
Fail: resource exhausted
Action: openFile
Reason: process file table full
File: manyfiles.hs
In fact nhc98 behaves the same, but hugs seems to do better
chars =
foo
bar
You *are* violating the Haskell 98 spec, I'm afraid :)
No he isn't. At least, I can't find anything in the Report which
disallows literal newline characters in a string literal.
Oh, hold on. The production
string - { graphic_|` | space | escape | gap }
does
On the contrary I'm glad to see that the Haskell standard is so sensible.
I edit Haskell using XEmacs, and I don't want to have to do an octal
or hexadecimal dump of my source code to determine whether a string
contains a tab, newline, return, line feed, Unicode en-space (there are
several
Someone might want to take a look at the web page
http://www.haskell.org/ghc/download_old.html
and update it. Under 'Distributions', it claims that the latest
binary version of ghc available for any platform is 4.08.
Regards,
Malcolm
___
This program:
module Main where
f = map (++a++b)
g = map (a++b++)
main = do print (f [x,y,z])
print (g [x,y,z])
gives the following error messages with ghc (versions 4.08.2 and 5.02):
plusplus.hs:3:
The operator `++' [infixr 5] of a section
The binary package of ghc-5.02.2 for sparc-sun-solaris2.7 seems to have
a small problem on my Solaris 2.6 machine. The compiler works fine
on most source modules, but it has trouble with one using the FFI.
A previous version of the compiler (4.08.2) worked fine on the same
module, and 5.02.2 on
$ ghc -fglasgow-exts -package lang -c -o Floats.o Floats.hs
In file included from
/export/home/malcolm/lib/ghc-5.02.2/include/Stg.h:206,
from /tmp/ghc21103.hc:1:
/export/home/malcolm/lib/ghc-5.02.2/include/PrimOps.h:976:
parse error before
Dylan Thurston [EMAIL PROTECTED] writes:
Thanks for pointing this out; this seems to be another bug in ghc
5.02.2. According to the report, it seems unambiguous that, e.g.,
-5`div`2 should be -2, not -3.
Yes,-5`div`2 == -(5`div`2) == -2
but (-5)`div`2 == -3
Ghc 5.02.2 has the
when building nhc98 with ghc-5.04 I got the following error:
Fail: Can't find module PrelBase in
.
Or in standard libraries at
/usr/local/lib/ghc-5.04/imports/base
...
Asked for by: Decl.lhs
[Check settings of -I or -P flags?]
Anyway, this seems to be a ghc
Does anyone know what might be causing the following error from a
program that uses System.system?
Fail: interrupted
Action: system
Reason: Interrupted system call
The shell command given to System.system runs and terminates with a
non-zero exit code (actually 8). I expected to bind
Alastair Reid [EMAIL PROTECTED] writes:
It sounds a little like a problem I had where trap 26 (I think this is
a timer signal) was interrupting the subprocess. Nowadays I use this
function:
my_system :: String - IO ExitCode
my_system xs = do
-- putStrLn xs -- for debugging
Dean Herington writes:
| Using GHCI 5.04.2, ... the '' character of a '-' lexeme
| appears in bold on my terminal.
Is it possible that your terminal is set up for syntax-highlighting,
or that you are using GHCi from within something like emacs where
such a facility might be available? For
The interactive loop of ghci displays an interesting evaluation fault
to do with derived equality. In the attached source file, there is
a simple guard which tests some equalities, and basically the same
value is given on the left and right of the (==). Yet, it evaluates
to False in interactive
Hi GHC folks,
I'm trying to build ghc-5.04.3 from source on a sparc-solaris-2.6
machine, using 5.02.3. It throws up the following build error.
Any ideas what might be going wrong?
Regards,
Malcolm
rm -f System/Time.o; if [ ! -d System/Time_split ]; then mkdir System/Time_split; else
Simon Marlow [EMAIL PROTECTED] writes:
I'm trying to build ghc-5.04.3 from source on a sparc-solaris-2.6
machine, using 5.02.3. It throws up the following build error.
Any ideas what might be going wrong?
I'm not sure, and I'm afraid our one and only Sparc box has just died,
probably
I'm trying to build ghc-5.04.3 from source on a sparc-solaris-2.6
machine, using 5.02.3. It throws up the following build error.
Any ideas what might be going wrong?
/tmp/ghc11170.hc: In function `SystemziTime_zdLrpHVeta_entry':
/tmp/ghc11170.hc:10508: called object is not a function
If it
_ccall_result = (timezone()); /* line 10508 */
What does mk/config.h say about HAVE_ALTZONE? On a Solaris 8 box I'm
looking at it says HAVE_ALTZONE is defined.
$ grep ZONE mk/config.h
/* #undef HAVE_ALTZONE */
/* #undef HAVE_TIMEZONE */
#define TYPE_TIMEZONE
OK, I'm building ghc-5.04.3 freshly from source, but when running
./configure initially, I forgot to use the --prefix= option to set the
final installation location. Now, after fourteen hours of building,
I use `make install' and discover the mistake. :-( How can I recover
the situation?
I
Serge D. Mechveliani [EMAIL PROTECTED] writes:
ghc -c -fwarn-unused-matches
says
Warning: Defined but not used: x
when compiling the function
f :: Eq a = [(a, a)] - (a, a) - [(a, a)]
fps (x, y) = [(z, y) | (z, x) - ps]
Is it a bug?
No. The x on
Ralf Hinze [EMAIL PROTECTED] writes:
I am posting the following bug report every once in a while.
Main mirror []
ERROR - Cannot find show function for:
*** Expression : mirror []
*** Of type: [a]
Instructor:
it's because `mirror []' has the polymorphic type `[a]' and the
compiler
The following program gives a weird type inference error for me in
ghc-6.2, but compiles perfectly fine in ghc-5.04.2, ghc-6.0, nhc98,
Hugs, etc.
module Bug ( mkRational ) where
import Ratio
data Lex = L_RATIONAL Rational
mkRational :: Integer - Integer - Integer - Integer -
Simon Marlow [EMAIL PROTECTED] writes:
* package extra-ghc-opts are propagated to all
compilations, whether those compilations use that package or
not.
Indeed - I don't recommend the use of extra_ghc_opts at all.
OK, noted. I realised later that the extra options
Simon Marlow [EMAIL PROTECTED] writes:
Incedentally, GCC 3.4 will make this situation even worse. They have
now taken the approach that a backslash followed by whitespace at the
end of the line should be interpreted as a line continuation (and a
warning is emitted). So the hack from the
Comment By: Simon Peyton Jones (simonpj)
Turns out not to be a bug.
--
Comment By: Esa Ilari Vuokko (eivuokko)
It appears that I had an autopackage installed that had
-fglasgow-exts enabled. Sorry for the noise.
The Haskell'98 Report specifies that 'read'ing an Int should accept
only decimal notation
instance Read Int where
readsPrec p = readSigned readDec
(or near equivalent), yet ghc seems to read hexadecimal Ints.
Prelude show (Char.chr (read 0x2B :: Int))
'+'
Prelude
Ghc's
OK, here's a strange bug. I have a program (hat-trail) that uses
System.system(stty -icanon -echo) together with resetting the
buffering of I/O, in order to get so-called character-break mode on the
terminal. Once the program is finished, it calls System.system(stty
icanon echo) to restore the
Simon Marlow [EMAIL PROTECTED] writes:
It would appear that ghc-6 is being careful to save the current state
of the terminal at the point of hSetBuffering, and to restore it on
exit, something ghc-5 did not do. But paradoxically, this safer
choice caused things to mess up, instead of
Simon Marlow [EMAIL PROTECTED] writes:
I tend to think that changing the terminal settings for NonBlocking
Handles attached to TTYs is the right thing, because it leads to fewer
confused users.
And I tend to agree.
GHC has always changed the
Using the glibc-2.2 (RedHat 7) Linux binary package of ghc-6.2.1,
the following program:
import System.Cmd
main = do v - system(ghc --version 21)
print v
incorrectly gives
ExitFailure 127
whereas with the glibc-2.3 Linux binary package of ghc-6.2.1, the
same program
Simon Marlow [EMAIL PROTECTED] writes:
import System.Cmd
main = do v - system(ghc --version 21)
print v
Are you sure your shell understands the '' syntax? Not all do.
Yes, on RH7.2, /bin/sh is bash.
Assuming you're using the same shell in both cases, this could
But if I have two layers over gtk 1.2 and 2.0 and both use the
hierarchical module system and are therefore marked as auto you
would have the same problem of linking in two versions of gtk which
doesn't work. Did I miss something?
The auto flag does *not* mean uses hierarchical module
It seems that I am unable to use -fvia-c with ghc, because it gives
some C header file conflicts. Here is the observable problem:
$ ghc-6.2.1 -c -fvia-c /tmp/ghcbug.hs
In file included from /usr/include/stdlib.h:414,
from
Yesterday, I wrote:
It seems that I am unable to use -fvia-c with ghc, because it gives
some C header file conflicts. Here is the observable problem:
$ ghc-6.2.1 -c -fvia-c /tmp/ghcbug.hs
In file included from /usr/include/stdlib.h:414,
from
$ ghc-6.2.1 -c -fvia-c /tmp/ghcbug.hs
In file included from /usr/include/stdlib.h:414,
from
/usr/malcolm/local/lib/ghc-6.2.1/include/Stg.h:200,
from /tmp/ghc1723.hc:3:
/usr/include/sys/types.h:190: conflicting
Simon Marlow [EMAIL PROTECTED] writes:
Now presumably the gtk/Graphics/UI/Gtk/General/Signals.hi file
remembers the module name. So ghc reads the module name from
gtk/Graphics/UI/Gtk/General/Signals.hi and then for some reason looks
for Signal.hi which of course it cannot find.
I don't
Calling MacOS X experts...
Sorry to pollute the ghc list with nhc98 questions, but AFAIK most
of the relevant people inhabit here. Any help would be gratefully
received.
I am having problems with getting nhc98 to work under Mac OS 10.3.x.
It builds just fine with ghc (6.2.2), and appears to
Yong Luo [EMAIL PROTECTED] writes:
I installed a very old version of GHC in the same laptop in 2001 and it was
working well (no matter how big the program was). Now, I upgraded it to
version 6.2.2, but it becomes very slow and asks more Memory or Space.
Well, if you are using mainly
Simon Peyton-Jones [EMAIL PROTECTED] writes:
A difficulty is that the caller of 'head' might itself be called from
somewhere else:
foo (xs, ys) = head xs
It's all very like cost-centre stacks, which is why GHC provides the -xc
option when you are profiling. I think that give you
Simon Marlow [EMAIL PROTECTED] wrote:
`thing'
thing
We should be using Unicode left/right single quotes if the locale
supports it (U+2018, U+2019). Better still, use a different color for
quoted code fragments if the terminal supports it.
You could make the highlighting
Frederik Eaton [EMAIL PROTECTED] wrote:
I've been thinking that it would be nice if I could give ghci on
the command line a list of commands to run initially when it
starts.
GHCi can read commands from a .ghci or $HOME/.ghci files.
It's not enough because I work on more than one
GHC [EMAIL PROTECTED] wrote:
#1002: ghc-6.6 sometimes hangs under Solaris
After compiling 643 modules (in 5 minutes) ghc-6.6 did not finish its
batch job.
[643 of 643] Compiling Main ( hets.hs, hets.o )
Linking hets ...
gmake: *** [hets] Killed
gmake: *** Deleting file
#1232: unix-compatible interpreter needed for ghc
Comment:
Aren't you just looking for 'runhaskell', already widely used for this
purpose:
No, Frederik's point is that runhaskell currently insists the file be
named with a .hs or .lhs suffix, and he would like this restriction to
be
GHC [EMAIL PROTECTED] wrote:
#1393: Tag source tree with successful bootstraps
--- Comment (by claus):
i've been bitten by that, too. but given the time needed for build
tests, the buildbots would have to tag the repos before starting
their build,
Not so! Darcs is _distributed_
Someone has recently (since 6.8.3) taken a style pass over
`IntMap.hs`.
Apparently they didn't like reusing identifiers in different scopes,
The reason someone made this change was to eliminate compiler warnings
with -Wall, and as you rightly point out, the refactoring has
introduced a
#3709: Data.Either.partitionEithers is not lazy enough
This is a behavioural change, e.g.:
Main case partitionEithers1 [Left 'a', error Not me] of (x : _,
_) - x
Program error: Not me
Main case partitionEithers2 [Left 'a', error Not me] of (x : _,
_) - x
'a'
Yes, and isn't that the point
foreign import ccall PlaySound play :: CString - Int32 - Int32 -
IO Bool
Is it possible that the foreign function should use the stdcall
convention rather than ccall?
IIRC, the difference is in who is responsible for cleaning the the
stack after the call returns, which might match one of
Uh-oh. We've started to get comment-spam on the trac.
Regards,
Malcolm
On 23 Apr 2010, at 12:49, GHC wrote:
#3400: OS X: ghc broken on Snow Leopard
---
+
Reporter: bbb | Owner: igloo
Type:
From compiler/utils/Outputable.lhs
{{{
-- quotes encloses something in single quotes...
-- but it omits them if the thing ends in a single quote
-- so that we don't get `foo''. Instead we just have foo'.
quotes d = SDoc $ \sty -
let pp_d = runSDoc d sty in
case show
Replying by email, since my account on the trac is blocked.
Open Shake implements the finer resolution timestamps needed using the Win32
API. You may want to copy/adapt the code from there:
72 matches
Mail list logo