Re: how do I abstract this pattern ?

2008-05-21 Thread Brandon S. Allbery KF8NH


On 2008 May 21, at 12:31, Bulat Ziganshin wrote:


Wednesday, May 21, 2008, 8:11:56 PM, you wrote:


Suppose p1, p2, p3 are 3 predicates
that take an input -- say, a String.
They return either (True, result)
   or False.


if they return Just result or Nothing - yes, use Maybe as monad:

combine p1 p2 p3 x= do x1 <- p1 x
  x2 <- p2 x1
  x3 <- p3 x2
  return x3


S/He's not passing on r (the result), but s (the argument).  Monad ((- 
>) r)?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Problems interrupting IO with -threaded

2008-06-11 Thread Brandon S. Allbery KF8NH


On 2008 Jun 11, at 0:43, Simon Marlow wrote:

Unix semantics just isn't the right thing when it comes to non- 
blocking I/O.  If only there were non-blocking read()/write() system  
calls, we'd be fine.



Have you considered using aio_read() and company?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-12 Thread Brandon S. Allbery KF8NH


On 2008 Jun 12, at 16:58, Dominic Steinitz wrote:
Ok but doesn't that rebuild everything not just the bits that have  
changed?



Enough stuff usually changes that it's necessary (and for whatever  
reason dependencies don't catch enough of it).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Implicit Function Arguments

2008-06-28 Thread Brandon S. Allbery KF8NH


On 2008 Jun 28, at 12:32, Tyson Whitehead wrote:


What do people think about implicit function argument?


http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#implicit-parameters
It uses ? as the prefix instead of ~ (which already has a meaning in  
pattern matching).


I am under the impression they are deprecated and slated for removal.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Implicit Function Arguments

2008-06-29 Thread Brandon S. Allbery KF8NH


On 2008 Jun 29, at 4:56, Philip Weaver wrote:


I am under the impression they are deprecated and slated for removal.


This is the second time I have seen someone comment on implicit
parameters being planned for removal, so now you have my attention :).
I'd like to mention that a rather large project where I work (Galois,
Inc.) uses implicit parameters a lot, so removing support for them
would make me rather unhappy.



Hm, looks like terminology confusion.  Implicit parameters are  
staying.  *Linear* implicit parameters were deprecated in 6.6 and seem  
to be gone now.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Version control systems

2008-08-09 Thread Brandon S. Allbery KF8NH


On 2008 Aug 10, at 2:12, Jason Dagit wrote:
On Sat, Aug 9, 2008 at 10:44 PM, Roman Leshchinskiy <[EMAIL PROTECTED] 
> wrote:


Maybe investing some time in fixing the most obvious darcs problems  
would be a better solution?


We're working on that over at Darcs HQ, but there is no guarantee  
that we'd come close to fixing the problems within the 4-5 week  
window that Ian mentioned.  Supposing that the main problems GHC has  
with darcs 2 format get solved in the next month, would that give  
GHC reason enough to keep using darcs?  It seems many of you are  
eager to use git; perhaps even if darcs was working to satisfaction.


Some people are.  I'm more on the side of "are we creating a bigger  
problem than we already have?"  It's not at all clear to me that  
switching to git would solve more problems than it would cause --- and  
if you toss in core libraries possibly needing to stay in darcs, or  
other projects being abruptly forced to switch to git because the core  
libs did, it's pretty clearly on the "biting off more than we can  
chew" side of things.



Let me throw out one more idea:
What if, as a GHC contributor, I could pick equally between git and  
darcs?  My understanding is that, while not optimal, you could use  
tailor[1] to synchronize a darcs repository with a git one.  Offer  
up both repositories and keep them in sync.  Let the masses decide?



There has been some discussion along those lines, but doing that  
bidirectionally is logitically difficult.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Version control systems

2008-08-10 Thread Brandon S. Allbery KF8NH


On 2008 Aug 10, at 20:17, Norman Ramsey wrote:


For the last year I have been hoping to make 'a new darcs-like thing,

with a real theory founding it' an important part (one of three) of a
grant proposal in distributed computing.  So you can see I am in favor
of spending money to create a better darcs (which is not quite the
same thing as making darcs better; I want to start with a new theory).


Can you elucidate what's wrong with the current one?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to produce a statically linked binary with GHC?

2008-08-14 Thread Brandon S. Allbery KF8NH


On 2008 Aug 15, at 1:02, Nicola Squartini wrote:


I did the following in my project and this is what I get:

$> runhaskell Setup configure --user --ghc-option="-optl -static"


No space between "-optl" and "-static".  The "-pthread" is probably  
being misrecognized as a result of the generated command.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: invoking a Haskell script without a .hs extension

2008-08-18 Thread Brandon S. Allbery KF8NH


On 2008 Aug 17, at 23:45, Paul Jarc wrote:


A somewhat related issue: I'd like to avoid hard-coding the path to
runhaskell or ghc in the #! line.  Instead, I'd like to use #!/bin/sh,
and have the shell find runhaskell or ghc in $PATH.  This means the


#! /usr/bin/env runhaskell ...

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: #ghc connection issue

2008-08-20 Thread Brandon S. Allbery KF8NH


On 2008 Aug 20, at 10:52, Claus Reinke wrote:


I seem to be unable to join the ghc chatroom at irc.freenode.net
at the moment (using Opera). Is that an issue with my irc client or  
a general problem?


15:47  Joining chat room...
Disconnected from chat



For a while some home routers/APs were a bit overzealous about trying  
to block certain kinds of evil DCC, and could do things like that.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Build system idea

2008-08-28 Thread Brandon S. Allbery KF8NH

On 2008 Aug 28, at 5:27, Simon Peyton-Jones wrote:
This isn't a criticism: one of the hardest thing to do is to  
accurately convey this underwater stuff.  But I wonder whether there  
might be a useful paper hiding here?  Something that establishes  
terminology, writes down principles, explains the Cabal viewpoint,  
contrasts with alternatives, and thereby allows discussion about  
Cabal to be better informed.


I think we're at the point where such a document is necessary if we're  
going to have a coherent discussion.  (And as an aside, I think the  
same is true of darcs.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Build system idea

2008-08-28 Thread Brandon S. Allbery KF8NH

On 2008 Aug 28, at 22:00, Sterling Clover wrote:
We do have, although not with easy access, an additional declarative  
layer "built in" 90% of the time as configuration as type signature.


Sure?  I think it's easier than you think:  someone's already written  
code to extract the information from .hi files (and indeed ghc will  
dump it for you:  ghc --dump-iface foo.hi).  In theory there could be  
a master dictionary of these hosted on hackage, collected from each  
package's own dictionary, and a given package's dependencies could be  
computed with high accuracy from it.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: base package (Was: GHC 7.8 release?)

2013-02-14 Thread brandon s allbery kf8nh
On Thursday, February 14, 2013 at 8:14 PM, Johan Tibell wrote:
> On Thu, Feb 14, 2013 at 2:53 PM, Joachim Breitner  (mailto:m...@joachim-breitner.de)> wrote:
> I don't think having FFI far down the stack is a problem. There are lots of 
> pure data types we'd like in the "pure data" layer (e.g. bytestring) that 
> uses FFI. As long as the I/O layer itself (System.IO, the I/O manager, etc) 
> doesn't get pulled in there's no real problem in depending on the FFI. 
Doesn't the FFI pull in some part of the I/O layer, though?  In particular 
threaded programs are going to end up using forkOS?

-- 
brandon s allbery kf8nh
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Building the GHC library without building GHC

2013-02-15 Thread brandon s allbery kf8nh
Er, the GHC library *is* GHC.  The answer is very probably "no".

-- 
brandon s allbery kf8nh
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Friday, February 15, 2013 at 9:52 AM, C Rodrigues wrote:

> 
> Hi,
> 
> I was going to do some hacking on Haddock.  Haddock depends on the GHC API 
> from the development version of GHC, however, stage2 crashes on my system 
> when I try to build the newest GHC from the repository.  Since I don't 
> actually need to compile with the new GHC, I'm hoping there's a workaround.  
> Is there a way to build only the GHC library so that I can get back to 
> Haddock?
> 
> 
> ___
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org (mailto:Glasgow-haskell-users@haskell.org)
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> 
> 


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: making 6.9.. with 6.8.3

2008-09-16 Thread Brandon S. Allbery KF8NH

On 2008 Sep 16, at 11:01, Serge D. Mechveliani wrote:

reports that  Happy is needed.
But earlier, I compiled  ghc-6.8.3  with itself,
and it did not required Happy.
Generally, as I recall, I got used to making GHC from source without
installing Happy.
Please, what (and why) has changed about this?


Development snapshots don't include generated files, as a general rule.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC 6.10.1 beta

2008-09-23 Thread Brandon S. Allbery KF8NH

On 2008 Sep 23, at 9:38, Christian Maeder wrote:

But finally installation succeeded (editline is missing and the arrow
keys don't work). Why are there 2 base packages?


Backward compatibility; older Haskell programs using base-3.x will  
still work.  (6.10 has unbundled a bunch more libraries from the base.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC 6.10.1 beta

2008-09-24 Thread Brandon S. Allbery KF8NH

On Sep 22, 2008, at 13:43 , Christian Maeder wrote:

Matthias Kilian wrote:

2.
/bin/sh: test: argument expected
gmake[1]: *** [binary-dist] Error 1

-e does not work for test under "sh", so I changed it to "-r":
... if [ -r $$FILE ]; then ...


I doubt `-e' doesn't work on Solaris, because `-e' is POSIX. Does
this "argument expected" still appear with your fix to 1.?


It does not work on my system (SunOS 5.10 Generic_137112-07 i86pc):


Solaris's /bin/sh is not POSIX; /usr/xpg4/bin/sh is the POSIX  
compatible shell.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: planning for ghc-6.10.1 and hackage

2008-10-03 Thread Brandon S. Allbery KF8NH

On Oct 3, 2008, at 04:55 , Simon Marlow wrote:

Duncan Coutts wrote:

I propose two solutions:
 * Fix the dependency resolver
 * Add support in Cabal and Hackage for suggested version
   constraints


Simon PJ just came up with a suggestion for the second part.  The  
idea is this:


If we see a dependency like "base >= 3" with no upper limit, we  
should satisfy it with base-3 in preference to base-4, on the  
grounds that the package is much more likely to build with base-3.   
This seems to be a solution that works without any magic shims or  
"preference files" or anything else.



Choose the lowest available version that satisfies all of the  
constraints?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Re[2]: planning for ghc-6.10.1 and hackage

2008-10-03 Thread Brandon S. Allbery KF8NH

On 2008 Oct 3, at 18:09, Bulat Ziganshin wrote:

Friday, October 3, 2008, 8:53:05 PM, you wrote:

Choose the lowest available version that satisfies all of the
constraints?


and bugfixed versions will be never used :)



As Duncan said, I misspoke slightly.  I was actually assuming  
something like the rules used for shared libraries:  given a version  
X.Y.Z, X changes with API changes, Y with large non-API changes, Z  
with minor patches, and the resolution algorithm chooses the latest  
version with the same X (and, on some systems, tries to match Y as  
well), and older versions are never accepted.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: file descriptors

2008-10-30 Thread Brandon S. Allbery KF8NH

On 2008 Oct 30, at 10:08, Johannes Waldmann wrote:

are there any known issues
with file handles/descriptors in ghc-compiled executables?

My program has a lot of calls to System.Process.runInteractiveProcess
and I'm running into unpredictable behaviour (sometimes the program
just silently dies, sometimes it gets stuck)


runInteractiveProcess returns 3 filehandles and a process handle.   
Either can cause problems:  if you use too many filehandles, the  
select()-based mechanism in the Haskell runtime will fail (select()  
has a fairly low limit on filehandles as compared to poll(), epoll(),  
and other mechanisms); if you spawn too many subprocesses without  
reaping them (waitForProcess / getProcessExitCode) you will hit the  
child process limit and not be able to create new child processes.


A third problem is that you can deadlock if you write too much data  
without reading any back.  Your best bet is to forkIO so input and  
output are independent.



Or perhaps you see anything that's wrong with my code here
http://dfa.imn.htwk-leipzig.de/cgi-bin/cvsweb/box/src/SMT/Time.hs?rev=1.9


And there's a fourth problem:  you hGetContents after blocking  
waitForProcess.  If the output is larger than the size of a pipe  
buffer (often 512 bytes), the subprocess will block waiting for the  
pipe to be read, while you're waiting for it to exit before reading  
from the pipe.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC version 6.10.1 - MacOS installer

2008-11-04 Thread Brandon S. Allbery KF8NH

On 2008 Nov 4, at 20:26, Jason Dagit wrote:

On Tue, Nov 4, 2008 at 4:26 PM, Manuel M T Chakravarty
<[EMAIL PROTECTED]> wrote:

Jason Dagit:

I'm on OSX and I currently have ghc-6.6.1 and ghc-6.8.3 (installed
from a pkg). I would like to add ghc-6.10.1 to my system.  I tried  
to

do this with RC1 of 6.10, but I found that it uninstalled my
ghc-6.8.3.

What will I need to do to get both 6.8.3 and 6.10.1?


Are you sure it does deinstall the 6.8 compiler?  Or does it just  
overwrite

the symbolic links in /usr/bin?  To check, have a look at

/Library/Frameworks/GHC.framework/Versions

After installing 6.10, there should be a 608/ and a 610/  
directory.  This
certainly happens on my Mac and I am not aware of an option to  
change that

behaviour.


I haven't tried the 6.10.1 install, but after using the 6.8.3 pkg
followed by the 6.10 RC1 pkg, followed by the 6.8.3 pkg, I have just
608 in the directory you mention.


I expect if you used the OSX installer then /Library/Receipts is  
screwing you (it wipes the old files listed in the .bom file).  Try  
finding and removing the receipt directory and bom file before  
installing.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC version 6.10.1 - EditLine / terminal incompatibility?

2008-11-08 Thread Brandon S. Allbery KF8NH

On 2008 Nov 8, at 22:13, Rohan Drape wrote:

Emacs sends text to processes in packets of at most 255 characters.
In between these ghci now gets a ^D character sequence inserted into
the text.  This did not happen previously (ie. with 6.8.2).


This sounds like a bug:  either editline or ghci assumes that when it  
successfully reads data which lacks a line terminator than it has seen  
an EOF, so inserts a ^D.  But if it received the data at the maximum  
tty buffer size (255) then there is no trigger character.


(This is easy enough to work around:  special-case reads of length  
255.  But in reality, this means something is Doing It Wrong.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: inconsistent type checking behavior

2008-11-12 Thread Brandon S. Allbery KF8NH

On 2008 Nov 12, at 10:53, Jeff Polakow wrote:
Now, if we switch to an analogous, though slightly more complicated  
type, GHC's type checker accepts the following code:


bar :: (forall b. b -> String, Int)
bar = (const "hi", 0)
foo :: forall b.(b -> String, Int)
foo = (const "hi", 0)

however GHC's type checker rejects the following code (I now think  
this is correct):


bar :: (forall b. b -> String, Int)
bar = (const "hi", 0)
foo :: forall b.(b -> String, Int)
foo = bar

with the error :

Couldn't match expected type `b -> String'
   against inferred type `forall b1. b1 -> String'

and yet GHC accepts the following code:

bar :: (forall b. b -> String, Int)
bar = (const "hi", 0)
foo :: forall b.(b -> String, Int)
foo = (fst bar, snd bar)

which is just the eta-expansion of the previous code.

This behavior seems inconsistent to me. I don't see any reason why  
the (f = b) should be different than (foo = bar). In fact, thinking  
more carefully about the types, I think that (f = b) should not type  
and the eta expansion (f = \x -> b x) should be required.



Seems right to me:  symbolically it may be an eta-expansion, but  
practically GHC's tuples are actually types, so the latter is a new  
tuple with a different type from the former.  (GHC's handling of  
tuples is often infelicitous.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: more libedit.so.0 issues

2008-11-14 Thread Brandon S. Allbery KF8NH

On 2008 Nov 14, at 13:09, James Swaine wrote:
/home/jswaine/ghc/ghc-6.10.1/ghc/ghc -Wall -DCABAL_VERSION=1,6,0,1 - 
odir /home/jswaine/ghc/ghc-6.10.1/libraries/bootstrapping -hidir / 
home/jswaine/ghc/ghc-6.10.1/libraries/bootstrapping -i/home/jswaine/ 
ghc/ghc-6.10.1/libraries/Cabal -i/home/jswaine/ghc/ghc-6.10.1/ 
libraries/filepath -i/home/jswaine/ghc/ghc-6.10.1/libraries/hpc -- 
make cabal-bin -o cabal-bin

ghc: missing -B option
 which still looks to me like it's somewhat related to linking (the  
assumption was that -B is used for this sort of thing - linking


The -B option to ghc tells it where the GHC base directory is.  (The  
ghc in the public bin directory is a shell script which runs the real  
ghc passing -B to point to its base directory.)  If you see that  
error, something is *very* wrong with your build tree.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Unicode's greek lambda

2008-11-18 Thread Brandon S. Allbery KF8NH

On 2008 Nov 18, at 20:53, Kazu Yamamoto (山本和彦) wrote:

If we reserve the greek lambda as special like '\', the lexer can
separate x into two tokens:  and 'x', I guess.



Not without redefining it as a symbol instead of a lowercase letter,  
which won't be done as previously discussed.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC version 6.10.1 - EditLine / terminal incompatibility?

2008-11-21 Thread Brandon S. Allbery KF8NH

On 2008 Nov 21, at 9:01, Simon Marlow wrote:
* extract the GHCi UI from the GHC package, put it in the ghc-bin  
package
  (maybe we should rename this package to ghc-main or something).   
This
  removes the editline and bytestring (for now) dependencies from  
the GHC

  package.

* Move to Haskeline for the default build.  We have to bring in  
terminfo

  and utf8-string as bootlibs.  This gives us line-editing on Windows,
  and removes problematic external C library dependencies.

* Make it possible to compile the ghc-bin package against readline.
  Upload ghc-bin to Hackage, so people can say
 cabal install ghc-bin -f readline
  and get a GHCi built against readline if they want.  Oops - except  
that

  this would mean that the ghc-main package has a variant license.  So
  maybe we have to have a separate ghc-readline package?



My humble opinion:

Dissociate ghc-bin and ghci from ghc; the latter is actually ghci- 
{haskeline,readline,editline,noediting,...}.  (Does cabal have virtual  
packages yet?)


There is a corresponding library issue, though:   
System.Console.Readline.  I'd handle this by having packages which  
export their own namespaces... but we'd like to have a generic  
interface too so someone can write a program using any available  
editing package.  So, have the packages also output a module which is  
by default hidden, and allow the user to select which one is used by  
unhiding it.  (This might lead to wanting additional cabal  
functionality:  "preferred" packages.  Or maybe flags already handle  
that well enough.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Unicode's greek lambda

2008-11-22 Thread Brandon S. Allbery KF8NH

On 2008 Nov 22, at 12:12, Colin Paul Adams wrote:

"Arnar" == Arnar Birgisson <[EMAIL PROTECTED]> writes:


   Arnar> To clarify - most of modern fonts do in deed have
   Arnar> latin-greek-cyrillic (including the U+03BB lambda), but I
   Arnar> was referring to the specific math symbols such as the
   Arnar> U+1D6CC bold lam(b)da, which reside in the Supplementary
   Arnar> Multilingual Plane (SMP). Those are indeed not present in
   Arnar> my fonts, including Lucida Math and Adobe Mathematical Pi).

David> On windows there's cambria math (unfortunately with a  
restrictive

licence that restricts it to that platform, though you can get it for
free by getting (for example) the free powerpoint viewer from  
microsoft)


for a free font with a full range of characters best bet is stix font
which has been 10 years in the making and is currently between beta  
and


http://dejavu.sourceforge.net/ works for me.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ghc 6.10.1 on freebsd 7 amd64 - ghci problems

2008-11-26 Thread Brandon S. Allbery KF8NH

On 2008 Nov 26, at 9:30, Markus Barenhoff wrote:
Because the ports seem not to get updated, I tried to compile ghc  
6.10.1
under freebsd 7 on amd64 myself. For compiling I first used the  
ports ghc


The tree's not being updated because 64-bit on freebsd doesn't work  
yet, as you found.  I believe a fix for the mmap() problem has been  
committed for the upcoming 6.10.2.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: gcc version to use on sparc/solaris

2009-01-11 Thread Brandon S. Allbery KF8NH

On 2009 Jan 11, at 9:48, Duncan Coutts wrote:

On Fri, 2009-01-02 at 21:06 +1100, Ben Lippmeier wrote:

I'm running into some huge compile times that I'm hoping someone will
have some suggestions about. When compiling Parser.hs the  
intermediate

.hc file is 4MB big, and is taking GCC 4.2.1 more than 2 hours to get
through.


Here is what I've discovered...

I built four versions of gcc and used them to build ghc-6.8.3. I
selected the last point release of the last four major gcc releases:
gcc-4.0.4
gcc-4.1.2
gcc-4.2.4
gcc-4.3.2

Summary: gcc-4.0.4 or gcc-4.1.2 seems to be the best choice at the
moment for ghc on sparc/solaris.


FWIW I've built 6.8.2 with gcc-4.2.2, ti was slow but it built and the  
testsuite didn't look too horrible.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Re[2]: Differences in pattern matching syntax?

2009-01-16 Thread Brandon S. Allbery KF8NH

On 2009 Jan 16, at 11:23, Bulat Ziganshin wrote:

Friday, January 16, 2009, 7:07:09 PM, you wrote:

  instance Eq RuleType


this is very common error. it would be great to find some way to deal
with it (for predefined classes at very least...)




It wouldn't catch everything, but might it make sense to output a  
warning on empty instance declarations?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: :info features

2009-02-06 Thread Brandon S. Allbery KF8NH

On 2009 Feb 5, at 5:49, Remi Turk wrote:
SPJ agreed with the idea itself, but suggested an alternative set of  
commands:


  :info Show-- See class definition only
  :instances Show   -- See instances of Show

(...)

However, it would make ":i" ambiguous, which is rather sad.



:class Show -- unique prefix :cl, already many such collisions
:instance Show

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Brandon S. Allbery KF8NH

On 2009 Feb 10, at 8:55, Alistair Bayley wrote:

Perhaps CPP shouldn't be a pragma, just a command-line flag? It seems
to be the only one that affects/involves preprocessor(s). AFAICT, the
others all affect the haskell compiler stage.



Or require the CPP pragma to be the first thing in the file,  
immediately triggering cpp and a reread.  This means


> #if 0
> {-# LANGUAGE CPP #-}
> #endif

is ambiguous, but I think it could be argued that the programmer has  
asked for _|_ and any behavior is acceptable.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ./T and ./T >& log

2009-02-20 Thread Brandon S. Allbery KF8NH

On 2009 Feb 20, at 4:38, Serge D. Mechveliani wrote:

The first command outputs

 -
   t =  ((a : nil) + (b : nil))
 Bug:
 substitute {(X, a), (Xs, nil), (Ys, (b : nil))} X:
 sort mismatch in substitution
 -

And the second command skips (in  ./log) the line of   t = ...
Who can tell what is the matter?


The ghc runtime doesn't flush stdout when an exception stops the  
program.  This is arguably a bug in the runtime; if you set stdout to  
line buffering or no buffering you should get pretty much the same  
output from both.  (It's still possible for buffering to cause lines  
to come out in a different order, so you might prefer unbuffered).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Loop unrolling + fusion ?

2009-03-06 Thread Brandon S. Allbery KF8NH

On 2009 Mar 6, at 19:07, Claus Reinke wrote:
Loop breakers are still needed, in spite of the explicit limits.  
Consider


let {odd x = ..even{1,0}..; even x = ..odd{1,0}..} in odd{1,0} n


{-# INLINE odd even PEEL n #-} ?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Loop unrolling + fusion ?

2009-03-09 Thread Brandon S. Allbery KF8NH

On 2009 Mar 9, at 9:32, Claus Reinke wrote:
One way out would be to treat the whole mutual recursion as a single  
entity, either implicitly, as I indicated, or explicitly, as I  
interpret Brandon's somewhat ambiguous comment. In other words, the  
peel/unroll limits would apply to a whole group of mutually


Sorry, yes, I intended that the unrolling applied explicitly to a  
group of mutually recursive functions.  I'm not sure if the unroll/ 
peel counts should be multiplied by the number of functions, though.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Link errors

2009-03-15 Thread Brandon S. Allbery KF8NH

On 2009 Mar 15, at 11:59, Lingappan, Loganathan wrote:
FindBBUsage.o:fake:(.text+0x44d): undefined reference to  
`__stginit_regexzmposixzm0zi72zi0zi3_TextziRegexziPosix_'

collect2: ld returned 1 exit status



Either use "ghc --make" or "ghc -package regex-posix".  The former is  
preferred.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Solaris 8 and libm.so.2

2009-03-17 Thread Brandon S. Allbery KF8NH

On 2009 Mar 17, at 10:36, Christian Maeder wrote:

Ralph Crawford wrote:

ln -s /usr/lib/libm.so.1 $BOS_ROOT/lib/libm.so.2


You need an actual libm.so.2 library that contains the missing  
symbols.

To this library you set a link libm.so in a directory that is in the
front of your LD_LIBRARY_PATH, so that libm.so.2 instead of libm.so. 
1 is

found via libm.so.



It's a bit more complex than that:  if you have the appropriate  
service contract you can request the C9X patch cluster, otherwise you  
can't get libm.so.2 at all, as far as I can determine.  I came up with  
an ugly hack to work around it, but would prefer to find a better  
solution.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Under Solaris: GHC 6.10.2 Release Candidate 1

2009-03-17 Thread Brandon S. Allbery KF8NH

On 2009 Mar 17, at 20:28, Duncan Coutts wrote:

On Tue, 2009-03-17 at 11:09 +0100, Christian Maeder wrote:

Under Solaris sh is not bash!


Indeed.

According to the OpenGroup that syntax should be fine:
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_02

It works for me under Solaris 10. Perhaps Solaris 9 or older do not  
have
a standard compliant /bin/sh program. What do you suggest we use  
instead

as a workaround?


For backward compatibility reasons sh in Solaris 9 and earlier is not  
POSIX compliant.  Use /usr/xpg4/bin/sh or /bin/bash instead.   
(Unfortunately you can't cheat and define a shell function, although  
you could create a program called "!":


#! /bin/sh
if ${1+"$@"}; then
exit 1
else
exit 0
fi
.)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Advice wanted on parallel processing

2009-03-18 Thread Brandon S. Allbery KF8NH

On 2009 Mar 18, at 16:34, Colin Paul Adams wrote:

The one routine that stood out was this one (about 35% CPU time, with
0% attributed to children):


-- | Value of one rank of the board
rank_value :: (Int, Array Int Square) -> Int
rank_value (rank_coord, rank') = sum (map (cell_value rank_coord)
  (assocs rank'))

The array has 12 elements.



How many times do you call it?  Perhaps the real optimization you need  
is to memoize.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Advice wanted on parallel processing

2009-03-18 Thread Brandon S. Allbery KF8NH

On 2009 Mar 18, at 16:59, Colin Paul Adams wrote:
"Brandon" == Brandon S Allbery KF8NH   
writes:



The array has 12 elements.


   Brandon> How many times do you call it?  Perhaps the real
   Brandon> optimization you need is to memoize.

Very many times indeed. But it is a different array on most occasions
(I am not updating in place).

It represents one rank of the board on which the game is played. The
move generator produces a new board for each move.



It might be helpful for you to show more of the program.

One thing to keep in mind about parallelization is that the level at  
which happens matters:  if individual calculations across the list are  
fast, all you gain by parallelizing it is MP synchronization/locking  
overhead.  On the other hand, it's possible that if the caller can be  
rearranged so that rank_value is computed on another CPU while it's  
doing something else, you could gain quite a bit.  Or maybe the caller  
is itself at the right level to parallelize.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: strace breaks cabal - how to find the problem?

2009-03-25 Thread Brandon S. Allbery KF8NH

On 2009 Mar 25, at 9:12, Simon Marlow wrote:

Robin Green wrote:
This sounds slightly familiar.  The System.Process library uses  
vfork() on Unix systems, which as it turns out helps to avoid some  
race conditions. However, while debugging something in this area  
recently (using strace) I remember seeing different behaviour when  
running under strace.  I suspect that strace is doing something to  
vfork().


strace and vfork don't mix; vfork uses a hack that won't work right  
when tracing is enabled.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: 6.10.3 plans

2009-04-22 Thread Brandon S. Allbery KF8NH

On Apr 22, 2009, at 22:00 , Alexander Dunlap wrote:

On Wed, Apr 22, 2009 at 4:56 PM, Ian Lynagh  wrote:
An exception to this rule is that we will probably also rebundle  
time in

the bindists, as that has little chance of breaking anything else.


Would this be a good time to add the "time" package too, or has that
issue been resolved?



...

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Chimeric syntax

2009-04-28 Thread Brandon S. Allbery KF8NH

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Apr 28, 2009, at 01:24 , Scott Michel wrote:

I've been hacking along on a NetBeans Haskell plugin (*) Looking at
Parser.y.pp, because both Eclipse and NetBeans work with antlr, it
seems like there are interesting cases in which chimeric constructions
parse correctly. Here's an example:

class ParsedModule m where
 let { a = 1; b = 2; } in a + b :: Int :: Int

This is mostly accepted by ghc, which complains with an invalid type  
signature.


Looking at the Online Report, my guess is it parses as:

exp^0 = "let {a = 1; b = 2; } in a + b"
type  = "Int :: Int"

and of course "Int :: Int" is an invalid type signature.  (::) parses  
as if it were a very low precedence operator.


- --
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAkn3Xg4ACgkQIn7hlCsL25XQpgCdFnKgoxE8DlJWMpLTabR6gkIW
tZIAnjnR8HheL8RtO87Z3ZteRqfHewUo
=eptK
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: type checking fails with a correct type

2009-04-30 Thread Brandon S. Allbery KF8NH

On Apr 30, 2009, at 09:52 , Jan Jakubuv wrote:

   *Main> :t nonsense
   nonsense :: (SUBST s) => t -> Maybe s

But, when I put this signature into the code (that is, when the  
commented

line above is uncommented) then type checking fails with the following
error:

   Ambiguous type variable `s' in the constraint:
 `SUBST s'


http://www.haskell.org/pipermail/haskell-cafe/2008-April/041397.html
http://hackage.haskell.org/trac/ghc/ticket/1897

The type really is ambiguous according to GHC's rules, because you're  
missing some relationships.  As I understand it (which may well be  
wrong), f you leave off the explicit typing it will successfully infer  
everything including the missing relationship; but if you explicitly  
type it you prevent inference of the missing relationship.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: runhaskell a parallel program

2009-05-07 Thread Brandon S. Allbery KF8NH

On May 7, 2009, at 06:27 , Neil Mitchell wrote:

If however I run it with runhaskell Test.hs +RTS -N2 I get told the
-N2 flag isn't supported. Is there a way to runhaskell a program on


As a workaround you could use 'ghc -e main foo.hs +RTS -N2'.


That works great :-) Perhaps this trick should be documented? I
thought runhaskell was just sugar over ghc -e, so couldn't it share
the same mechanism?


I think the problem is that runhaskell invokes the runghc executable  
in the GHC libdir, which is itself a non-threaded Haskell program and  
therefore consumes the RTS options.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT record syntax and contexts

2009-06-18 Thread Brandon S. Allbery KF8NH

On Jun 16, 2009, at 05:19 , Simon Peyton-Jones wrote:

(B)  data RecTest a where
   B :: { arg :: a } -> RecTest a



For what it's worth (considering that I have yet to actually use  
GADTs), (A) looks wrong to me because there is type information before  
the actual type.  (B) looks kinda strange as well, but the "missing"  
tycon seems to make more sense given that it's a GADT.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: finalizers on handles

2009-06-23 Thread Brandon S. Allbery KF8NH

On Jun 23, 2009, at 09:41 , Simon Marlow wrote:

main = do
(ih, oh, _, _) <- runInteractiveProcess "cat" [] Nothing Nothing
comphszp <- hGetContents oh
print (length comphszp)
-- hClose ih -- with this line they both deadlock



Note that you can trigger this in any language; it's a classic  
beginner error with pipes (see, for example, the documentation for  
open2/open3 in Perl or Python for other examples).  Detecting this in  
the type system would be an interesting idea, but de facto I think  
this is a "it hurts when I do this".


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Proposal: ExplicitForall

2009-06-23 Thread Brandon S. Allbery KF8NH

On Jun 23, 2009, at 20:32 , Niklas Broberg wrote:

In my quest to implement all known syntactic extensions to Haskell in
my haskell-src-exts package, I've become painfully aware of the
sometimes ad-hoc nature that these extensions have been added to GHC.


Someone really needs to sit down and work out a complete, consistent,  
and rational set of extensions, including not only your ExplicitForall  
but also e.g. if you are actually compiling Haskell98, hierarchical  
modules should be illegal.  The reality is that some extensions are  
always on and others are haphazardly split from -fglasgow-exts.


(Then again, I'm also of the opinion that -package should control not  
only linking but also imports, because it's ridiculously inconsistent  
for stuff to compile but not link if you forget -package or --make.   
It also opens the possibility of modules managing their own namespaces  
as discussed in other recent threads, and that a module install  
doesn't have to scribble in ghc's library directory; the latter would  
likely make some packagers very happy.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: finalizers on handles

2009-06-23 Thread Brandon S. Allbery KF8NH

On Jun 24, 2009, at 00:52 , Ganesh Sittampalam wrote:

On Tue, 23 Jun 2009, Brandon S. Allbery KF8NH wrote:
On Jun 23, 2009, at 09:41 , Simon Marlow wrote:

main = do
(ih, oh, _, _) <- runInteractiveProcess "cat" [] Nothing Nothing
comphszp <- hGetContents oh
print (length comphszp)
-- hClose ih -- with this line they both deadlock



Note that you can trigger this in any language; it's a classic  
beginner error with pipes (see, for example, the documentation for  
open2/open3 in Perl or Python for other examples).  Detecting this  
in the type system would be an interesting idea, but de facto I  
think this is a "it hurts when I do this".


Sure - but it hurts more when in some environments you get away with  
it and others you don't.



You'll still have that though, it'll just be a different set of  
environments.  The next failure mode after this one is writing more  
than _PIPE_BUF down ih; you'll deadlock in the write when in blocking  
mode, in non-blocking mode it depends on how the runtime handles  
partial writes.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: finalizers on handles

2009-06-23 Thread Brandon S. Allbery KF8NH

On Jun 24, 2009, at 02:27 , Sittampalam, Ganesh wrote:

Brandon S. Allbery KF8NH wrote:


Sure - but it hurts more when in some environments you get away with
it and others you don't.


You'll still have that though, it'll just be a different set of
environments.  The next failure mode after this one is writing more
than _PIPE_BUF down ih; you'll deadlock in the write when in blocking
mode, in non-blocking mode it depends on how the runtime handles
partial writes.


I'd hope for consistency across the GHC runtimes though.



You can hope, but I get the impression blocking/non-blocking maps to  
threaded/non-threaded respectively in which case all bets are off.   
(Unless the ghc runtime guarantees some specific behavior here.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: finalizers on handles

2009-06-24 Thread Brandon S. Allbery KF8NH

On Jun 24, 2009, at 05:04 , Simon Marlow wrote:
There's one exception: if GHC is forced to use blocking mode on a  
particular FD, and you're using the non-threaded RTS, then a large  
write using hPutBuf may block all Haskell threads.  There doesn't  
seem to be much we can do about this, except to use the threaded RTS  
or lobby the Linux kernel guys for a better API.



POSIX async IO API?  (Although last I checked many distributions built  
kernels without it.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Does this, and should this type check on GHC 6.10.x ?

2009-06-26 Thread Brandon S. Allbery KF8NH

On Jun 26, 2009, at 00:47 , Ahn, Ki Yung wrote:

We got a code (please refer to the attached lhs file) that uses type
families and type classes very cleverly.  We don't know who wrote


I'm under the impression that many clever uses of type families  
require GHC HEAD, as they're still evolving.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Proposal: Deprecate ExistentialQuantification

2009-06-27 Thread Brandon S. Allbery KF8NH

On Jun 27, 2009, at 15:37 , Niklas Broberg wrote:

* NewConstructorSyntax: Lets the programmer write data types using the
GADTs *syntax*, but doesn't add any type-level power (and no forall
syntax). Could probably use a better name (bikeshed warning).


GeneralizedTypeSyntax occurs to me.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: buildFdSets: file descriptor out of range

2009-07-14 Thread Brandon S. Allbery KF8NH

On Jul 14, 2009, at 21:48 , Kazu Yamamoto (山本和彦) wrote:

running well at the beginning. But after several hours, it receives an
error, "buildFdSets: file descriptor out of range".


I believe the runtime uses select(), which has a hard limit (enforced  
by the kernel) that the maximum file descriptor id be 1023.  (select()  
uses bitmasks and there is a limit on the size of a bitmask; see  
FD_SETSIZE.)



- pushes the limit of file descriptors to 65536 with setResourceLimit.



Reduce this to 1024, otherwise the runtime will eventually find itself  
dealing with file descriptors beyond the select() limit mentioned  
above.  Someone with more knowledge of the Haskell runtime will have  
to advise as to possible ways around it if you really need more than  
1024 file descriptors.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: buildFdSets: file descriptor out of range

2009-07-14 Thread Brandon S. Allbery KF8NH

On Jul 15, 2009, at 00:42 , Kazu Yamamoto (山本和彦) wrote:
I don't believe my server receives 1024 connections at once. So, I  
guess

file descriptors leak.


IIRC finalization of file handles is delayed, so there is effectively  
a leak in the runtime where unused file descriptors don't get freed  
until the Handle itself is garbage collected due to memory (i.e. the  
runtime makes no attempt to collect unreferenced file handles per se).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: buildFdSets: file descriptor out of range

2009-07-16 Thread Brandon S. Allbery KF8NH

On Jul 16, 2009, at 03:32 , Johan Tibell wrote:

2009/7/16 Kazu Yamamoto 
> I have a standalone (i.e. not integrated into the RTS yet) proof  
of concept
> working using kqueue. However, to be portable we still need to  
fall back to
> select on systems that don't support anything better. This implies  
that if you

> want to write portable code you still suffer from this limit.

If portability is important, how about falling back to poll(), not
epoll()?

We could provide poll as a possible backend but I don't think it's  
available on Windows.



http://plibc.sourceforge.net/ ?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to know data size in UDP?

2009-10-29 Thread Brandon S. Allbery KF8NH

On Oct 29, 2009, at 04:31 , Kazu Yamamoto (山本和彦) wrote:

Since the handle is associated with UDP, the entire data size should
be known when a UDP packet arrived. But I cannot find a way to know
data size. (I want a function like hFileSize.) Note that hGetContents
blocks.


The short answer is:  you can't.  You need to find a way to make  
recv() work.


Longer:  read() is intended for streams.  If you read() a datagram  
socket you may get a single packet or the system may combine packets;  
which one happens depends on the kernel implementation, and you are  
not guaranteed to have anything sane happen.  The best case for you  
would be if the system returns a single packet per system call, in  
which case you read() into a maximally sized buffer and the returned  
length is that of the actual packet.  However, many systems choose to  
retain the stream nature of read() and will return any information  
that comes in, losing the packet boundaries.


In the case of DNS, you can almost get away with this anyway because  
the protocol specifies a maximum UDP request/response length of 255  
octets sent as a single packet.  If this is insufficient, you need to  
switch to TCP.  In the case of a response, you will get a truncated  
response and will need to recognize it by parsing the data and retry  
the query over TCP.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Porting to DragonFly BSD

2009-11-15 Thread Brandon S. Allbery KF8NH

On Nov 14, 2009, at 11:16 , Colin Paul Adams wrote:

This seems to work up to a point. That is I get no crashes in ghci.

I do appear to have some line-feed problems. So if I type:

Prelude> let x = 10

It appears to do nothing, but that is not the case - I can then
overtype with :t x and ghci responds with:

x :: Integerxx = 10
Prelude>

So maybe this is a readline/haskelline issue?


Known issue, yes, also seen on OSX.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: :set -fbreak-on-exception in GHCi causes exception in readFile

2009-11-20 Thread Brandon S. Allbery KF8NH

On Nov 20, 2009, at 12:25 , Sean Leather wrote:
Perhaps I don't quite get how this works, but when I :set -fbreak-on- 
exception in GHCi, I get an exception using readFile. It reads the  
entire file and then throws what appears to be an EOF exception.



I believe that's normal; the runtime normally handles the exception  
itself, so you normally don't see it, but in principle you could catch  
it and perhaps do finalizer-ish things.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: :set -fbreak-on-exception in GHCi causes exception in readFile

2009-11-20 Thread Brandon S. Allbery KF8NH

On Nov 20, 2009, at 13:02 , Sean Leather wrote:

On Fri, Nov 20, 2009 at 18:31, Jose Iborra wrote:
This is by design, -fbreak-on-exception breaks on any exception, be  
it captured or not, even on library code.


Ah, that's what I missed. I would've guessed that it only breaks on  
uncaught exceptions.


But then you can't easily debug your exception handling code.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ANNOUNCE: GHC version 6.12.1

2009-12-14 Thread Brandon S. Allbery KF8NH

On Dec 14, 2009, at 14:04 , Jost Berthold wrote:
The reason is, when packaging "parallel", this package has been  
removed from the GHC core libraries. BTW I am unsure whether this is  
at all clever, since it needs specific GHC support (at least for now  
- am I right here?)



Only to the extent that the (standardized) primitives are only in GHC;  
the packages were released and tested with 6.10.x.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC FFI stub files

2010-02-23 Thread Brandon S. Allbery KF8NH

On Feb 21, 2010, at 23:46 , Tyson Whitehead wrote:
I'm writing a perl module that interfaces some haskell code and its  
a bit of a

pain because both perl and ghc have their own custom build system.

Is there a way to get ghc to give you the gcc/as/ld options (library  
paths,
include paths, flags, etc) required for the FFI stub files it  
generates?


-n -v3 might be helpful.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: "static_wrapper" imports in the FFI

2010-03-16 Thread Brandon S. Allbery KF8NH

On Mar 16, 2010, at 19:47 , Isaac Dupree wrote:

On 03/16/10 19:38, Iavor Diatchki wrote:

The fact that, at present, all GHC-compiled programs require an
executable data segment is a fairly significant problem.
Something doesn't add up for me here.  If *all* GHC-compiled  
programs require an executable data segment, then how could a  
preprocessor possibly remedy this problem? (and likewise, how does  
the static_wrapper patch do so...)



A goodly chunk of the RTS uses the FFI to access host functions;  
presumably he also intends rewriting those to use the new import/ 
export type.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Proposal: priority queues in containers

2010-03-18 Thread Brandon S. Allbery KF8NH

On Mar 18, 2010, at 18:33 , Milan Straka wrote:
I would like to have basic data structures connected together. I do  
not
really mind if the modules are in one library or in several, as long  
as

I could say "I want 'containers'."


This is what the Haskell Platform is for.  No real need to add more  
stuff to containers; if anything, the libraries stored there should be  
decoupled so that e.g. the recent Data.Map proposals wouldn't disturb  
programs not using Data.Map.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Proposal: priority queues in containers

2010-03-18 Thread Brandon S. Allbery KF8NH

On Mar 18, 2010, at 19:50 , Thomas Schilling wrote:

The Haskell Platform is really is intended to be available at your
fingertips.  Unfortunately, the following does not work (although I
thought it's supposed to)

$ cabal install haskell-platform


Other way around:  installing the Haskell Platorm gives you ghc, a set  
of libraries known to work with that version of ghc and with each  
other, and cabal-install.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: FFI calls: is it possible to allocate a small memory block on a stack?

2010-04-17 Thread Brandon S. Allbery KF8NH

On Apr 15, 2010, at 15:34 , Denys Rtveliashvili wrote:
As for the performance of "alloca", I though it would be faster than  
"malloc". However, in a simple test I have just written it is  
actually slower. The test allocates 16-bytes arrays and immediately  
de-allocates them. This operation is repeated 10 times. On  
my computer the C program takes 27 seconds to complete while Haskell  
version takes about 41.



Your C program is doing nothing but adjusting linked lists after the  
first time the block is allocated.  free() puts the block at the head  
of a linked list of free blocks, and malloc() will find it there,  
unlink and return it.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Dynamic libraries and GHCi

2010-05-20 Thread Brandon S. Allbery KF8NH

On May 20, 2010, at 06:23 , Simon Marlow wrote:

On 18/05/2010 17:48, John Lato wrote:

From: Simon Marlow

But currently there is one problem with "GhcShared=YES": with this
option, the stage-2 compiler gets linked dynamically but the
corresponding inplace shell wrapper does not set  
(DY)LD_LIBRARY_PATH,
thus ./inplace/bin/ghc-stage2 doesn't run at all. I could work  
around
this by manually symlinking all the dynamic libraries to ./ 
inplace/lib
and setting (DY)LD_LIBRARY_PATH to there, but obvisouly there  
should

be a solution better than this.


On Linux we link the binary using -rpath (I know OS X doesn't have
-rpath).  This is another issue we need to resolve before we can  
switch

to a dynamically-linked GHCi.


When you say OSX doesn't have -rpath, do you mean there's some  
problem

with using -rpath on OSX?  I have code that links to a 3rd-party
library (libcudart.dylib) at runtime and it seems to use -rpath fine.
This is with ghc-6.12.1.


It was my understanding that OS X doesn't have -rpath from reading

http://hackage.haskell.org/trac/ghc/wiki/SharedLibraries/Management

and from what I remember Mac people saying in the past.  Or maybe  
they were just saying that -rpath is not the right thing on OS X  
because libraries themselves have paths baked in.



The latter.  Also, I'd recommend DYLD_FALLBACK_LIBRARY_PATH per Apple  
recommendations, as you can otherwise get weird results.


Note also that the baked-in path is the path of last resort.  It might  
be possible to (ab)use this.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Dynamic libraries and GHCi

2010-05-20 Thread Brandon S. Allbery KF8NH

On May 20, 2010, at 08:29 , John Lato wrote:

On Thu, May 20, 2010 at 1:07 PM, Brandon S. Allbery KF8NH
 wrote:

On May 20, 2010, at 06:23 , Simon Marlow wrote:

On 18/05/2010 17:48, John Lato wrote:

From: Simon Marlow
But currently there is one problem with "GhcShared=YES": with  
this

option, the stage-2 compiler gets linked dynamically but the
corresponding inplace shell wrapper does not set  
(DY)LD_LIBRARY_PATH,
thus ./inplace/bin/ghc-stage2 doesn't run at all. I could work  
around
this by manually symlinking all the dynamic libraries to ./ 
inplace/lib
and setting (DY)LD_LIBRARY_PATH to there, but obvisouly there  
should

be a solution better than this.


On Linux we link the binary using -rpath (I know OS X doesn't have
-rpath).  This is another issue we need to resolve before we can  
switch

to a dynamically-linked GHCi.


When you say OSX doesn't have -rpath, do you mean there's some  
problem

with using -rpath on OSX?  I have code that links to a 3rd-party
library (libcudart.dylib) at runtime and it seems to use -rpath  
fine.

This is with ghc-6.12.1.


It was my understanding that OS X doesn't have -rpath from reading

http://hackage.haskell.org/trac/ghc/wiki/SharedLibraries/Management

and from what I remember Mac people saying in the past.  Or maybe  
they

were just saying that -rpath is not the right thing on OS X because
libraries themselves have paths baked in.


The latter.  Also, I'd recommend DYLD_FALLBACK_LIBRARY_PATH per Apple
recommendations, as you can otherwise get weird results.


According to the dyld docs, it looks like -rpath is meant to be used
as a last resort when other mechanisms aren't feasible.  In
particular, "The use of @rpath is most useful when  you  have  a
complex  directory structure  of  programs  and  dylibs  which can be
installed anywhere, but keep their relative positions." [1]

I suppose I'd agree that it's best avoided on OSX if it can be helped.


Interesting, considering that Apple's recommended use case appears to  
be exactly what we're looking for.


Oh, also?  @rpath isn't mentioned in dyld(1) on Leopard and is barely  
referenced in ld(1), which is why I missed it (and probably part of  
why -rpath was ignored).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Unexpected NoImplicitPrelude behaviour in GHCi (bug?)

2010-06-10 Thread Brandon S. Allbery KF8NH

On Jun 10, 2010, at 05:59 , Philip K.F. Hölzenspies wrote:

[holze...@ewi1043:work/FPPrac]% ghci BugDemo.hs
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling BugDemo  ( BugDemo.hs, interpreted )
Ok, modules loaded: BugDemo.
*BugDemo> 5
5
*BugDemo> :t 5
5 :: (P.Num t) => t
*BugDemo> :q
Leaving GHCi.
[holze...@ewi1043:work/FPPrac]% ghci -fno-implicit-prelude BugDemo.hs
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling BugDemo  ( BugDemo.hs, interpreted )

on the commandline:
   Warning: -fno-implicit-prelude is deprecated: use
-XNoImplicitPrelude or pragma {-# LANGUAGE NoImplicitPrelude #-}  
instead

Ok, modules loaded: BugDemo.
*BugDemo> 5

:1:0: Not in scope: `>>'


This doesn't surprise me; when putting it in the module, it affects  
only that module.  When using either command line version, it affects  
*everything*... and what's breaking is not your definition of  Number,  
but the ghci expression printer (which, being in IO, is doing  
something like (print it >> putStr "\n").  Since the command line  
option has global effect, the Prelude's (>>) isn't defined for ghci's  
guts either.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: new recursive do notation (ghc 6.12.x) spoils layout

2010-06-20 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 6/21/10 13:18 , John Lask wrote:
> it does spoil the nice layout - it would be nice to just be able to write
> (which does not parse)
> 
>   do rec
> a <- getChar
> b <- f c
> c <- g b
> putChar c
> return b
> 
> I don't particularly care that the only recursive statements are #2,#3 - I
> just want my nice neat layout back. I have just spent an inordinate amount
> of time updating code when if the parser recognised "do rec" as a recursive
> group it would have been a drop in replacement and taken me one tenth of the
> time.

I think this would just require the lex layout rules already in place for
do/let in GHC; my guess is that your example would work if the body were
indented past the "r" of "rec".

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkweuP0ACgkQIn7hlCsL25XifQCgzvfvf9utQxkb2gdmVRPyhea2
iIUAnRT8XUhTKds0wrVkFaccyzAKTA9v
=YjX6
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Possible bug with GADTs?

2010-08-17 Thread Brandon S Allbery KF8NH

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/17/2010 03:22 PM, Ben Moseley wrote:
> {-# LANGUAGE GADTs #-}
> module Foo where
>
> data TemplateValue t where
>   TemplateList :: [x] -> TemplateValue [x]
>
> instance (Eq a) => Eq (TemplateValue a) where
>   (==) (TemplateList b) (TemplateList c) = (==) b c  -- here we have a
== [x]
>
> Could not deduce (Eq x) from the context (a ~ [x1])
>
> It looks as though it has decided to use the (instance Eq x => Eq [x])
instance, and hence is searching for Eq x (which can't be deduced)
rather than using the (Eq a / Eq [x]) directly.  So, I guess that's an
interesting question why that happens...

Hm... isn't that a case of overlapping and/or incoherent instances?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxrXlgACgkQIn7hlCsL25USIQCfZ2cZXlZJZxVLI/m4pWkfA4+f
18EAnjIsecXNpJNbYUyfIPs7uTgoNi5M
=8tG5
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: __emutls_get_address link problem

2010-08-23 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/23/10 11:57 , Christian Maeder wrote:
> However, when I try to compile the simplest source with on older
> gcc-3.4.4 I get the link error below, but only for the threaded rts!
> 
> With ghc-6.12.1 and gcc-4.x.y (x < 3) I did not have such a problem when
> switching to a machine that only has gcc-3.4.4.

You got lucky; mixing GCC major versions like that is not expected (much
less guaranteed) to work in general.  GCC evidently changed the way it
implements some thread support routines between gcc3 and gcc4.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxypcMACgkQIn7hlCsL25XfwQCgobnqHhGUL+uvKQ1o++yL6kt7
m3MAn2BV55Tvv2gfG8WEV3jyATeAVytN
=LGuK
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: __emutls_get_address link problem

2010-08-25 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/25/10 11:37 , Christian Maeder wrote:
> Christian Maeder schrieb:
>> Simon Marlow schrieb:
>>> On 23/08/2010 17:45, Brandon S Allbery KF8NH wrote:
>>>> On 8/23/10 11:57 , Christian Maeder wrote:
>>>>> However, when I try to compile the simplest source with on older
>>>>> gcc-3.4.4 I get the link error below, but only for the threaded rts!
>>>>>
>>>>> With ghc-6.12.1 and gcc-4.x.y (x<  3) I did not have such a problem when
>>>>> switching to a machine that only has gcc-3.4.4.
>>>> You got lucky; mixing GCC major versions like that is not expected (much
>>>> less guaranteed) to work in general.  GCC evidently changed the way it
>>>> implements some thread support routines between gcc3 and gcc4.
> 
> Why should it not be possible to create object files (like also dynamic
> libs) with (very) different compilers?

All bets are off when it comes to compiler support routines.  Anyone who's
tried to link code generated by gcc with code generated by SunPro/Forte C on
Solaris knows this one from experience.  Those of us old enough to remember
early versions of gcc do too; it took a while for the support to become
stable, then libg++/libstdc++ went through the same thing later, then the
gcc/egcs split (aka the gcc2/gcc3 split).  Red Hat's cowboy 2.95.3 release
also caused a lot of grief.  gcc3 to gcc4 is the exception, not the rule.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx1WiYACgkQIn7hlCsL25Vb7wCgqa3cCKh3aTtd/OhyYQjkrwmD
5twAoLUPM0yXBjw7i701V6XTUxmA8D7D
=/Nnw
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: how to terminate an external program after timeout?

2010-09-09 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/9/10 05:35 , Christian Maeder wrote:
>  System.Process.readProcessWithExitCode "metis" filename ""

If all else fails, there's:

sh -c '(sleep 120; kill -TERM $$ >/dev/null 2>&1) & exec metis'

which makes the shell deal with timeouts for you.  (Adjust sleep time and
kill signal as needed.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyJOIUACgkQIn7hlCsL25VzdwCfcFW/LHTRslit2P4en/o3V88j
VEcAnjTB6Dzhpc74TmIvvTUwXwENhDz/
=8ROO
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: how to terminate an external program after timeout?

2010-09-10 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/10/10 04:59 , Christian Maeder wrote:
> Brandon S Allbery KF8NH schrieb:
>> On 9/9/10 05:35 , Christian Maeder wrote:
>>>  System.Process.readProcessWithExitCode "metis" filename ""
>>
>> If all else fails, there's:
>>
>> sh -c '(sleep 120; kill -TERM $$ >/dev/null 2>&1) & exec metis'
> 
> Yes, I've considered something like this, too. It does not give metis a
> chance to terminate earlier, does it?

If metis exits, the backgrounded sleep will keep going, the kill will
silently fail, in effect that can be ignored.  It would be possible to set
up something that nuked the background sleep but then getting the full exit
status of metis (if needed; i.e. signals) is complex.

(If your shell is too smart to let the background process deal with itself,
toss in a "disown %1" before exec-ing metis.  Shells that do
interactive-style process management when not interactive are broken, though.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyKVwwACgkQIn7hlCsL25ULkACfafrUFq15UNp8FnnfvtmtpP7E
LfwAnA/8rX/k9E4nrqGB8cwB8kexId/5
=Hchn
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: unicode characters in operator name

2010-09-10 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/10/10 21:39 , Daniel Fischer wrote:
> On Saturday 11 September 2010 03:12:11, Greg wrote:
>> a unicode symbol (defined as any Unicode symbol or punctuation).  I'm
>> pretty sure º is a unicode symbol or punctuation.
> 
> Prelude Data.Char> generalCategory 'º'
> LowercaseLetter
> 
> weird, but that's how it is. If it were a symbol or punctuation, you 
> couldn't use it in function names like fº.

"Weird", but that's how Spanish at least treats it; it's a visually distinct
lowercase "o" (along with the visually distinct lowercase "a", "ª") which
indicates gender on an abbreviated ordinal ("primero" => "1º", "primera" =>
"1ª"; by convention they are raised, but "1o"/"1a" are equally valid).

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyK37UACgkQIn7hlCsL25XPcACgmOhZ/0rM05l1/bPQ2EJNLZZS
87UAoIeyBNAefnbctVB0Ld7hrovRX4R5
=Qyau
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: unicode characters in operator name

2010-09-10 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/10/10 21:12 , Greg wrote:
> unicode symbol (defined as any Unicode symbol or punctuation).  I'm pretty
> sure º is a unicode symbol or punctuation.

No, it's a raised lowercase "o" used by convention to indicate gender of
abbreviated ordinals.  You probably want U+00B0 DEGREE SIGN instead of
U+00BA MASCULINE ORDINAL INDICATOR.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyK4CEACgkQIn7hlCsL25VOngCgu5qkmMzgIw/yBd6G3EikXT88
6AkAoKDXh+NIuN5XgT6A/vA0FVkFfsnJ
=NOt1
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Cabal constraint solver

2010-10-02 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/2/10 18:07 , Christian Höner zu Siederdissen wrote:
> cd syb-0.2.1
> * remove base<4.3 constraint from syb.cabal
> cabal install
> * syb-0.2.1 is now installed and works!
> 
> $ cabal install parsec-3.1.0
> cabal: cannot configure syb-0.2.1. It requires base >=4.0 && <4.3
> 
> This is rather annoying: the constraint is solved (eg. syb is installed)
> but we /still/ assume that we can not continue. So obviously, I would
> like to be able to have cabal assume constraints fullfilled if the
> package is installed.

This is unsafe because the package database (which isn't maintained by
cabal, but by ghc; see the ghc-pkg command) doesn't store the constraints.
So cabal can't tell if that *particular* build was against the version of
base it needs for everything else.  (ghc can have multiple versions of base
around; see the 6.10 series.  I *think* ghc is constrained to only
supporting it for different major versions, but it can't tell Cabal that.)

Now, it is arguable that if there is no different release of base in the
package database then it should assume the visible release is the one used;
but you again run into the limitations of ghc-pkg.  If I "ghc-pkg hide" a
given package release, dependents of that package don't also get hidden
because (again) ghc-pkg doesn't store that information.  So now you end up
with the same problem except it will show up when you try to use one of the
dependents, and (worse) because Cabal can't tell this happened you will at
best get an unexpected type mismatch at compile time and at worst the
program will compile but dump core (if the mismatch is in base.  It's hard
to validate that runtimes are compatible, and base is very tightly bound to
the runtime).

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkynvHgACgkQIn7hlCsL25XttACfQ+9G4bIAOnQVwJddDBizaPba
uU4AoJjFXPkeqcloqp8w2COQ4I0bh+nk
=sZhw
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: network programming with GHC 7

2010-10-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/28/10 05:16 , Kazu Yamamoto (山本和彦) wrote:
> When I compiled a network server with GHC 7 without the "-threaded"
> option and ran it, I got the following error.
> 
>   file descriptor 5496824 out of range for select (0--1024).

I would be extremely suspicious of memory corruption with an fd that large;
it would indicate a kernel file table several tens of megabytes in size and
a minimum 10MB per-process file table associated with every process (on
Unix, but similar concerns probably apply on Windows).

(Also, I thought the new I/O manager didn't use select(), specifically
because it has annoying limitations like the above.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzNwcsACgkQIn7hlCsL25V10ACdE6JOxEcTqbSarM0xnff3Bg7d
9Z0AoLPNWTCfJSF8BG7IDU6/Vghwcr/Q
=Onzb
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Loop optimisation with identical counters

2010-11-05 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/5/10 19:22 , David Peixotto wrote:
> Probably there are some wins to be had by choosing a good optimization
> sequence for the code generated from GHC, rather than just using `-O1`,
> `-O2`, etc. I believe It should be possible to find a good optimization
> sequence that would work well for Haskell codes.

Didn't someone (dons?) already make a start on this?

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzUtdQACgkQIn7hlCsL25VG6ACeJ3sSXoI4YLbXW3KIFVMqKqdK
oTsAn23bxl0mvfdl3up69xM4qWPnklGj
=TXBk
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: List vs Data.List

2010-11-18 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/18/10 13:06 , Serge D. Mechveliani wrote:
> In  ghc-7.0.1,  to import `partition', it is sufficient the line
> 
>import List (partition), 
> 
> but to import `intercalate', it is needed
>import Data.List (intercalate).
> 
> Does  Haskell-2010  differ between  List  and  Data.List  import?

Haskell-2010 specifies Data.List.  List is only for Haskell98.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzliWgACgkQIn7hlCsL25XloQCggEV8ndpBEJp435VQj9ZqMqMp
hicAnjrX7gQs7KYyW97c9HpkJcz3kKHJ
=4yB5
-END PGP SIGNATURE-
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Problems with openFd and -threaded

2010-12-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/29/10 18:36 , Bryan O'Sullivan wrote:
> On Sat, Nov 27, 2010 at 9:05 PM, wren ng thornton  > wrote:
> 
> So I've just started playing around with STM and -threaded programs and
> I've run into a bug. The bug is similar to [1] except that the file in
> question is a Posix FIFO instead of a Bluetooth device. Same behavior:
> always errors with -threaded, but expected behavior when not -threaded
> (i.e., blocks until another process opens the other end of the FIFO).
> GHC version is 6.12.1.
> 
> Isn't that pretty normal? Just retry if you get EINTR, that's what
> throwErrnoIfMinus1 and friends are for:

The problem is the interrupting signal is the timer interrupt used by the
runtime system; this should not be visible to user programs, instead the
runtime should *itself* restart the operation.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkz5Uv4ACgkQIn7hlCsL25UOLACgz85SXrIH54c5zVZHot0FTzqW
Z9cAoKa6ViYVrT4U5PaYwVF34oM6lahv
=o2md
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to develop on a (GHC) branch with darcs

2010-12-07 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/7/10 21:42 , David Peixotto wrote:
> P.S.
> Apparently Linus used to use Lennart's method of diff and patch for version 
> control before switching to bitkeeper and then git: 
> http://www.youtube.com/watch?v=4XpnKHJAok8 about 10:30 minutes in. I guess 
> it's a sign of a true hacker :)

Right up until it bit him in the butt and he released a trashed kernel
source tree as a result.  (When is about when most people finally figure out
that VCSes aren't pointless busywork.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkz/AVgACgkQIn7hlCsL25WorwCggF2OuwKWnVufktcfvA3rUZTw
kqcAnj5K9UxzhE8/Fx8npAqNOvG39r1d
=W2g7
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [darcs-users] How to develop on a (GHC) branch with darcs

2010-12-08 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/8/10 03:45 , Simon Peyton-Jones wrote:
> | known problem with darcs with no obvious solution.  For me, switching
> | GHC to git would certainly be a win.
> 
> I have personal experience of git, because I co-author papers with git users. 
> I am not very technologically savvy, but my failure rate with git is close to 
> 100%.  Ie I can do the equivalent of 'pull' or 'push' but I fail at 
> everything else with an incomprehensible error message.  Maybe I just need 
> practice (or more diligence), but I really don't understand git's underlying 
> model, despite trying, and reading several tutorials.  If anyone has a 
> favourite "how to understand git" doc, do point me at it.

I'm tempted to point out that Linux named it "git" for a reason.  :)

Mercurial might be a better choice, especially for people familiar with darcs.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkz/sgQACgkQIn7hlCsL25WV7gCdF48m1hMxoQUc/NpW08zfye3P
7+sAnRy8ef3nImblBPGcXQPCzFWbdP2h
=/Xf1
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: backward compatibility

2011-01-20 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 1/20/11 12:09 , Sittampalam, Ganesh wrote:
> Simon Marlow wrote:
>> judgement as to whether we should spend effort on backwards
>> compatibility or not.  Perhaps we're getting it wrong - so feedback
>> from 
>> users is always valuable.
> 
> From the point of view of darcs, which is usually trying to support 2 or 3 
> GHC versions at a time, one cycle of deprecation makes life a lot simpler. We 
> do look at warnings and try to fix them, but it's nicer not to have to do so 
> in a real hurry.

And of the Haskell Platform, etc.  Think of it as the price of failing to
avoid success.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk04bpsACgkQIn7hlCsL25Wh2QCgydcO3kZGxRTePJvp+HvnZloI
r/wAn0YIv8ZqN6ZS9WNMvaH86F3AHZgl
=m18O
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: backward compatibility

2011-01-20 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 1/20/11 21:12 , Ian Lynagh wrote:
> On Thu, Jan 20, 2011 at 09:22:37PM +0100, Axel Simon wrote:
>> I therefore think that keeping the number of extensions 
>> to a minimum should be a high priority. It seems that the ghc team is 
>> going overboard with the amount of extensions and their granularity that 
>> I do not believe that there will ever be another compiler since 
>> implementing all these extensions is a nightmare. The road of may 
>> extensions is leading down the road that the Haskell standards aimed to 
>> avoid: having a single implementation defining what a Haskell program can 
>> be.
> 
> I'm not sure if you're saying there should be fewer new language
> features implemented, less fine-grained control over which are enabled,
> or something else?

"Many of the new features ought to be changes to the standard, not
individual language features that might or might not be implemented by
various compilers."

Less fine-grained control could be taken as a subset of this; consider that
Haskell2010 can be understood as Haskell98 + a number of language extensions
(or de-extensions in the case of n+k).

I think he has a good point:  having too many individual language features
significantly raises the bar for what other compilers need to at least
consider supporting.  Even if we don't necessarily change the official
standard, perhaps there should be standard packages of extensions which
compilers are encouraged to support even if they don't support fine-grained
extension control.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk05BEcACgkQIn7hlCsL25VBnwCfT9nCZ5eLs4oJ3jUFHf3Tl8o1
7DwAnicvaNk6XuT0H1pZbaotzjKGoP+/
=vqzt
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users