Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Neil Mitchell
Hi Prelude :b Control.Concurrent.MVar module 'Control.Concurrent.MVar' is not interpreted :b now defaults to :breakpoint, you want :browse Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-30 Thread Jon Harrop
On Friday 30 November 2007 00:31, Justin Bailey wrote: I represent the automata as an array of integers, where each bit represents a cell. Mathematica uses a single arbitrary-precision integer to represent each generation of a 1D automaton. The rules to derive the next generation are compiled

Re: [Haskell-cafe] Re: New slogan for haskell.org

2007-11-30 Thread Ketil Malde
Yitzchak Gale [EMAIL PROTECTED] writes: Guido is clearly not rejecting functional influences on Python, he is supporting them. But he feels that these specific instances do not fit in. I read some of his statements, and find that I disagree vehemently. But I wonder if partial evaluation is

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-30 Thread Luke Palmer
On Nov 30, 2007 6:03 PM, Justin Bailey [EMAIL PROTECTED] wrote: On Nov 29, 2007 9:11 PM, Jon Harrop [EMAIL PROTECTED] wrote: Mathematica uses a single arbitrary-precision integer to represent each generation of a 1D automaton. The rules to derive the next generation are compiled into

Re: [Haskell-cafe] Re: Re: cabal-install

2007-11-30 Thread Duncan Coutts
On Thu, 2007-11-29 at 23:56 +0100, Ben Franksen wrote: Duncan Coutts wrote: On Wed, 2007-11-28 at 21:00 +0100, Thomas Schilling wrote: On Wed, 2007-11-28 at 20:46 +0100, Ben Franksen wrote: [EMAIL PROTECTED]: .../software/haskell cd cabal [EMAIL PROTECTED]: .../haskell/cabal

Re: [Haskell-cafe] fast Array operations: foldl, drop

2007-11-30 Thread Don Stewart
lemming: On Fri, 30 Nov 2007, Ketil Malde wrote: Bryan O'Sullivan [EMAIL PROTECTED] writes: For higher dimensions, there are enough options in terms of traversal direction and what exactly e.g. a fold should fold over (single elements? lower-dimensional slices?) that a sensible

[Haskell-cafe] Re: Re: Re: cabal-install

2007-11-30 Thread Ben Franksen
Duncan Coutts wrote: Apropos beta-testing, cabal-1.3 seems to have introduced an incompatible API change; for instance, it can't build MissingH any longer. Actually it was 1.2.x that made this change. Ok. I realized it wasn't 1.3 as I remarked later: One install of cabal-install later:

[Haskell-cafe] Re: Re: Re: Waiting for thread to finish

2007-11-30 Thread Ben Franksen
Paul Moore wrote: On 28/11/2007, Ben Franksen [EMAIL PROTECTED] wrote: It was fun, too. For instance, the OP's question reminded me of a little generic wrapper I wrote -- more or less for my own amusement -- during the course of this project. It outputs dots during an operation that might

[Haskell-cafe] trouble building unix-2.2.0.0 on cygwin

2007-11-30 Thread Galchin Vasili
Hello, 0) All work being done on cygwin. Version 6.8.1 of ghc. 1) I ran runhaskell Setup.lhs configure and did a tail -f config.log in order to follow the config process. 2) Next I did the build runhaskell Setup.lhs build but there were many include files referenced in HsUnix.h

Re: [Haskell-cafe] Rigid type-var unification failure in existentials used with parametrically polymorphic functions

2007-11-30 Thread Ryan Ingram
It seems you've already figured this out, but here's a quick counterexample: {-# LANGUAGE ExistentialQuantification, RankNTypes #-} module Box where data Box = forall a. B a --mapBox :: forall a b. (a - b) - Box - Box -- incorrect type mapBox f (B x) = B (f x) then: boxedInt :: Box

Re: [Haskell-cafe] Re: Working out which library to use

2007-11-30 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Neil, Friday, November 30, 2007, 1:32:25 AM, you wrote: 1. For certain tasks, there are multiple possible packages, and it's not really clear which one to go for. Having more than one choice is good. This can be solved easily using blogs. If you

Re: [Haskell-cafe] Haskell and DB : giving up

2007-11-30 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Andrew, Thursday, November 29, 2007, 11:51:32 PM, you wrote: This is one of the more frustrating aspects of Haskell. It's not that nobody has written DB bindings - they most certainly have. It's not that nobody has written compression or cryptography bindings -

Re: [Haskell-cafe] Progress indications

2007-11-30 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Nov 29, 2007, at 17:13 , Thomas Hartman wrote: but there's no risk using trace is there? If you're doing any other I/O, you may be surprised by where the trace output shows up relative to it. How about if the I/O is to write to a different stream?

Re: [Haskell-cafe] Design of a Physics Interface

2007-11-30 Thread Dan Weston
There seems to be three salient benefits of using arrows, as I read the Abstract and Introduction of Benjamin Lerner, Arrow Laws and Efficiency in Yampa, 2003, http://zoo.cs.yale.edu/classes/cs490/03-04a/benjamin.lerner/ 1) The discipline of using arrows assists in avoiding space-leaks The

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-30 Thread Justin Bailey
On Nov 29, 2007 9:11 PM, Jon Harrop [EMAIL PROTECTED] wrote: Mathematica uses a single arbitrary-precision integer to represent each generation of a 1D automaton. The rules to derive the next generation are compiled into arithmetic operations on the integer. The offloads all such work onto

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-30 Thread Justin Bailey
On Nov 29, 2007 4:45 PM, Felipe Lessa [EMAIL PROTECTED] wrote: Why don't you use an UArray of Bools? They're implemented as bit arrays internally, AFAIK (e.g. see http://www.haskell.org/haskellwiki/Shootout/Nsieve ). And then you would get rid of a lot of shifts and masks in your code --

Re: [Haskell-cafe] Design of a Physics Interface

2007-11-30 Thread Bit Connor
I think your integrate function looks like a good idea: integrate :: TimeStep - World - World For bodies, I think you should have a BodyID type, and then to add a body to the world you could have a function: newBody :: (Position, Velocity) - World - (BodyID, World) To delete a body:

Re: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Henning Thielemann
On Fri, 30 Nov 2007, Daniel Fischer wrote: Am Freitag, 30. November 2007 14:39 schrieb Henning Thielemann: Is this thread still about the prime sieve? As I mentioned, I think one can avoid the mutable array, because if there is only a small number of array updates with much changes per

Re: [Haskell-cafe] Re: Re: Re: Hit a wall with the type system

2007-11-30 Thread Jed Brown
On 30 Nov 2007, [EMAIL PROTECTED] wrote: Sure. To be more specific, here's the contract I would really like. 1. You need to pass in a polymorphic function a - a, where a is, at *most*, restricted to being an instance of Floating. This part I can already express via rank-N types. For

[Haskell-cafe] Re: Categories list in French (off-topic?)

2007-11-30 Thread Maurí­cio
Laurent Deniau escreveu: Maurí­cio wrote: Hi, I'm learning about categories using Saunders Mac Lane book. I'm also learning French. Do you guys know of a nice French mailing list, or forum, where people discuss about categories (and where beginners are accepted)? newsgroup: fr.sci.math a+,

Re: [Haskell-cafe] A tale of Project Euler [ST]

2007-11-30 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Andrew, Friday, November 30, 2007, 12:10:16 AM, you wrote: I don't understand the ST monad. From what I can tell, it's not definable without using strange language extensions. (I don't really like using things where it's unclear why it works.)

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-30 Thread Laurent Deniau
Justin Bailey wrote: On Nov 29, 2007 9:11 PM, Jon Harrop [EMAIL PROTECTED] wrote: Mathematica uses a single arbitrary-precision integer to represent each generation of a 1D automaton. The rules to derive the next generation are compiled into arithmetic operations on the integer. The offloads

Re: [Haskell-cafe] Re: New slogan for haskell.org

2007-11-30 Thread Johan Tibell
I really like the friendly look of Ruby's homepage: http://www.ruby-lang.org/en/ * There's an interpreter download button in a high visibility position. * Visible news. * It's pretty! * A very short introduction. Ruby is... ... which is so generic, that we can copy it to the

Re: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Daniel Fischer
Am Freitag, 30. November 2007 14:39 schrieb Henning Thielemann: Is this thread still about the prime sieve? As I mentioned, I think one can avoid the mutable array, because if there is only a small number of array updates with much changes per update, it should be efficient enough to copy the

Re: [Haskell-cafe] Re: New slogan for haskell.org

2007-11-30 Thread Henning Thielemann
On Fri, 30 Nov 2007, Johan Tibell wrote: On Nov 30, 2007 1:30 AM, Ivan Miljenovic [EMAIL PROTECTED] wrote: Speaking of Stackless Python, its homepage (http://www.stackless.com/) has a rather nice layout... maybe slightly less emphasis on the About section, but there you've got the links,

[Haskell-cafe] Design of a Physics Interface

2007-11-30 Thread Luke Palmer
I'm currently working on idioms for game programming using FRP. After going through several representations of physics as arrows[1] I decided that physics objects must not be implemented as arrows, because introducing new arrows in the middle of a computation[2] leads to ugly pain. So far the

Re: [Haskell-cafe] Progress indications

2007-11-30 Thread Henning Thielemann
On Thu, 29 Nov 2007, Thomas Hartman wrote: but there's no risk using trace is there? 'trace' is really only for debugging. It should not appear in shipped libraries or programs. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Functional dependencies / monotonic boolean functions in Haskell

2007-11-30 Thread Henning Thielemann
I know there are Haskell people who are busy with hardware verification and relational algebra. (as indicated by http://www.haskell.org/haskellwiki/Relational_algebra http://www.haskell.org/haskellwiki/Applications_and_libraries/Hardware_verification ) Is there a Haskell library

Re[2]: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Henning Thielemann
On Fri, 30 Nov 2007, Bulat Ziganshin wrote: Hello Andrew, Thursday, November 29, 2007, 9:43:48 PM, you wrote: Fifth thing: better use an STUArray, don't drag IO in if it's not necessary. I don't understand the ST monad. it's just a subset of IO monad, with renamed operations

Re: [Haskell-cafe] Categories list in French (off-topic?)

2007-11-30 Thread Laurent Deniau
Maurí­cio wrote: Hi, I'm learning about categories using Saunders Mac Lane book. I'm also learning French. Do you guys know of a nice French mailing list, or forum, where people discuss about categories (and where beginners are accepted)? newsgroup: fr.sci.math a+, ld.

[Haskell-cafe] Re: Over-allocation

2007-11-30 Thread Simon Marlow
Gracjan Polak wrote: My program is eating too much memory: copyfile source.txt dest.txt +RTS -sstderr Reading file... Reducing structure... Writting file... Done in 20.277s 1,499,778,352 bytes allocated in the heap 2,299,036,932 bytes copied during GC (scavenged) 1,522,112,856 bytes copied

Re: [Haskell-cafe] Re: Waiting for thread to finish

2007-11-30 Thread david48
On Nov 28, 2007 11:07 PM, Maurí­cio [EMAIL PROTECTED] wrote: Sorry, I don't agree. I try to write things in a way that when you read it you can get an intuition on why it's doing what it's doing; even when the That's what comment are for :) generate. So, instead of checking if threads have

Re: [Haskell-cafe] fast Array operations: foldl, drop

2007-11-30 Thread Henning Thielemann
On Fri, 30 Nov 2007, Ketil Malde wrote: Bryan O'Sullivan [EMAIL PROTECTED] writes: For higher dimensions, there are enough options in terms of traversal direction and what exactly e.g. a fold should fold over (single elements? lower-dimensional slices?) that a sensible API doesn't

[Haskell-cafe] Re: New slogan for haskell.org

2007-11-30 Thread Mirko Rahn
The Haskell code works with arbitrary precision Integer, the C code with a fixed size int. This is also a work for a library (BTW like Haskell does), you can use gmp or mpfr. This will just add one line to store x/2 in y and avoid its recomputation. You will also have to switch from intset

Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Ketil Malde
Claus Reinke [EMAIL PROTECTED] writes: you might find it easier to use GHCi's :browse command While ghc -e works, this no longer work within GHCi? Prelude :b Control.Concurrent.MVar module 'Control.Concurrent.MVar' is not interpreted -k -- If I haven't seen further, it is by standing in

Re[2]: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Bulat Ziganshin
Hello Sebastian, Friday, November 30, 2007, 11:31:22 AM, you wrote: I don't see Data.Array.Base documented anywhere. (How did you know it exists?) i use library sources as reference. it allows to study implementation and learn good programming style -- Best regards, Bulat

Re: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Andrew Coppin
Sebastian Sylvan wrote: On Nov 29, 2007 9:10 PM, Andrew Coppin [EMAIL PROTECTED] wrote: How do you avoid accidentally recomputing the list multiple times? What do you mean? It's exactly the same as your original program but with ST instead of IO? Why would it get accidentally

Re: [Haskell-cafe] Hit a wall with the type system

2007-11-30 Thread David Roundy
On Thu, Nov 29, 2007 at 04:25:43PM -0800, Dan Weston wrote: I must be missing something, because to me the contract seems to be much simpler to express (than the Functor + Isomorphism route you seem to me to be heading towards): ... diff f a = if dx == dx' then error Zero denom else dydx

Re: [Haskell-cafe] Re: Strings and utf-8

2007-11-30 Thread Johan Tibell
Am I wrong to think that UTF8 should be THE standard? I believe it can encode anything encoded by other encodings. All the UTF-* encodings can encode the same code points. There are different trade offs though. Can't we consider non-utf8 text as legacy? I don't like that word, but I do

[Haskell-cafe] Re: Strings and utf-8

2007-11-30 Thread Maurí­cio
Language of messages is quite different from language of a file you read. (...) Yes, it's a fundamental limitation of the unix locale system and multi-user systems. However it's no less wrong than just picking UTF8 all the time. (...) Am I wrong to think that UTF8 should be THE standard?

Re: [Haskell-cafe] Rigid type-var unification failure in existentials used with parametrically polymorphic functions

2007-11-30 Thread Luke Palmer
On Nov 30, 2007 12:20 PM, Pablo Nogueira [EMAIL PROTECTED] wrote: A question about existential quantification: Given the existential type: data Box = forall a. B a [...] I cannot type-check the function: mapBox :: forall a b. (a - b) - Box - Box --:: forall a b. (a - b) -

[Haskell-cafe] Re: Rigid type-var unification failure in existentials used with parametrically polymorphic functions

2007-11-30 Thread Pablo Nogueira
Stupid of me: Isn't the code for mapBox :: forall a. (a - a) - Box - Box encoding the proof: Assume forall a. a - a Assume exists a.a unpack the existential, x :: a = T for some T apply f to x, we get (f x) :: a pack into existential, B (f x) :: exists a.a Discharge first

Re: [Haskell-cafe] Re: New slogan for haskell.org

2007-11-30 Thread Johan Tibell
On Nov 30, 2007 1:30 AM, Ivan Miljenovic [EMAIL PROTECTED] wrote: Speaking of Stackless Python, its homepage (http://www.stackless.com/) has a rather nice layout... maybe slightly less emphasis on the About section, but there you've got the links, the info and the news all on the one page. I

[Haskell-cafe] Editorial error or something meaningful?

2007-11-30 Thread PR Stanley
Hi taken from ch.8.3 in the Hutton book: Whereas return v always succeeds, the dual parser failure always fails regardless of the contents of the input string: The dual parser failure? Cheers, Paul ___ Haskell-Cafe mailing list

[Haskell-cafe] Rigid type-var unification failure in existentials used with parametrically polymorphic functions

2007-11-30 Thread Pablo Nogueira
A question about existential quantification: Given the existential type: data Box = forall a. B a in other words: -- data Box = B (exists a.a) -- B :: (exists a.a) - Box I cannot type-check the function: mapBox :: forall a b. (a - b) - Box - Box --:: forall a b. (a - b) -

Re: [Haskell-cafe] Rigid type-var unification failure in existentials used with parametrically polymorphic functions

2007-11-30 Thread Pablo Nogueira
mapBox :: forall a b. (a - b) - Box - Box --:: forall a b. (a - b) - (exists a.a) - (exists a.a) mapBox f (B x) = B (f x) However, at first sight |f| is polymorphic so it could be applied to any value, included the value hidden in |Box|. f is not polymorphic here; mapBox

Re: [Haskell-cafe] Design of a Physics Interface

2007-11-30 Thread Henning Thielemann
On Fri, 30 Nov 2007, Luke Palmer wrote: But I can't figure out a good way to represent bodies in this world. I considered: newBody :: (Position,Velocity) - World - (Body,World) Where Body is an ADT with an internal representation of an Integer or something. The problem with this is that

Re: [Haskell-cafe] A tale of three shootout entries

2007-11-30 Thread Richard Kelsall
Sterling Clover wrote: I'm still curious if the pre-calculation of partial sums that I did works well across processors, as I don't see why it shouldn't. My less-strictified version of Don's code is attached, and below are the functions you'll need to insert/replace to make the partial-sums

Re: [Haskell-cafe] A tale of three shootout entries

2007-11-30 Thread Sterling Clover
Was this with tossing the partial sums code into the optimised bangs program? Weird. I wonder if profiling will help explain why? In any case, If nobody comes up with any other tweaks, I'll probably submit the optimised bangs version to the shootout this weekend. --S On Nov 30, 2007 1:30 PM,

Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Andrew Coppin
Rob Hoelz wrote: Hello fellow Haskellers, Does anyone know if/where I can find a specification for the .hi files generated by GHC? I ask because I want to write an omni-completion plugin for Vim to make Haskell hacking a bit nicer. You don't want to do that. The .hi files can expose

Re: [Haskell-cafe] What is the role of $!?

2007-11-30 Thread Derek Elkins
On Thu, 2007-11-29 at 07:29 +, Thomas Davie wrote: On 29 Nov 2007, at 06:32, PR Stanley wrote: Hi Thanks for the response. JCC: In most languages, if you have some expression E, and when the computer attempts to evaluate E it goes in to an infinite loop, then when the

Re: [Haskell-cafe] A tale of Project Euler

2007-11-30 Thread Felipe Lessa
On Nov 30, 2007 5:39 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Hmm. Secret... library... How do you guys find out about all this stuff? There's http://www.haskell.org/haskellwiki/Arrays#Unsafe_indexing.2C_freezing.2Fthawing.2C_running_over_array_elements . Cheers, -- Felipe.

[Haskell-cafe] Re: trouble building unix-2.2.0.0 on cygwin

2007-11-30 Thread Galchin Vasili
More elaboration ... 1) i checked HsUnixConfig.h and the macro HAVE_SYS_TIMES_H is set to 1 On Nov 30, 2007 8:28 PM, Galchin Vasili [EMAIL PROTECTED] wrote: Hello, 0) All work being done on cygwin. Version 6.8.1 of ghc. 1) I ran runhaskell Setup.lhs configure and did a tail -f

Re: [Haskell-cafe] Design of a Physics Interface

2007-11-30 Thread Luke Palmer
On Nov 30, 2007 7:26 PM, Dan Weston [EMAIL PROTECTED] wrote: There seems to be three salient benefits of using arrows, as I read the Abstract and Introduction of Benjamin Lerner, Arrow Laws and Efficiency in Yampa, 2003, http://zoo.cs.yale.edu/classes/cs490/03-04a/benjamin.lerner/ 1) The