Re: [Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-05 Thread Phlex
apfelmus wrote: Phlex wrote: Ketil Malde wrote: Is the relational model a better fit than the object model for functional programming ? Well, not really. I mean, if the problem is indeed to store all known planets in the universe, then it's indeed a database in nature and you h

Re: [Haskell-cafe] FP v. OOP

2007-06-05 Thread Michael T. Richter
On Tue, 2007-05-06 at 08:19 -0700, brad clawsie wrote: > On Tue, Jun 05, 2007 at 05:53:33AM +0100, PR Stanley wrote: > > Hi > > BAE Systems which specialises in military technology is looking for > > programmers who have experience in C, C++ and Java and UML. > > large corporations with signi

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Scott Brickner
You're right. I didn't put that precisely enough. But, the inverse of /any/ partial order is still a partial order. With the set of natural numbers, is it still reasonable to say that the order that puts 2 ≤ 1 is "just as natural" as the conventional order? Probably not. So, ⊆ is the /conven

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread PR Stanley
PR Stanley wrote: What do the ≤ symbols represent? I see you are still stuck in ISO-8859-1 and deprived of international characters and symbols. (And this reply in ISO-8859-1 too accordingly; normally I use UTF-8.) Unicode and UTF-8 FTW! :) oh very good, very good but forgive me, how is

Re: [Haskell-cafe] Re: Hardware

2007-06-05 Thread Dan Piponi
On 6/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> it seems that now we move right into this direction with GPUs They are no good. GPU's have no synchronisation between them which is needed for graph reduction. GPUs are intrinsically parallel devices and might work very well for par

[Haskell-cafe] Finding points contained within a convex hull.

2007-06-05 Thread Daniel McAllansmith
Hello. I've got a system of linear inequalities representing half-spaces. The half-spaces may or may not form a convex hull. I need to find the integral coordinates that are contained within the convex hull, if there is one. For example, given 0 <= x <= 4 0 <= y <= 3 0 <= 2x - y 0 <= 1.2y - x

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Steve Downey
Well, traditionally, a boolean algebra is a ring, which means it has two operations corresponding to plus and times, and a zero such that a plus zero is a, and a one such that a times one is a. Also by longstanding tradition, zero is less than one. Now, in most programming languages, a boolean ty

Re: [Haskell-cafe] Re: Failure in GHC compilation

2007-06-05 Thread Brandon S. Allbery KF8NH
On Jun 5, 2007, at 18:26 , Stefan O'Rear wrote: I am just curious - is there a OS, where the argument list is not limited (like in limits.h under Unix/Posix)? No, that would require an infinite amount of address space. Even if you have exabytes of swap, argv[] has to be all concurrently a

Re: [Haskell-cafe] Re: Failure in GHC compilation

2007-06-05 Thread Stefan O'Rear
On Tue, Jun 05, 2007 at 03:51:47PM +, Georg Sauthoff wrote: > Esa Ilari Vuokko <[EMAIL PROTECTED]> wrote: > > Hi, > > [..] > > It's exactly what it says...too long argument list (it's limited in > > Windows.) > [..] > > I am just curious - is there a OS, where the argument list is not > lim

[Haskell-cafe] Parsec problem

2007-06-05 Thread Neil Mitchell
Hi, I'm using parsec to parse something which is either a "name" or a "type". The particular test string I'm using is a type, but isn't a name. I want things to default to "name" before "type". Some examples of the parsec function, and the result when applied to a test string: parsecQuery = do

Re: [Haskell-cafe] Idiomatically using lists

2007-06-05 Thread Dan Weston
Here is my list-based version. There are redundant calls to get the length of the same list, but I didn't feel like factoring them out (call it an exercise for the reader). The key to its simplicity is that shifting an element is a similarity transform of shifting the first element, with pre- a

[Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-05 Thread apfelmus
Phlex wrote: > Ketil Malde wrote: >> Identity can be emulated by relatively straightforward means: store all >> planets in a Map indexed by something that is useful as an identifier >> (i.e. stays constant and is unique), and have a Galaxy keep a list of >> identifiers. >> > > So basically you

Re: [Haskell-cafe] Idiomatically using lists

2007-06-05 Thread Greg Fitzgerald
Kevin, Below is my attempt, which hopefully is bad enough to get this thread rolling for you. :) It rotates the 'i'th element 'n' times by swapping the 'i'th element with the element to its right 'n' times. It looks horribly inefficient to me, but is fairly simple and only depends on the prelud

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Albert Y. C. Lai
PR Stanley wrote: What do the ≤ symbols represent? I see you are still stuck in ISO-8859-1 and deprived of international characters and symbols. (And this reply in ISO-8859-1 too accordingly; normally I use UTF-8.) Unicode and UTF-8 FTW! :) ___

[Haskell-cafe] Compiling packages for GHCi

2007-06-05 Thread Grzegorz
Hi, I'm having problems using a package which links in foreign libraries from GHCi. I use a .cabal file to build the package and have the following option there: extra-libraries:stdc++ maxent z m gfortran m gcc_s After installation, it works fine when I compile code using that package. Howe

Re: [Haskell-cafe] FOL

2007-06-05 Thread Frank Seaton Taylor
On Tue, 05 Jun 2007, at 00:41, Tony Morris wrote: I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more genera

Re: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-05 Thread Ian Lynagh
On Mon, Jun 04, 2007 at 10:45:30AM +0100, Neil Mitchell wrote: > > On 6/4/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > > > Perhaps you mean that reify doesn't work on type constructors? (E.g. > > reify ''Maybe). > >It should -- if you think it doesn't can you concoct a test case and > >

[Haskell-cafe] Re: Failure in GHC compilation

2007-06-05 Thread Georg Sauthoff
Esa Ilari Vuokko <[EMAIL PROTECTED]> wrote: Hi, [..] > It's exactly what it says...too long argument list (it's limited in Windows.) [..] I am just curious - is there a OS, where the argument list is not limited (like in limits.h under Unix/Posix)? Best regards Georg Sauthoff _

Re: [Haskell-cafe] FP v. OOP

2007-06-05 Thread brad clawsie
On Tue, Jun 05, 2007 at 05:53:33AM +0100, PR Stanley wrote: > Hi > BAE Systems which specialises in military technology is looking for > programmers who have experience in C, C++ and Java and UML. large corporations with significant software development obligations are as interested in the mar

RE: literate haskell syntax highlighting issues in vim(Re:[Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?)

2007-06-05 Thread Bayley, Alistair
> [mailto:[EMAIL PROTECTED] On Behalf Of Dougal Stanton > > On 05/06/07, Claus Reinke <[EMAIL PROTECTED]> wrote: > > (tested on ghc/compiler/stranal/StrictAnal.lhs): > > Since when did GHC become NSFW?! :-O > > /ducking and running... Says more about you than anything else... **

Re: [Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Rodrigo Queiro
Perhaps you could just highlight the small subset of LaTeX that is common in .lhs files? This seems like it would be satisfactory in most cases. On 05/06/07, Paul Moore <[EMAIL PROTECTED]> wrote: On 05/06/07, Michael T. Richter <[EMAIL PROTECTED]> wrote: > > > Oops. I spoke too soon. It works

Re: literate haskell syntax highlighting issues in vim (Re:[Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?)

2007-06-05 Thread Dougal Stanton
On 05/06/07, Claus Reinke <[EMAIL PROTECTED]> wrote: (tested on ghc/compiler/stranal/StrictAnal.lhs): Since when did GHC become NSFW?! :-O /ducking and running... D. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailm

Re: literate haskell syntax highlighting issues in vim (Re:[Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?)

2007-06-05 Thread Claus Reinke
the following sequence seems to help (tested on ghc/compiler/stranal/StrictAnal.lhs): :syn sync fromstart :syn region texZone matchgroup=hsLineComment start="\\begin{code}" end="\\end{code}" [EMAIL PROTECTED] keepend matchgroup=NONE i'll leave it to those who are actually using literate haske

[Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-05 Thread Al Falloon
Phlex wrote: Christopher Lane Hinson wrote: Where "InsidenessMap a b c" represents a relationship where b's are inside a's, and b's have a state of c. Then, you need to declare a separate InsidenessMap for each possible relationship, but this ensures that you'll never put a galaxy inside

Re: [Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Paul Moore
On 05/06/07, Michael T. Richter <[EMAIL PROTECTED]> wrote: Oops. I spoke too soon. It works ... for about a third of the file. It then loses its mind in the middle of a do-block (in a sizable chunk of code) and doesn't regain it until the next code begin/end pairing ends. There is a fix f

Re: [Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread David Duke
Michael, Michael T. Richter wrote: So, I guess I'm back to my original question: where can I find a decent editor that can do syntax highlighting out of the box for literate Haskell? (Or, alternatively, where can I find a syntax-highlighting editor I can expand the syntax handling of on my o

Re: [Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Michael T. Richter
On Tue, 2007-05-06 at 13:05 +0200, Georg Neis wrote: > "Michael T. Richter" <[EMAIL PROTECTED]> wrote: > > The problems I'm seeing are the ugly white-on-red for underlines, the > > lack of any kind of differentiation for keywords/operators/etc. vs. > > identifiers (although some punctuation is rec

Re: [Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Michael T. Richter
On Tue, 2007-05-06 at 13:05 +0200, Georg Neis wrote: > "Michael T. Richter" <[EMAIL PROTECTED]> wrote: > > The problems I'm seeing are the ugly white-on-red for underlines, the > > lack of any kind of differentiation for keywords/operators/etc. vs. > > identifiers (although some punctuation is rec

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Tillmann Rendel
Tony Finch wrote: > Another point worth noting is that the usual lambda calculus > representations of false and zero are equivalent. (However true > is not the same as one.) Looking at Church encoding, false = zero true = may be a point for false < true, but true = curry fst false = cu

literate haskell syntax highlighting issues in vim (Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?)

2007-06-05 Thread Claus Reinke
clearly.) The problems I'm seeing are the ugly white-on-red for underlines, the lack of any kind of differentiation for You can also put your cursor an those underlines and use :echo synIDattr(synID(line("."), col("."), 1), "name") looks like a highlighting bug alright. reduced example

[Haskell-cafe] Re: OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Georg Neis
"Michael T. Richter" <[EMAIL PROTECTED]> wrote: > The problems I'm seeing are the ugly white-on-red for underlines, the > lack of any kind of differentiation for keywords/operators/etc. vs. > identifiers (although some punctuation is recognized, specifically curly > braces), comments not being note

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Tony Finch
Another point worth noting is that the usual lambda calculus representations of false and zero are equivalent. (However true is not the same as one.) Tony. -- f.a.n.finch <[EMAIL PROTECTED]> http://dotat.at/ MALIN: EAST OR SOUTHEAST 4 OR 5. MODERATE. FAIR. MODERATE OR GOOD.

Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Marc Weber
>clearly.) The problems I'm seeing are the ugly white-on-red for >underlines, the lack of any kind of differentiation for Hi. Sorry for this stupid question but have you tried :set nohlsearch? Or /searchsomethingwhichdoesntexist ? You can also put your cursor an those underlines and use

Re: [Haskell-cafe] Re: Why does the class called "Real" support only rationals, and not all reals?

2007-06-05 Thread Henning Thielemann
On Mon, 4 Jun 2007, Dan Piponi wrote: > On 6/4/07, DavidA <[EMAIL PROTECTED]> wrote: > > Yes, I'm afraid that you are understanding correctly. Annoying isn't it. > > > > It is well-known (among Haskell mathematicians at least) that the numeric > > type > > classes in the prelude are broken. > >

[Haskell-cafe] compiler implementation details

2007-06-05 Thread José Miguel Vilaça
Hi, I’m curious about how the Haskell compilers nowadays take care of a simple function definition like append append [] l = l append (h:t) l = h: (append t l) Do they take a rewriting way like append [1,2] [3,4] ==> 1: (append [2] [3,4]) ==> 1: (

Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Michael T. Richter
On Tue, 2007-05-06 at 12:30 +0300, Ilya Tsindlekht wrote: > It seems to me like VIM thinks your file is a (La)TeX file. Can you > check that your filetype variable is set to lhaskell? (Type :set filetype) > It should be if your file has extension .lhs. If it isn't, try setting it > manually (:set

Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?

2007-06-05 Thread Ilya Tsindlekht
On Tue, Jun 05, 2007 at 10:41:44AM +0100, Rodrigo Queiro wrote: > To back him up, it seems that the lhaskell.vim syntax highlighter is broken > with Vim 7.1. Here, it is definitely using lhaskell.vim, but doesn't seem to > be parsing the code in between \begin{code} and \end{code} as Haskell. > Wo

Re: [Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-05 Thread Phlex
Christopher Lane Hinson wrote: Where "InsidenessMap a b c" represents a relationship where b's are inside a's, and b's have a state of c. Then, you need to declare a separate InsidenessMap for each possible relationship, but this ensures that you'll never put a galaxy inside a solar system

Re: [Haskell-cafe] Re: Hardware

2007-06-05 Thread [EMAIL PROTECTED]
it seems that now we move right into this direction with GPUs I was just thinking that GPUs might make a good target for a reduction language like Haskell. They are hugely parallel, and they have the commercial momentum to keep them current. It also occurred to me that the cell processor (

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread David House
On 05/06/07, PR Stanley <[EMAIL PROTECTED]> wrote: Hello What do the ≤ symbols represent? 'Less than or equal to'. To say that x ≤ y, if x and y are numbers, means that x is either less than y, or x and y are equal (so x cannot exceed y). However, in the spirit of mathematics, the symbol now ac

Re: [Haskell-cafe] Re: Hardware

2007-06-05 Thread [EMAIL PROTECTED]
but more efficient computational model exists. if cpu consists from huge amount of execution engines which synchronizes their operations only when one unit uses results produces by another then we got processor with huge level of natural parallelism and friendlier for FP programs. it seems that

Re: [Haskell-cafe] Optimising UTF8-CString -> String marshaling, plus comments on withCStringLen/peekCStringLen

2007-06-05 Thread Alistair Bayley
> {- Arity: 4 Strictness: LSSL -} Right. Unboxed args are always given the annotation L. So that function is strict in that pointer arg, but GHC is choosing not to unbox it. I'm not sure why that's the case. I thought maybe it was because I hadn't said -funbox-strict-fields, but it didn't cha

Re: [Haskell-cafe] FOL

2007-06-05 Thread Leif Frenzel
Hi, On Tue, 2007-06-05 at 14:41 +1000, Tony Morris wrote: I would like to know if all 16 possible functions that accept two boolean arguments have names in First-Order Logic. I know they have Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), but I'm hoping there is a more

Re: [Haskell-cafe] FOL

2007-06-05 Thread Bill Wood
On Tue, 2007-06-05 at 14:41 +1000, Tony Morris wrote: > I would like to know if all 16 possible functions that accept two > boolean arguments have names in First-Order Logic. I know they have > Haskell function names (e.g. \p -> \_ -> id p, \_ -> \_ -> const True), > but I'm hoping there is a more

RE: [Haskell-cafe] How to read -ddump-hi output (and other phases) from GHC

2007-06-05 Thread Simon Peyton-Jones
| > 4.16.3. How to read Core syntax | > http://www.haskell.org/ghc/docs/latest/html/users_guide/options-debugging.html#id3130643 | | I found that -ddump-simpl gives you good information, in a readable | form - I much prefer it to reading the .hcr files. The printer for GHC's Core language wasn't

Re: [Haskell-cafe] newbie question on Parsers from "Programming In Haskell"

2007-06-05 Thread Ilya Tsindlekht
On Mon, Jun 04, 2007 at 05:42:35PM +0300, Juozas Gaigalas wrote: > Hello, > > I am a somewhat experienced programmer and a complete Haskell newbie, so I > hope this is the correct ML for my question. > > I have decided to learn Haskell and started with Graham Hutton's book. > Everything was goin