[Haskell-cafe] Re: OpenGL - OGL

2008-11-17 Thread Henning Thielemann
On Sun, 16 Nov 2008, Neal Alexander wrote: Brent Yorgey wrote: --- ANN: OpenGL with extra type safety. Neal Alexander Hopefully the code will be uploaded to Hackage as a separate package soon.

[Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Silviu ANDRICA
Hello, I am very new to Haskell, this is my first day, and I wanted to know if it is possible to prove correctness of a multi-threaded application written in Haskell. Basically, I want to check that a multi-threaded implementation of an algorithm that detects cycles in a dynamically

Re: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Ketil Malde
Luke Palmer [EMAIL PROTECTED] writes: STM My apologies for side-tracking, but does anybody have performance numbers for STM? I have an application waiting to be written using STM, boldly parallelizing where no man has parallelized before, but if it doesn't make it faster, the whole excercise

Re: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Luke Palmer
On Mon, Nov 17, 2008 at 4:04 AM, Silviu ANDRICA [EMAIL PROTECTED] wrote: Hello, I am very new to Haskell, this is my first day, and I wanted to know if it is possible to prove correctness of a multi-threaded application written in Haskell. Basically, I want to check that a multi-threaded

[Haskell-cafe] Re: Type question in instance of a class

2008-11-17 Thread Maurí­cio
Why is this wrong? (...) (...) One way to code this would be to use functional dependencies: class MyClass r s | r - s where function :: r - s data MyData u = MyData u instance MyClass (MyData v) v where function (MyData a) = a One additional problem is that I (believe I) need that my

[Haskell-cafe] Re: OOPer?

2008-11-17 Thread Maurí­cio
(...) GHC says that the type of the result of 'function' is both determined by the rigid type from MyClass and the rigid type from MyData. But why can't both be the same? are you OOPer? :) What is an OOPer? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread Jonathan Cast
On Mon, 2008-11-17 at 16:39 -0200, Maurí­cio wrote: (...) GHC says that the type of the result of 'function' is both determined by the rigid type from MyClass and the rigid type from MyData. But why can't both be the same? are you OOPer? :) What is an OOPer? Object-Oriented

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread Greg Fitzgerald
Jonathan Cast wrote: [Functional and object-oriented programming] have points of similarity, but on net the best plan is to simply never reason analogically from one to the other. Coming from the OO world, I found it very useful to see how the same solution is modeled using different

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-17 Thread Bulat Ziganshin
Hello Maurí­cio, Monday, November 17, 2008, 9:38:06 PM, you wrote: (...) One way to code this would be to use functional dependencies: class MyClass r s | r - s where function :: r - s One additional problem is that I (believe I) need that my class takes just one type FDs with just

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread David Leimbach
On Mon, Nov 17, 2008 at 10:39 AM, Maurí­cio [EMAIL PROTECTED] wrote: (...) GHC says that the type of the result of 'function' is both determined by the rigid type from MyClass and the rigid type from MyData. But why can't both be the same? are you OOPer? :) What is an OOPer? I

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-17 Thread J. Garrett Morris
On Mon, Nov 17, 2008 at 10:38 AM, Maurí­cio [EMAIL PROTECTED] wrote: newtype ComplexWithDouble = ComplexWithDouble (ComplexNumber Double) deriving ... Perhaps you want something like: class Complex r c | c - r where makeComplex :: r - r - c realPart :: c - r imagPart

RE: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Tim Docker
Ketil Malde wrote: My apologies for side-tracking, but does anybody have performance numbers for STM? I have an application waiting to be written using STM, boldly parallelizing where no man has parallelized before, but if it doesn't make it faster, the whole excercise gets a lot less

[Haskell-cafe] How to make interface IO() to IO a in a command-driven tool

2008-11-17 Thread Kyongho Min
Dear Haskell users, I am working on a command-driven tool (::IO ()). If the system invokes itself again, and the system's returned data type would be 'IO a', say (IO Exp) (Expression). tool:: a - IO() The nested tool invocation returns (IO Exp) to the previous tool. I am using dynamic error

[Haskell-cafe] Re: [off-topic] OOPer?

2008-11-17 Thread Maurí­cio
(...) I don't recall where I found the following example, but copied it locally as compelling evidence that the functional solution can be much clearer and shorter than the same solution modeled with objects and inheritance. Greg, I desagree with you. Bjarne Stroustrup, the original

Re: [Haskell-cafe] Re: [off-topic] OOPer?

2008-11-17 Thread Jonathan Cast
On Mon, 2008-11-17 at 21:49 -0200, Maurí­cio wrote: (...) I don't recall where I found the following example, but copied it locally as compelling evidence that the functional solution can be much clearer and shorter than the same solution modeled with objects and inheritance.

Re: [Haskell-cafe] Re: [off-topic] OOPer?

2008-11-17 Thread Daniel Yokomizo
On Mon, Nov 17, 2008 at 9:49 PM, Maurí­cio [EMAIL PROTECTED] wrote: (...) I don't recall where I found the following example, but copied it locally as compelling evidence that the functional solution can be much clearer and shorter than the same solution modeled with objects and

Re: [Haskell-cafe] Re: [off-topic] OOPer?

2008-11-17 Thread Derek Elkins
On Mon, 2008-11-17 at 16:04 -0800, Jonathan Cast wrote: On Mon, 2008-11-17 at 21:49 -0200, Maurí­cio wrote: (...) I don't recall where I found the following example, but copied it locally as compelling evidence that the functional solution can be much clearer and shorter than the

[Haskell-cafe] Re: Find unused exports

2008-11-17 Thread Ivan Lazar Miljenovic
Jason Dagit dagit at codersbase.com writes: Hello, Has anyone already made a tool to check if exported functions, data constructors, types, etc are unused within a set of modules? My SourceGraph programme (available on Hackage) can do this with a few caveats: 1) Only supports functions,

Re: [Haskell-cafe] Re: Find unused exports

2008-11-17 Thread Jason Dagit
On Mon, Nov 17, 2008 at 4:36 PM, Ivan Lazar Miljenovic [EMAIL PROTECTED] wrote: Jason Dagit dagit at codersbase.com writes: Hello, Has anyone already made a tool to check if exported functions, data constructors, types, etc are unused within a set of modules? My SourceGraph

Re: [Haskell-cafe] Haskell library support

2008-11-17 Thread Jeff Zaroyko
2008/11/15 Galchin, Vasili [EMAIL PROTECTED]: Hello, I am looking for something to work on. Where are there perceived holes in the Haskell library support? Regards, Vasili Hello Vasili Maybe the haskell.org wiki would be a good place for people to record their suggestions?

[Haskell-cafe] Statically dimension-checked hmatrix

2008-11-17 Thread Reiner Pope
Hi, What is the situation regarding statically dimension-checked linear algebra libraries? It seems that Frederik Eaton was working on one in 2006 (see the paper Statically typed linear algebra in Haskell), and he produced the Vectro library from this, based on GSLHaskell. Are there any more

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread Greg Fitzgerald
I wrote: I don't recall where I found the following example My apologies to Ralf Lammel and Ondrej Rypacek. Five seconds on Google tells me I had copied that code verbatim from their paper, The expression lemma. http://www.uni-koblenz.de/~laemmel/expression/long.pdf Great paper, by the way!

Re: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Ketil Malde
Tim Docker [EMAIL PROTECTED] writes: My apologies for side-tracking, but does anybody have performance numbers for STM? I have an application waiting to be written using STM, boldly parallelizing where no man has parallelized before, but if it doesn't make it faster, Faster than what?

[Haskell-cafe] simple generic / data view library?

2008-11-17 Thread Conal Elliott
Is there a simple existing library that provides views of data types in terms of unit, product and sum? Here's what I threw together for my own use. I used associated types, though functional dependencies would work as well. class HasView t where type View t view :: t - View t

Re: [Haskell-cafe] simple generic / data view library?

2008-11-17 Thread José Pedro Magalhães
Hello Conal, What you've done looks very much like the Regular datatype [1] in the rewriting library [2]. The rewriting library, as its name indicates, is very much targeted at rewriting. For a more complete library using a sum of products view (and without type synonyms), try the new release of

Re: [Haskell-cafe] Proof of a multi-threaded application

2008-11-17 Thread Ryan Ingram
If you have multiple agents interacting with some structure and you want it to look like each of them is accessing it serialized, then STM is exactly what you want. The performance is always in comparison to what; you will likely get worse performance than the best possible implementation of your

[Haskell-cafe] Re: Type question in instance of a class

2008-11-17 Thread Maurí­cio
Perhaps you want something like: class Complex r c | c - r where makeComplex :: r - r - c realPart :: c - r imagPart :: c - r data ComplexNumber t = CN t t instance Complex t (ComplexNumber t) where makeComplex = CN realPart (CN r _) = r imagPart

Re: [Haskell-cafe] Re: OOPer?

2008-11-17 Thread Ryan Ingram
David, I had to bring up a parenthetical from your message because I think it is often a point of confusion: 2008/11/17 David Leimbach [EMAIL PROTECTED]: (Would it then be fair to equate a Haskell class to a Java Interface, but not to a Java class?) This is a dangerous direction to go,