Terminal does not reset correctly with System.Console.SimpleLineEditor

2004-11-06 Thread Einar Karttunen
Hello

It appears that the console is not reset correctly with
System.Console.SimpleLineEditor. The terminal does not 
echo characters until it is reset. 

The following program demonstrates it:
import System.Console.SimpleLineEditor
main = initialise >> getLineEdited "prompt> " >>= print >> restore

This occurs with the Debian ghc package version 6.2.1 and the binary cvs 
snapshot of 20041017, both on i386 linux and in an xterm.

- Einar Karttunen
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Implicit parameter constraints not inferred

2004-11-06 Thread Benjamin Franksen
On Saturday 06 November 2004 17:57, you wrote:
> Benjamin Franksen wrote:
> > My question: Is this as it should be or is it a bug?
>
> The Monomorphism Restriction.

Grumble... I almost suspected it. Only the context in which I got the error 
originally didn't _look_ as if MR would apply, and when I fumbled with the 
simple test program I just forgot about it.

Sorry to have bothered you and thanks a lot for the answer. Your explanation 
of the MR is the best I've seen so far.

Ben
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Implicit parameter constraints not inferred

2004-11-06 Thread Wolfgang Thaller
Benjamin Franksen wrote:
main = let ?b = True in use_b

--use_b :: (?g::Bool) => IO ()
use_b = print ?b
It isn't: ghc -fimplicit-params says
Unbound implicit parameter (?b :: a)
  arising from use of implicit parameter `?b' at TestBug.hs:4
In the first argument of `print', namely `?b'
In the definition of `use_b': use_b = print ?b
It works if I uncomment the signature.
Using ghc-6.2.2, btw.
My question: Is this as it should be or is it a bug?
The Monomorphism Restriction.
It's intended to prevent people from shooting themselves in the foot by 
defining things that look like constants (like use_b) but really are 
polymorphic values that still depend on some context and therefore are 
not constant.
So in this case (use_b defined with no arguments), you need to specify 
a type signature.

The monomorphism restriction would be useful in situations like:
foo = expensiveOp bar
How often will foo be evaluated?
With the monomorphism restriction, at most once. Without it, well, that 
depends on the type of bar. With bar :: (?g :: Bool) => Int, foo also 
gets the (?g :: Bool) => context, and it's reevaluated whenever it's 
used; but you won't be able to tell that by looking at foo alone.

Cheers,
Wolfgang
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Implicit parameter constraints not inferred

2004-11-06 Thread Benjamin Franksen
To be fair, the ghc docs do not mention constraint inference for implicit 
parameters. OTOH they do not say that signatures must be given explicitly if 
I use implicit parameters.

However, I always thought that this would be ok:

> main = let ?b = True in use_b

> --use_b :: (?g::Bool) => IO ()
> use_b = print ?b 

It isn't: ghc -fimplicit-params says

Unbound implicit parameter (?b :: a)
  arising from use of implicit parameter `?b' at TestBug.hs:4
In the first argument of `print', namely `?b'
In the definition of `use_b': use_b = print ?b

It works if I uncomment the signature. I also tried

> use_b = print (?b :: Bool)

but to no avail.

Using ghc-6.2.2, btw.

My question: Is this as it should be or is it a bug?

Ben
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: CVS build failure

2004-11-06 Thread Sven Panne
Peter Simons wrote:
Linux x86, I configure my build with the script:
 | #! /bin/sh --
 |
 | GHC="ghc-6.2.2"
 | SUBDIRS="alex ghc haddock happy hslibs libraries"
 |
 | for n in ${SUBDIRS} .; do
 |   echo >$n/mk/build.mk "XMLDocWays := html"
 | done
 |
 | autoreconf -i
 | ./configure --prefix=/usr/local/ghc-current \
 |   --enable-src-tree-happy   \
 |   --enable-src-tree-haddock \
 |   --enable-src-tree-alex\
 |   --with-ghc="${GHC}"   \
 |   --with-hc="${GHC}"\
 |   --enable-hopengl  \
 |   --disable-openal  \
 |   ;
[...]
Just a small note here: Simply using
   make XMLDocWays=html
should build everything recursively, including the HTML docs, without
any need for a build.mk.
Cheers,
   S.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: getUserEntryForName weirdness

2004-11-06 Thread Peter Simons
Volker Stolz writes:

 > Fixed in CVS

I've tried it moments ago: Works correctly here, too, now.
Thank you.

Peter

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: proposal for ghc-pkg to use a directory of .conf files

2004-11-06 Thread Sven Panne
Duncan Coutts wrote:
[...] The advantage of doing this is that it makes things easier for the
package managers. Each individual file can belong to the appropriate
package and so instead of having to execute registration/unregistration
actions on install/uninstall it's just another file to add/remove. The
other advantage is that there is no longer a global file that needs to
be modified which means uninstallation is cleaner (most package managers
do not remove files that were modified after installation).
These are exactly the reasons why e.g. the configuration files for apache2
on my SuSE Linux 9.1 are set up this way. It's very handy, clean and modular.
[...] I had a peak at the code in ghc for dealing with .conf files. I'd guess
it'd be best ok just check if the specified package file is a directory
or an ordinary file and act accordingly. Ie you could say "-package-conf
packages/" and ghc could by default read from $HC-LIB/package.conf and
$HC-LIB/package.conf.d/ or something.
Sounds resaonable to me. I can't see any downsides of doing it this way.
I can knock up a proof of concept patch if anyone thinks this is a good
idea. It should be totally backward compatible, it's ok to use both, but
ditro packagers might like to enforce a policy of using a directory of
package files for external libraries.
OK, just send us a patch and if there are no objections we can merge it into
the HEAD.
Cheers,
   S.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users