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

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 12:23:03PM +1200, Daniel McAllansmith wrote: 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

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

2007-06-06 Thread Jean-Marie Gaillourdet
Hi, On 06.06.2007, at 07:00, Phlex wrote: So here is one more question : Let's say I want unique System names across the Universe ... that would mean i need to have a Data.Map in the Universe, with Name keys and System values. Since all data are values instead of references, would i end

[Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Christian Maeder
Neil Mitchell schrieb: 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

[Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Dmitri O.Kondratiev
Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution and displays an error message. Questions: 1) What value and type 'error' actually

[Haskell-cafe] compiling shared library with GHC on x86-64

2007-06-06 Thread Alexander Vodomerov
Hello! I'm trying to build shared library from Haskell source to call it from external C program. Everything works fine on usual x86 machine. However, any attempt to compile code as position independent on x86-64 result in fatal error. This is simple example: $ cat adder.hs module Adder

[Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Neil Mitchell
Hi I suppose names or try names succeeds without consuming input, but calling parsecQuery fails for another reason that you haven't shown, I assume (from the docs) that try names doesn't consume input (the try is meant to take care of that). I also know that spaces ; types works on its own,

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 01:39:32PM +0400, Dmitri O.Kondratiev wrote: Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution and

Re: [Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Tillmann Rendel
Neil Mitchell wrote: The code is at: http://www.cs.york.ac.uk/fp/darcs/hoogle/src/Hoogle/Query/Parser.hs My guess: names can never fail, so types is never tried, and eof fails. Tillmann ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Tillmann Rendel
Dmitri O.Kondratiev wrote: Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution and displays an error message. Questions: 1) What value and

Re: [Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Neil Mitchell
Hi Tillmann http://www.cs.york.ac.uk/fp/darcs/hoogle/src/Hoogle/Query/Parser.hs My guess: names can never fail, so types is never tried, and eof fails. You are correct. Thanks very much! Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Mark T.B. Carroll
Dmitri O.Kondratiev [EMAIL PROTECTED] writes: (snip) 1) What value and type 'error' actually returns in: error some message ? For the purpose of type checking, error returns whatever value is expected for that expression by whatever is 'using' the value. In practice, 'error' terminates

[Haskell-cafe] Re: Parsec problem

2007-06-06 Thread Christian Maeder
Neil Mitchell schrieb: I assume (from the docs) that try names doesn't consume input (the try is meant to take care of that). try names does not consume input when names fails, but it may also not consume input when names succeeds on the empty input. In that (latter) case the other alternative

[Haskell-cafe] (pre)compiled Haskell compiler for True64/Alpha

2007-06-06 Thread Lutz Donnerhacke
Does anyone have a haskell compiler for True64 (formerly known as OSF/1) on Alpha hardware? I'm currently unable to compile the first bootstrap compiler. Any hint which compiler should I start with? I'll send detailed error reports only if I do not succeed in the next hours.

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

2007-06-06 Thread Simon Brenner
Do you simply want the set of coordinates, or do you want to do something smart with the them (i.e. optimize a function value etc)? In the first case, with a good starting point and a function that enumerates all coordinates (by going in a spiral, perhaps), I think this can be done in O(nm),

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

2007-06-06 Thread Brandon Michael Moore
On Wed, Jun 06, 2007 at 02:50:12AM +0100, PR Stanley wrote: 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

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

2007-06-06 Thread haskell
Daniel McAllansmith wrote: Hello. I've got a system of linear inequalities representing half-spaces. The half-spaces may or may not form a convex hull. They could only fail to define a convex volume if they are inconsistent and define an empty set. Though they might define a convex volume

[Haskell-cafe] Re: Compiling packages for GHCi

2007-06-06 Thread Simon Marlow
Grzegorz wrote: 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

Re: [Haskell-cafe] (pre)compiled Haskell compiler for True64/Alpha

2007-06-06 Thread Donald Bruce Stewart
lutz: Does anyone have a haskell compiler for True64 (formerly known as OSF/1) on Alpha hardware? I'm currently unable to compile the first bootstrap compiler. Any hint which compiler should I start with? I'll send detailed error reports only if I do not succeed in the next hours. I

[Haskell-cafe] Re: compiling shared library with GHC on x86-64

2007-06-06 Thread Simon Marlow
Alexander Vodomerov wrote: Hello! I'm trying to build shared library from Haskell source to call it from external C program. Everything works fine on usual x86 machine. However, any attempt to compile code as position independent on x86-64 result in fatal error. This is simple example: $

Re: [Haskell-cafe] (pre)compiled Haskell compiler for True64/Alpha

2007-06-06 Thread Lutz Donnerhacke
On Wed, Jun 06, 2007 at 10:00:15PM +1000, Donald Bruce Stewart wrote: I think the last ghc I ran on OSF/1 alpha was hmm, 5.04.2? Yep. I found that, because it was heavily described. There were quite a number of bugs with 64bit code. This are the same problems I have with nhc or hugs (sizeof

[Haskell-cafe] I saw this... and thought of you

2007-06-06 Thread Andrew Coppin
http://dis.4chan.org/read/prog/1180896798/ (It's been a while since I touched Java, and I must confess I can't even comprehend this code...) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2007-06-06 Thread haskell
Simon Brenner wrote: Do you simply want the set of coordinates, or do you want to do something smart with the them (i.e. optimize a function value etc)? In the first case, with a good starting point and a function that enumerates all coordinates (by going in a spiral, perhaps), I think this

Re: [Haskell-cafe] I saw this... and thought of you

2007-06-06 Thread Tillmann Rendel
Andrew Coppin wrote: http://dis.4chan.org/read/prog/1180896798/ (It's been a while since I touched Java, and I must confess I can't even comprehend this code...) Look's like a bad done extension of the well-known function object pattern in oo design to allow currying. I would prefer the

Re: [Haskell-cafe] Re: Compiling packages for GHCi

2007-06-06 Thread Brandon S. Allbery KF8NH
On Jun 6, 2007, at 7:55 , Simon Marlow wrote: Grzegorz wrote: I don't have a libmaxent.so, the maxent library in at /usr/local/ lib/libmaxent.a Can I somhow use my package with GHCi? No, you need the .so. GHCi can't load static .a libraries. If you really have no way to get a .so, then

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

2007-06-06 Thread apfelmus
Simon Brenner wrote: Do you simply want the set of coordinates, or do you want to do something smart with the them (i.e. optimize a function value etc)? In the first case, with a good starting point and a function that enumerates all coordinates (by going in a spiral, perhaps), I think this

[Haskell-cafe] standard function

2007-06-06 Thread Steffen Mazanek
Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... Steffen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] standard function

2007-06-06 Thread Maxime Henrion
Steffen Mazanek wrote: Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... As far as I know, there is no standard function doing that, though it is easily implemented: mapApply xs x = map ($ x) xs or

Re: [Haskell-cafe] standard function

2007-06-06 Thread Paul Moore
On 06/06/07, Steffen Mazanek [EMAIL PROTECTED] wrote: Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... I asked basically this a few months back. Have a look at

Re: [Haskell-cafe] standard function

2007-06-06 Thread Dougal Stanton
On 06/06/07, Steffen Mazanek [EMAIL PROTECTED] wrote: Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... Possibly it's just too small to bother putting in a separate function. let fs = [ (*2), (+2),

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

2007-06-06 Thread apfelmus
apfelmus wrote: 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 have to support fine grained operations like delete :: Key - Database - Database insert :: Key - Item - Database - Database ... and so on ...

[Haskell-cafe] Re: standard function

2007-06-06 Thread apfelmus
Steffen Mazanek wrote: is there a function f::[a-b]-a-[b] in the libraries? There is, it's called 'sequence' :) You need to import Control.Monad.Instances though, to get the famous reader monad ((-) a). Regards, apfelmus ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: standard function

2007-06-06 Thread Steffen Mazanek
Cool! Haskell surprised me once again :) @Paul: Thank you for pointing me to the old thread. @Neil: Is there a way to let hoogle find this kind of stuff? It would be a quite complex inference though. 2007/6/6, apfelmus [EMAIL PROTECTED]: Steffen Mazanek wrote: is there a function

Re: [Haskell-cafe] Re: standard function

2007-06-06 Thread Neil Mitchell
Hi @Neil: Is there a way to let hoogle find this kind of stuff? It would be a quite complex inference though. Finding map ($ x) - no. As soon as you allow combination of functions in various combinations, the search space explodes. For every function you now have id map, id . map f etc - way

[Haskell-cafe] HList questions

2007-06-06 Thread Marc Weber
Do you know what a type indexed coproduct is ? (TIC.hs from HList) What is the purpose of this module? Why the Proxy type has been introduced? Can you think of a short application? Marc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Use of Data.Generics.everywhere'

2007-06-06 Thread Neil Mitchell
Hi, I'm looking into SYB, and I'm trying to find examples where people have used everywhere' (note: not everywhere, but with a \prime) - unfortunately I can't find any. I've tried Google Code Search, and it comes up with one rather trivial example which could equally have been everywhere. The

Re: [Haskell-cafe] FP v. OOP

2007-06-06 Thread Albert Y. C. Lai
Michael T. Richter wrote: I'm tempted to quote something about history, learning and repetition now, but won't bother because I suspect most of the people in this mailing list know the quote and have learned from history. Those who have learned from history are bound to helplessly watch it

[Haskell-cafe] Re: Compiling packages for GHCi

2007-06-06 Thread Grzegorz
Brandon S. Allbery KF8NH allbery at ece.cmu.edu writes: Alternately, just extract the contents of the .a into a subdirectory and explicitly load them: mkdir libmaxent cd libmaxent ar x /usr/local/lib/libmaxent.a cd .. ghci (...) libmaxent/*.o This doesn't quite work: ghc-6.6.1:

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Dmitri O.Kondratiev
Thanks for excellent explanation! Examples really help. So, in general 'fail' behavior will differ from monad to monad. In this example: divBy :: Monad m = Int - Int - m Int divBy a 0 = fail div by zero divBy a b = return (a `div` b) Default 'fail' implementation in Monad class will be:

Re: [Haskell-cafe] Parsec problem

2007-06-06 Thread Derek Gladding
Neil Mitchell wrote: 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. I just finished a parsec grammar for C99, and found this very useful while bringing

Re: [Haskell-cafe] Re: Parsec problem

2007-06-06 Thread David House
On 06/06/07, Christian Maeder [EMAIL PROTECTED] wrote: try names does not consume input when names fails, but it may also not consume input when names succeeds on the empty input. In that (latter) case the other alternative (type) is not tried. But in that case it'd be successful and return

Re: ***DHSPAM*** Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Juan Carlos Arevalo Baeza
On Wed, 06 Jun 2007 09:29:09 -0700, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: Default 'fail' implementation in Monad class will be: *DivBy divBy 5 0 Loading package haskell98-1.0 ... linking ... done. *** Exception: user error (div by zero) And when explicitly defining monad as Maybe it

Re: [Haskell-cafe] standard function

2007-06-06 Thread Ilya Tsindlekht
On Wed, Jun 06, 2007 at 03:48:18PM +0200, Steffen Mazanek wrote: Hello, is there a function f::[a-b]-a-[b] in the libraries? Couldn't find one using hoogle although this seems to be quite a common thing... Steffen Just to add to what others have said, yet another way to implement it

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

2007-06-06 Thread Daniel McAllansmith
Thanks for the responses everyone. On Thursday 07 June 2007 00:37, [EMAIL PROTECTED] wrote: Simon Brenner wrote: Do you simply want the set of coordinates, or do you want to do something smart with the them (i.e. optimize a function value etc)? Ultimately optimise several functions over the

[Haskell-cafe] HopenGL

2007-06-06 Thread Ruben Zilibowitz
Hi, If anyone knows how to get HOpenGL to draw coloured lines, I'd like to know. Currently I can draw coloured objects like planes cylinders or spheres, but not lines. Lines always seem to appear black. Regards, Ruben ___ Haskell-Cafe mailing