Sven
You are a star of the first magnitude. You are hereby
awarded the GHC Bug Exterminator Trophy. This is an actual
thing: a plant-spray bottle with a red bow and a hall of
fame written on it. Consider youself added to this illustrious
band.
Thanks for hunting this one down.
Simon
When reading from a socket using hGetLine, 8bit characters cause
fatal error, e.g.:
Fail: Prelude.Enum.toEnum{Char}: out of range: -77
--
__("Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
\__/ GCS/M d- s+:-- a22 C++$ UL++$ P+++ L++$ E-
^^
The following program (ghc-4.02):
f :: [Int] - Int
f (i:is) | trace "0" False = error []
f is | trace "1" False = error []
f is = f $ tail is
main = putStr $ show $ f [0]
Outputs:
1
Fail: Prelude.tail: empty list
wheras it should have output:
0
1
Fail:
When reading from a socket using hGetLine, 8bit characters cause
fatal error, e.g.:
Fail: Prelude.Enum.toEnum{Char}: out of range: -77
I think I found it. The bug always occurs in NoBuffering mode.
--- ghc/lib/std/cbits/readFile.c.orig Sun Feb 7 23:03:38 1999
+++
The Haskell report (4.4.2) says that if the infixity is
not specified, it should be "infixl 9". So adding/removing
the infixl should have no effect.
Is GHC giving (:++) the wrong default infixity?
Yes it is. I've just fixed my copy and will check it in tomorrow.
Thanks Andy
Simon
Thu, 1 Jul 1999 06:15:11 -0700, Simon Marlow [EMAIL PROTECTED] pisze:
What problem are you having getting ghc-4.02 to compile?
[...]
===fptools== Recursively making `all' in std exts concurrent misc posix ...
PWD =
Simon Peyton-Jones wrote:
Kevin
Simon has built your library with the current GHC and it's happy.
So at the moment we can't reproduce your problem.
Is it happy when you comment out the "import Eval" in Main.hs?
Have you still
got it? (After doing your cvs update.)
Updated tuesday
Hi there,
The following program (ghc-4.02):
f :: [Int] - Int
f (i:is) | trace "0" False = error []
f is | trace "1" False = error []
f is = f $ tail is
main = putStr $ show $ f [0]
Outputs:
1
Fail: Prelude.tail: empty list
wheras it should have output:
0
1
Fail: Prelude.tail:
Hi!
consider this piece of code:
\begin{code}
class Dumb a where
foo, death, something :: a
instance Dumb Int where
foo = 1
death =
something = 1
\end{code}
yields 'Internal Happy error' with CVS from 1999/06/30 and happy-1.5 (sorry,
I didn't
1 Jul 1999 00:00:52 GMT, Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] pisze:
When reading from a socket using hGetLine, 8bit characters cause
fatal error, e.g.:
Fail: Prelude.Enum.toEnum{Char}: out of range: -77
I think I found it. The bug always occurs in NoBuffering mode.
---
The following program:
module Main where
infixl 9 :++
data T = T1 | T :++ T deriving (Eq,Show, Read)
t :: T
t = read "T1"
main = print t
fails to terminate under GHC. This is a known problem with
the deriving Read. However, if you remove the
Kevin
Simon has built your library with the current GHC and it's happy.
So at the moment we can't reproduce your problem. Have you still
got it? (After doing your cvs update.)
Simon
-Original Message-
From: Kevin Atkinson
Sent: Monday, June 28, 1999 8:10 AM
To: [EMAIL PROTECTED]
Simon Peyton-Jones wrote:
Hmm. Your example relies on inlining 'arr' at its call site.
My guess is that you aren't using -O. In that case, there's no
cross-module inlining, so 'arr' doesn't get inlined.
Is that it?
No:
[kevina@kevins-linux Rules]$ make clean
rm -f *.o *.hi
Malcolm Wallace wrote:
Mark P Jobes wrote:
| Something like the following can be used in Hugs 98:
|
| f x = case x of
| (a,b) - case a of
| (c,d) - case b of
| (e,f) - [c,d,e,f]
You can't be serious! This is a great example of mis-using layout to
baffle
Koen Claessen wrote:
Hello all,
I believe the following program is valid Haskell'98:
module Main where
data Hash = Hash{ (#) :: Int }
deriving (Show, Read)
main =
do print s
print (read s :: Hash)
where
s = show (Hash 3)
The problem is the use of (#) as a field
Hello all,
I believe the following program is valid Haskell'98:
module Main where
data Hash = Hash{ (#) :: Int }
deriving (Show, Read)
main =
do print s
print (read s :: Hash)
where
s = show (Hash 3)
The problem is the use of (#) as a field name.
The expected output of the
First, a preface to my comments on layout processing: it seems to me
that the purpose of the layout rules is to give the programmer FOWIM
(Figure Out What I Mean) syntax. Hence, if it isn't immediately clear
to a human reader what grouping is intended, then the layout rules are
not helping.
At 00:59 -0700 1999/07/01, Mark P Jones wrote:
| Quick quiz: how many Haskell lexemes are represented by the following
| sequences of characters?
|
| 1) M.x
| 2) M.let
| 3)M.as
| 4) M..
| 5) M...
| 6) M.!
Interesting examples! However,
Kevin Atkinson wrote:
Ok you haskell experts. I have an interesting challenge (or maybe just
a question if you have seen it before).
Is it possible to zip two sequences together with just:
cons :: a - c a - c a
empty :: c
foldr :: (a - b - b) - b - c a - b
And if so how would one
Hi Simon (again!)
| I just uncovered a couple of strange cases in the Haskell lexical syntax.
| If you're not especially bothered about such things, don't bother to read
| on!
|
| Quick quiz: how many Haskell lexemes are represented by the following
| sequences of characters?
|
| 1)
Kevin Atkinson wrote:
Assuming that
you allow pairs and lambda expressions you can do it like this:
caseList xs n c =
fst (foldr (\ x (_, xs) - (\ n c - c x xs, x `cons` xs))
(\ n c - n, empty) xs) n c
zip =
foldr (\ a g ys - caseList ys empty ( \ b bs
Kevin Atkinson wrote:
cons :: a - c a - c a
empty :: c
foldr :: (a - b - b) - b - c a - b
I am not an expert. I have a minor problem with this, the type of
empty: if c stands for a type constructor then empty should have type
(c a). Moreover, I don't understand why you use 'c' for lists
Mike Gunter wrote:
Remember you may ONLY use the three functions given above and NOTHING
else. Creating a list with "foldr (:) []" is also not allowed.
Only? How do I construct a pair? (I'm probably misunderstanding you.)
What I meant to say is that those three functions are the ONLY
Laszlo Nemeth wrote:
Kevin Atkinson wrote:
cons :: a - c a - c a
empty :: c
foldr :: (a - b - b) - b - c a - b
I am not an expert. I have a minor problem with this, the type of
empty: if c stands for a type constructor then empty should have type
(c a).
Yes (c a) typo.
Kevin Atkinson wrote:
Lennart Augustsson wrote:
No, it will not be as efficient. foldr is not the right primitive for making
functions on lists. You want the more general
recurse :: (a - c a - b - b) - b - c a - b
Could you give me some refrence on how that function is used as this
Lennart Augustsson wrote:
No, it will not be as efficient. foldr is not the right primitive for making
functions on lists. You want the more general
recurse :: (a - c a - b - b) - b - c a - b
Could you give me some refrence on how that function is used as this is
the first time I herd
Kevin Atkinson wrote:
Laszlo Nemeth wrote:
[snip]
foldr (\ a g ys - case ys of
[] - empty
(b:bs) - (a,b) `cons` g bs)
(\ _ - [])
But only for lists. As you are patern matching on ":".
Apply the old "predecessor" trick to get the
27 matches
Mail list logo