Re: [Haskell-cafe] Do you trust Wikipedia?

2007-10-18 Thread Martin Percossi
http://www.conservapedia.com/Examples_of_Bias_in_Wikipedia -- if not ordained directly from the Almighty, then at least by his earth-bound agents! No, but seriously, I agree with Le Hacker Soleil, news of wikipedia's inaccuracies is greatly exaggerated. Martin [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] Curry and uncurry

2007-10-05 Thread Martin Percossi
Warning: I hope I haven't spoiled the answer to this problem. If so, read only until the answer becomes clear! I think the key is to be quite clear about what it is the function should do. Reading the type helps: Prelude :t curry curry :: ((a, b) - c) - a - b - c This type signature looks a

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Martin Percossi
Brian Hulley wrote: hidden away in the definition of their API function to create a label, is a call to (ref 0) ;-) The equivalent implementation in Haskell would completely destroy all hope of using this in a pure context and force all use of the API into the IO monad. Really? I would

Re: [Haskell-cafe] Type system madness

2007-07-11 Thread Martin Percossi
Jonathan Cast wrote: toUpper :: exists x. x - x works for only one choice of x. Are you sure that's not: toUpper :: exists x. x - x works for *at least one* choice of x ? I'm not sure about the haskell meaning, but the logic meaning is definitely this. For example: forall x:Integer.

Re: [Haskell-cafe] Language extensions [was: Memoization]

2007-05-31 Thread Martin Percossi
I really liked this explanation -- very clear, with good analogies. Thanks! Martin My music: http://www.youtube.com/profile?user=thetonegrove Claus Reinke wrote: quantified types (forall/exist): an easy way to memorize this is to think of 'forall' as a big 'and' and of 'exists' as a big

[Haskell-cafe] Getting the number of seconds since epoch from System.Time.ClockTime

2007-04-26 Thread Martin Percossi
Hello haskell-cafe, In System.Time, data ClockTime = TOD Integer Integer , where the first integer represents the number of seconds since epoch, and the other represents the number of picoseconds. Is there a way of retrieving the first part? (In Haskell 98, the ClockTime type is abstract).

[Haskell-cafe] Timezone Database Library

2007-02-02 Thread Martin Percossi
Hello, is there a haskell library that provides facilities to read and use the tzfile format [1], or equivalent in Windows? TIA Martin [1] http://www.twinsun.com/tz/tz-link.htm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] a bunch of newbie questions

2006-08-04 Thread Martin Percossi
Bulat Ziganshin wrote: this is called ad-hoc polymorphism which is not supported by Haskell. instead Haskell supports parametric polymorphism via type classes. I think you are wrong here Bulat. In fact, I think a) Haskell supports parametric polymorphism, e.g. id :: t - t id x = x b) Haskell

Re: [Haskell-cafe] Why shouldn't variable names be capitalized?

2006-08-04 Thread Martin Percossi
Paul Hudak wrote: Ok, you asked for it, so here's my worst :-) You're too gentle! I was expecting some serious community flagellation for my heretical remarks! 1) Here's what the History of Haskell has to say about this: Namespaces were a point of considerable discussion in the

Re: [Haskell-cafe] Hackathon hesitation

2006-07-13 Thread Martin Percossi
Chad Scherrer wrote: I'm interested in attending the Hackathon, but I don't have anyprevious experience working on compilers. One book I'm reading right now is Modern Compiler Implementation in ML (http://www.cs.princeton.edu/~appel/modern/ml/). The author writes a compiler of increasing

Re: [Haskell-cafe] Re: Problems installing HDBC-postgresql

2006-07-12 Thread Martin Percossi
thanks Martin John Goerzen wrote: On 2006-07-10, Martin Percossi [EMAIL PROTECTED] wrote: Hi, I'm having problems using HDBC-postgresql (I've tried both 0.99.2.1 and 1.0.0.0) with postgresql (version 8.1.4, installed in /share/pgsql). I adjust the include-dir and extra-lib-dirs to use the custom

[Haskell-cafe] Help building HSQL...

2006-07-10 Thread Martin Percossi
Hi, I'm trying to build HSQL, in order to use HaskellDb. The base directory (i.e. HSQL) builds ok, as per instructions, but the PostgreSQL directory fails with the error message: Setup.lhs:17:71: Couldn't match `PackageDescription' against `LocalBuildInfo' Expected type: Args -

[Haskell-cafe] Problems installing HDBC-postgresql

2006-07-10 Thread Martin Percossi
Hi, I'm having problems using HDBC-postgresql (I've tried both 0.99.2.1 and 1.0.0.0) with postgresql (version 8.1.4, installed in /share/pgsql). I adjust the include-dir and extra-lib-dirs to use the custom location of postgresql, and build: no error messages, everything seems fine. However,

Re: [Haskell-cafe] More STUArray questions

2006-03-15 Thread Martin Percossi
On Mon, Mar 13, 2006 at 10:47:58PM +0100, Roberto Zunino wrote: Martin Percossi wrote: matrix.hs:138:27: Couldn't match the rigid variable `.' against `ST' `.' is bound by the type signature for `runSTMatrix' Expected type: ST s Inferred type: . (forall s1) Try

[Haskell-cafe] More STUArray questions

2006-03-12 Thread Martin Percossi
Hello, I am trying to write a haskell-native matrix library (providing a similar set of functionality as gsl's matrix/eigenvector routines). I have had a look at other attempts at matrix libraries, and have found Hal Daume's and Alberto Ruiz's libraries to offer a good amount of functionality.

Re: [Haskell-cafe] More STUArray questions

2006-03-12 Thread Martin Percossi
Thanks for the tip. A modified version of your suggestion worked for me: unsafeFreezeMatrix :: MMatrix s - ST s Matrix unsafeFreezeMatrix (MMatrix x1 x2 marray) = do block - unsafeFreeze marray return $ Matrix x1 x2 block However, just out of

Re: [Haskell-cafe] More STUArray questions

2006-03-12 Thread Martin Percossi
On Sun, Mar 12, 2006 at 09:15:57PM +0200, Einar Karttunen wrote: On 12.03 18:44, Martin Percossi wrote: However, just out of curiosity, I'm still curious at how I could do the runSTMatrix, which would really be the icing on the cake in terms of client usability. You might want to look

Re: [Haskell-cafe] More STUArray questions

2006-03-12 Thread Martin Percossi
On Sun, Mar 12, 2006 at 10:37:45PM +0300, Bulat Ziganshin wrote: Sunday, March 12, 2006, 8:49:15 PM, you wrote: MP 1. Haskell-nativeness: I have had some issues compiling and linking with gsl MP libraries on 64-bit platforms. Also, it would be quite interesting to gauge MP haskell's

Re: [Haskell-cafe] More STUArray questions

2006-03-12 Thread Martin Percossi
On Sun, Mar 12, 2006 at 08:51:57PM +, Chris Kuklewicz wrote: There is a small error in the type of runSTMatrix, see below runSTMatrix :: (forall s. ST s (MMatrix s)) - Matrix runSTMatrix a = runST ( do (MMatrix i j mblock) - a block - unsafeFreeze mblock

[Haskell-cafe] Question regarding let clauses

2006-03-09 Thread Martin Percossi
Hello, the following code doesn't compile snip module Matrix where import Control.Monad.ST import Data.Array.ST import Data.Array.Unboxed type Block s = STUArray s Int Double data MMatrix s = MMatrix Int Int (Block s) newMatrix_ :: Int - Int - ST s (MMatrix s) newMatrix_ m n = do b -