What do you all think about activating the mechanism that
automatically includes the name of the list before the subject
of a mailing list email?
For example:
[hugs-users] Installation problems or [haskell] newbie
question.
I don't like the extra prefixes, but if most folk would
Can someone help me understand how this works? I've been
reading the paper Asynchronous Exceptions in Haskell. This
gives a combinator
finally :: IO a - IO b - IO s
finally a b =
block (do {
r - catch (unblock a) (\e - do { b; throw e });
b;
return r; })
I don't think this is compatible with things like adding support
for the library hierarchy with multiple dots to Haskell 98 as you
will then be able to write a program that is valid Haskell 98 by
todays definition but not yesterdays. OTOH if what you mean is
adding support incrementally to
[ Ketil Malde asks about recent spam on Haskell mailing lists... ]
How about disallowing non-subscribers from posting? This list is my
main source of spam these days. (Effective filtering is your friend)
My apologies for this spam that got through. Mailman's automatic
filtering catches
There is something strange about the Haskell'98 Numeric library,
which I think could be considered a bug of sorts. There are functions
readDec, readOct, readHex :: (Integral a) = ReadS a
which read an integer from a string in base 10, 8, or 16, but there
are no corresponding show
A quick look at the source looks like both GHC and NHC will
simply pass
on errors from the OS, so for example with
module Main where
import IO
import Directory
main :: IO()
main = do catch (createDirectory this/does/not/exist/foo)
(\e -
There are a couple things to do that can at least cut down on spam.
1) Make sure that your mail gateway, or (in this case) the mailing
list host is not an open relay site.
It isn't.
2) Every time you get spam, locate all the hosts it came through
in the header.
Or alternatively
I'm curious, how does GHC determine that the CAF is no longer required
if it is referenced by code (somehow)? If code was also some kind of
heap allocated data structure I guess this would be possible, but I
thought this wasn't so with GHC.
GHC actually tracks references to top-level
Well, how about the following little circular program?
paths :: () - [Path]
paths () = let r = T : branch r in r
As far as I can understand what you are looking for, I think
this meets
the bill. Every use of the expression `paths ()' will re-evaluate
the infinite
You can't rely on adding dummy arguments to cause re-evaluation:
full-laziness (enabled when optimisation is on in GHC) will do the
opposite transformation.
Well in this case, you may find it harder to claim that the full
laziness transformation constitutes an `optimisation'. Maybe the
Ian Lynagh writes:
Sorry, I meant hugs and ghci only seem to print the warning the first
time I run the program, e.g. with
module Main where
import IOExts
main :: IO()
main = trace foo (putStrLn bar)
in hugs:
[...]
Type :? for help
Main main
I've just been looking at using cpp in Haskell scripts and I am rather
confused. I can't see anything in the report which gives
special meaning
to # in the surrounding text of literate scripts, yet if I put such
things in (both cpp directives and random things) both nhc98 and ghc
give me
In the table of precedence in the original Report (now deleted in
the revised Report), it makes it clear that a rightward-extending
let, if, or lambda has a lower precedence than an infix operator,
so for instance the parse
h = (let op x y = y in (3 `op`))
is correct and
On Mon, Feb 25, 2002 at 05:07:35PM -, Simon Marlow wrote:
On the other hand, one way to fix this problem *is* to specify the
relative precedence of 'let' co. as compared to infix operators
(namely that 'let' should have a lower precedence). That would be a
reasonable fix
Recently, I wrote a function similar to
x :: a
x = x 42
which is type-correct (Hugs, Ghc, THIH).
Still, from the expression it is clear
that the type shoud have a function type.
The definition
x :: a - b
x = x 42
is equally well accepted, though I can't
see why this type would
On 10 Mar 2002, Jyrinx wrote:
In the case expression at the end of countAll, each of the
values looks
to me like a recursive tail call - I should think (hope?)
that it would
be optimized by GHC into a goto statement (a la Scheme). Instead, my
program eats up memory (I've got 256
I'm hoping that a GHC honcho will say
Well of course that happens with 5.02.2 - you should
upgrade to 5.03 right away.
or some such.
I'm afraid not :-) But there *is* a bug in the native code generator in
5.02.2, namly in the FFI support for passing floating point arguments to
does there exist a program that'll take a layed out haskell
program and
output one that uses braces and semis to delimit?
You can use GHC's hssource package to parse then pretty-print the
source code - the pretty printer can generate output with explicit
layout tokens if you ask for it.
That is a shame. I tried both suggestions (specifying
position explicitly
and recompiling with fvia-c -- i had been using O all along)
and neither
worked :(.
I also tried using 5.03, and got the following warnings:
[ message deleted ]
It looks like there are some prototypes missing:
I'm curious about the implementation of Concurrent Haskell in GHC and
Hugs. Does access to values possibly shared among threads
cost the same
in Concurrent Haskell as in regular Haskell? I'm guessing
the answer is
yes, because Concurrent Haskell is provided by default in
GHC.
yes
Is it possible to get the result of function happyError, in
the main module
of my program (which imports the module generated by Happy)?
Sure. You need to use Happy's %monad feature, the documentation
describes how to turn parse errors into something you can handle in the
program:
The (Interactive) Glasgow Haskell Compiler -- version 5.02.3
==
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version 5.02.3. The source distribution is
freely available via the
In my NLP.Prelude file, I define:
newtype Token = Token [Word8]
and I export only the type, not the constructor because I
don't users of
my package to be able to inspect/modify the list directly.
However, in my
NLP.IO module, in which I define IO for some of my data
types, I need
I don't believe that it will break many programs. How many programs
produce large *input independent* output, that is not already
literally in the source, in a caf with a long life-time?
That sounds like a description of all the animation programs in Paul
Hudak's School of Expression
I errorneously specified categories as
class (Eq object, Eq morphism) =
Category id object morphism | id -, id - morphism
where o :: id - morphism - morphism - Maybe morphism
dom, cod :: id - morphism - object
it should have been
class (Eq object, Eq morphism) =
to me:
Simon Marlow [EMAIL PROTECTED]
[1] IDoc - A No Frills Haskell Interface Documentation System
http://www.cse.unsw.edu.au/~chak/haskell/idoc/
[2] HDoc http://www.fmi.uni-passau.de/~groessli/hdoc/
___
Haskell mailing list
[EMAIL PROTECTED]
http
I just tried haddock-0.1. Good thing! Two quibbles, though:
* the parser chokes on CVS headers like -- $Id ...$
( but -- -- $Id ..$ is OK)
Yes, because '-- $' has a special meaning in Haddock (it's a named
documentation comment).
* is there support for hierarchical namespaces?
( with
I'm pleased to announce version 0.2 of Haddock, a documentation
generation tool for Haskell source code. It's available from
http://www.haskell.org/haddock/
The changes relative to version 0.1 are listed here:
http://www.haskell.org/haddock/CHANGES.txt
Cheers,
Simon
However, if I now comment out the functional dependency
class Encode a b {- | a - b -} where
encode :: a - b
and include the expressions
x = encode TimeExceeded ExcTTL
main = putStrLn x
then Hugs complains
ERROR codes.hs (line 37): Unresolved top-level overloading
***
I think you're running into a well-known(*) problem with Hugs's
implementation of the monomorphism restriction.
(*) actually I thought this was a well-known problem, but it doesn't
seem to be mentioned in the Hugs documentation as far as I can see.
Here's a bit of background I managed to
An interesting revelation just occurred to Simon P.J. and myself while
wondering about issues to do with exceptions in the IO monad (see
discussion on [EMAIL PROTECTED] if you're interested).
The question we were considering was whether the following should hold
in the IO monad:
(return
To find out how Haskell implementations treat negated
literals, I tested
the following program:
main = print (minusTwo,trueOrFalse)
minusTwo = -2::N
trueOrFalse =
case minusTwo of
-2 - True
_ - False
data N =
I'm pleased to announce version 0.3 of Haddock, a documentation
generation tool for Haskell source code. It's available from
http://www.haskell.org/haddock/
The changes relative to version 0.2 are listed here:
http://www.haskell.org/haddock/CHANGES.txt
Cheers,
Simon
Ralf Hinze [EMAIL PROTECTED] writes:
The haskell mailing list is getting an increasing amount of
spam, viruses, and virus warnings. Would it be possible
to change the list policy to only allow submissions from
subscribed members? Please?
I'd like to second this. The amount of
The (Interactive) Glasgow Haskell Compiler -- version 5.04
We are pleased to announce a new major release of the Glasgow Haskell
Compiler (GHC), version 5.04.
I'm pleased to announce version 0.4 of Haddock, a documentation
generation tool for Haskell source code. It's available from
http://www.haskell.org/haddock/
The changes relative to version 0.3 are listed here:
http://www.haskell.org/haddock/CHANGES.txt
Cheers,
Simon
If this is true, then is it equivalently safe to wrap the following
Haskell action in unsafePerformIO:
myFunc i =
do arr - newArray (0,255) 0
mapM_ (\j - writeArray arr j (i+j)) [0..255]
foo - newIORef 0
mapM_ (\j - readArray arr j = modifyIORef foo (+j))
Here's my take on the Unicode issue. Summary: unless there's a very
good reason, I don't think we should decouple encoding/decoding from
I/O, at least for the standard I/O library.
Firstly, types. We already have all the necessary types:
- Char, a Unicode code point
- Word8, an octet
-
Can't we make a mailing list for these issues?
[EMAIL PROTECTED] is my proposal, who can create such a list?
I'll set up the list. Anyone wish to volunteer to moderate it?
Simon
___
Haskell mailing list
[EMAIL PROTECTED]
tis 2002-08-13 klockan 11.57 skrev Simon Marlow:
Can't we make a mailing list for these issues?
[EMAIL PROTECTED] is my proposal, who can create
such a list?
I'll set up the list. Anyone wish to volunteer to moderate it?
Does it have to be moderated? This will make things
I can't seem to figure out what the difference is between using
evaluate (runST action)
and
stToIO action
when in the IO monad and running something in ST...they seem to behave
identically...are they?
If they are, why do they have different type signatures (one is ST
tis 2002-08-13 klockan 11.57 skrev Simon Marlow:
Can't we make a mailing list for these issues?
[EMAIL PROTECTED] is my proposal, who can create
such a list?
I'll set up the list. Anyone wish to volunteer to moderate it?
Does it have to be moderated? This will make
I understand that GHC 5.04 has reoganized the network modules,
but somehow my code broke over GHC 5.04...
prepareSocket addr port = do
s - socket AF_INET Stream 6
setSocketOption s ReuseAddr 1
let port' = PortNum port
addr' - case addr of
Just str - inet_addr
Sorry to bother you with a message about spam.
I have noticed two things about this mailing list:
* Every once in a while, we get messages like your e-mail
is under consideration for sending to the list. This
suggests that the mailing list is moderated, and that
there is some
==
The (Interactive) Glasgow Haskell Compiler -- version 5.04.1
==
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version
From: D. Tweed [mailto:[EMAIL PROTECTED]]
Note that (assuming that I'm not missing something) you can
prevent the
moving of expressions involving l in a very ugly way by
noting that these
`dummy argument functions' are polymorphic so that you could write
x1 = f1 (l 1)
x2 = f2 x1 (l
Does Haskell specify how div and mod should behave when
given one or both arguments negative?
Eg, in hugs we get:
div 13 = 0
div (-1) 3 = -1
div 1 (-3) = -1
div (-1) (-3) = 0
and so on.
We usually describe div as the version of division that truncates
towards negative
I am using ghc-5.04 and a code like:
with c ( \c' - hPutBuf h c' (sizeOf c))
fails with Fail: Prelude.undefined when c is a user defined type,
such as a pair:
instance (Storable at,Storable bt) = Storable (at,bt) where
sizeOf (a,b) = sizeOf a + sizeOf b
(I am currently not on this list, so replies, please cc me.)
The later versions of the GNU parser generator Bison, like
ftp://ftp.gnu.org/gnu/bison/bison-1.75.tar.gz (959 KB)
ftp://ftp.gnu.org/gnu/bison/bison-1.75.tar.bz2 (759 KB)
use the macro processing program M4 to
Some quick tests with Hugs +s on a example list that I constructed
with 576 elements give food for thought:
reductions cells
my one liner 403511483
tournament705312288
your penultimax 1671520180
your
==
The (Interactive) Glasgow Haskell Compiler -- version 5.04.2
==
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version
==
The (Interactive) Glasgow Haskell Compiler -- version 5.04.2
==
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC),
Now, we define:
data SMaybe a = SNothing | SJust !a deriving Show
Now, we run:
*Strict Just (undefined::Int)
Just *** Exception: Prelude.undefined
*Strict Just $! (undefined::Int)
*** Exception: Prelude.undefined
*Strict SJust $! (undefined::Int)
*** Exception: Prelude.undefined
Alastair Reid writes:
The workaround is simple enough: add a dummy argument to the CAF (so
that it is not a CAF any more):
main _ = loop 5
and then specify the extra argument when invoking it:
main ()
(This is a pretty standard optimisation technique: we're trading time
Simon Marlow [EMAIL PROTECTED] writes:
Also, GHCi retains CAFs in the same way as Hugs, the difference is
that GHCi can be configured to throw away the results after
evaluation (:set +r).
If I set this flag, does GHCi discard CAFs during evaluation or at the
end of evaluation
With Foo in the file c.out and the module
\begin{code}
module Main (main) where
import IO (openFile, hGetContents, hClose, IOMode(ReadMode))
import System (getArgs)
import Monad (when)
main :: IO ()
main = do [x] - getArgs
let you_want_it_to_work = read x
cout -
I wonder what happens to the port when URI parses http URL
string. Is it
possible to check for : and use the stated port instead of port 80?
Anyone has experience doing it before?
Thanks in advance.
Cheers,
Gek
The Network.URI library will extract the host:port:
authority (fromJust
I was wondering if there is any project that aims to
interpret haskell within haskell.
Is it feasable that a program can import a user's .hs
file that has something like:
greeting :: String
greeting = Something
port :: Int
port = 32 + 33
And the program can parse and execute the
For each call, I believe. An exception might be if the call to nco is
inlined into the calling function, but this is unlikely as nco is
recursive.
So, you're probably better off with:
nco wn = nco'
where wn' = cis wn
nco' = 1 : map (wn'*) nco'
In which case it will
[snip]
It is always a problem to lump things with different semantics into
the same type :-) What I'm arguing is that there should be only one
fixed-duration offset datatype and it should be in terms of (seconds,
picoseconds).
Other fixed durations can be easily defined in terms of this
The following code runs out of file handles, so I am seeking
enlightenment as to why.
-- | add data from a file to the histogram
addFile :: FiniteMap String Int - String - IO (FiniteMap
String Int)
addFile fm name = do
x - readFile name
return (addHist
What is the limit on open files, and why? I think it'd be nice to
just schedule a huge amount of IO operations, and have them all be
performed when required (i.e. when the FM is first accessed).
Apparently, my addDir took the trouble to open the files, but not
generate the FMs -- any idea
You should do the counting strictly:
Just n - case n+1 of n1 - addToFM f w n1
Careful - that case expression doesn't actually force n to be evaluated.
It's exactly equivalent to
let n1 = n+1 in addToFM f w n1
You need to use seq to force evaluation.
Cheers,
I have successfully used the the excellent haskell tools
Happy and Alex in a
couple of parsing projects, but I have failed when trying to
combine a
monadic Happy grammar (using the %monad and %lexer
directives) together with
an Alex generated okenizer, nor are there any such
From: Bayley, Alistair [mailto:[EMAIL PROTECTED]
On a related note, what happened to the source code for the
Haskell Web
Server?
http://research.microsoft.com/~simonmar/hws.tar.gz
Is it no longer suitable for public consumption? (I have a
copy at home somewhere, though).
It's in
Oops. I didn't find that. Thanks for the pointer. (Thinks:
does it work with HUGS?)
It works with the latest hugs, November 2002 (use hugs +N to get the
hierarchical libraries).
A significant amount of my work went into the test cases and
matching the
parsing code against the
a recent post reminded me of a feature i'd like.
for all i know it is already implemenetd in GHC so pointers
are welcome.
i'd like to be able to dump data structures to disk, and later load
them.
A Binary library was discussed recently on the libraries list. The
thread starts here:
==
The (Interactive) Glasgow Haskell Compiler -- version 5.04.3
==
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version
IIRC, something very similar was suggested a while back on
the libraries
list, except that the form beginning with a dot was the
relative module
name (actually I think I prefer it that way).
this seems exactly the opposite of what all file systems do. i know
lateral thinking is
I am planning a Haskell project and I need to access files. Since the
program will be automatically started whenever a mail comes
in I will need
to be able to lock the access to files. Is there any support
for this in some library?
Yes, the Posix library distributed with GHC has support
I am very interested in writing server programs in haskell.
There is a link to a paper and code of haskell web server
in the following page.
http://www.haskell.org/practice.html
I can see the case study paper, but there is no code at
the link location. I think inspecting through code
timer f a = do
t1 - get current time
evaluate (f a)
t2 - get current time
return (different in t2 and t1)
where evaluate is from Control.Exception. could someone tell me how
evaluate compares to seq and deepSeq?
The documentation explains the difference, but it's a bit cryptic.
(1) unhelpful error message from GHCi:
[[
Compiling ParsecPrim ( F:\Haskell\Lib/ParsecPrim.hs,
interpreted )
WARNING: ignoring polymorphic case in interpreted mode.
Possibly due to strict polymorphic/functional constructor args.
Your program may leak space unexpectedly.
Congratulations on the new release. But out of curiosity, I've got to
ask...
Why is the test suite now driven by a python script? Is this a
niche where a 'scripting' language was deemed more suitable than
haskell?
The test driver makes use of 'eval'-style scripting,
Simon P.J. writes:
... So it's reasonable that there should be some language extension.
I'm just looking for the minimal such extension.
unsafeCoerce# is quite a minimal extension :-)
Cheers,
Simon
___
Haskell mailing list
[EMAIL
(moderator, can you please include this mail at the bottom of my
previous mail?)
PS: I think the next example shows pretty well what goes wrong when
you're not closing the read-handle:
---
test = do writeFile' 123.txt blaat
appendFile' 123.txt 1
z - readFile'
The (Interactive) Glasgow Haskell Compiler -- version 6.0
We are pleased to announce a new major release of the Glasgow Haskell
Compiler (GHC), version 6.0.
As
[ replies to [EMAIL PROTECTED] ]
On the whole, I think this is a good direction to explore. I like the
separation of Files from Streams: indeed it would remove much of the
complication in the existing system caused by having Handles which can
be both read and written. Also, it gives a nice way
Haddock version 0.5 is released. Get it from here:
http://www.haskell.org/haddock
Not a great deal has changed from version 0.4, but you need the new
version if you want to build it using recent versions of GHC. Also,
several bugs have been fixed. This is the version of Haddock that we
are
just out of curiosity, which is the proper idiom?
trace a = r - catch a (\e - putStr exceptional\n throw e)
trace a = r - catch a (\e - putStr exceptional\n ioError e)
I am worried that one might subtly change the semantics of an
execption
depending on how it was originally
=
The (Interactive) Glasgow Haskell Compiler -- version 6.0.1
=
We are pleased to announce a new patchlevel release of the Glasgow
Haskell Compiler (GHC), version
Ghc should not accept this code, because, no matter how the
unliterating
is achieved, it is illegal for a literal string to contain a
literal newline character.
Known bug in GHC. In the testsuite, but unfortunately not documented.
Cheers,
Simon
,
Simon Marlow: [EMAIL PROTECTED]
Chris Dornan: [EMAIL PROTECTED]
Isaac Jones: [EMAIL PROTECTED]
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
I'm finishing up my Haskell interface to WordNet
(http://www.cogsci.princeton.edu/~wn/) and have a standard
unsafePerformIO question :).
Basically, the interface functions by first calling an initialization
function, 'initializeWordNet :: IO WordNetEnv'. WordNetEnv is
essentially just a
If the databases *do* change over time, then there are two
possibilities:
1. the contents change due to external factors only
2. the contents change because this program doing the writing
in (1), you can still pretend the interface is pure, by
imagining that
all the changes
Isn't there the possibility of inlining causing a read to
happen twice even if it only appears to happen once?
In theory that would be a valid transformation, but in practice no
compiler would duplicate arbitrary computations. GHC
certainly doesn't.
I was thinking of a situation
On Tuesday, 2003-08-19, 13:18, Simon Marlow wrote:
[...]
Yes, I agree that one shouldn't rely on the no duplication of work
property. However, folloing this argument we arrive at the
conclusion that
hGetContents is an invalid use of unsafePerformIO. (which
is something I've
I have a question about pattern-matching. In the Haskell-report it is
not postulated, that
pattern matching has to be exhaustive. Would it be possible at all to
implement an
algorithm, which checks Haskell-style patterns for
exhaustiveness? What
kinds of
complication can be expected?
I do not completely understand the first part of chapter 3 of the
Haskell-report.
Concretely I am stumbling about the notation of nonterminals
indexed by
their precedence
level. This should be a number ranging from 0 to 9. But what
about this exp^{10} production rule?
The grammar is
I implemented a trivial database, stored in ordinary files,
and had to
ensure mutual exclusion of database access between
simultaneously running
CGI scripts. Since each CGI run is short, I simply locked the entire
database for the entire run. Claiming a lock on a file is
easy in C
Mark Jones writes:
As a solution to that problem, the many-command-line-options
scheme described seems quite poor! It's far too tool specific,
not particularly scalable, and somewhat troublesome from a software
engineering perspective. We're not talking about a choice between
two points
Iavor Diatchki writes:
what do people think should be the tokens produced by a haskell lexer
when applied to the following input:
A...
This has been discussed before (a while back, admittedly). See:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg04054.html
GHC (still) gets this
I agree with Marcin,
A... should be split into A.. and .
As I read the (on-line) report the maximal munch rule says that you
should read the longest lexeme. It does not say that two
operators have
to be separated by whitespace.
Because A... is not a lexeme, the longest lexeme you
{-# LANGUAGE specification #-}
where specification is one or more (if compatible) of keywords like
Haskell98 Pure Haskell 98, no extensions.
SharedExtenisons (Haskell02???) A set of agreed-upon extensions
The report states about getChar, getLine, and getContents:
By default, these input functions echo to standard output.
In version 1.3 of the report, it used to continue
Functions in the I/O library provide full control over echoing.
Apparently, this has been removed and the I/O
I think the proposal is great. Here's some random comments:
It might be worth saying earlier on that the library infrastructure is
expected to be a layer underneath the platform's native package support
(if such support exists). For example, I've never used Python's
Distutils, but I have a
Malcolm Wallace writes:
But the whole purpose of 'interact' is to use its argument as the
demanding function which drives lazy consumption of the input. It is
*designed* to reveal the evaluation behaviour, by hoisting it into
the I/O monad.
This is why interact is bad, IMO: it forces you to
Pardon? Haskell is a non-strict language. Using 'interact' is one of
numerous situations where one takes advantage of non-strict semantics.
(Keith just gave a different example.)
Non-strict semantics does not prescribe the evaluation order, although
usually lazy evaluation is used. I
Alastair Reid writes:
... Thus, we have Show instances for - and IO ...
Actually, you have to explicitly import Text.Show.Functions to get the
Show instance for (-).
Cheers,
Simon
___
Haskell mailing list
[EMAIL PROTECTED]
On Mon, Oct 13, 2003 at 11:13:56AM +0200, Wolfgang Thaller wrote:
The reason why we currently do not take advantage of SMP is
that the
Haskell Heap is a shared data structure which is modified
whenever a
thunk (an unevaluated expression) is evaluated. Using
synchronisation
101 - 200 of 5259 matches
Mail list logo