Hi Daniel,
Thanks for getting in touch - I would recommend, if you are interested in
the project, that you join the project mailing lists, and let me know your
sourceforge account name so I can add you to the project membership list.
About the design question that you raise. The aim is to
On Sat, Jul 10, 2010 at 2:15 PM, Simon Courtenage courten...@gmail.comwrote:
Hi Daniel,
Thanks for getting in touch - I would recommend, if you are interested in
the project, that you join the project mailing lists, and let me know your
sourceforge account name so I can add you to the
Hi Simon,
I'm interested in this as well (you might have seen my other posts
about getting QuickFIX interfaced with Haskell).
One question (Yitzchak raises a valid point):
Why port QuantLib's structure rather than directly build an idiomatic
Haskell quantitative finance library? Especially
My thanks to everyone who replied with their helpful comments. You are
right that I forgot to add the public inheritance on the C++ classes (that's
what happens when you write code in an email without passing it through a
compiler first).
I like the idea below, which is easy to understand. It
Simon Courtenage wrote:
I am porting a C++ program to Haskell. My current task is to take a class
hierarchy and produce something equivalent in Haskell
Did you define that task for yourself, or is someone else asking
you to do it?
There really isn't anything equivalent in Haskell. Typeclasses
Actually, I liked Tillmann Rendel's idea much better than my own one:
data A = A {do_x :: Int - Int - Int}
b = A {do_x = \x y - ...}
c = A {do_x = \x y - ...}
Simon Courtenage wrote:
My thanks to everyone who replied with their helpful comments. You are
right that I forgot to add the public
Simon Courtenage wrote:
This is for a project to port an open-source C++ library to haskell.
Great! We'd love to give you whatever support you need
for your efforts.
My initial plan is to more or less preserve the way the
library works in the first draft of the port and see how
far we can
Hi,
Just to add some details about the project I'm working on in case anyone is
interested. The project is called Quanthas and is being hosted on
sourceforge at http://sourceforge.net/projects/quanthas/. The aim of the
project is to produce a Haskell implementation of Quantlib (
Hi,
I am porting a C++ program to Haskell. My current task is to take a class
hierarchy and produce something equivalent in Haskell, but I don't seem to
be able to get a grip on how type classes and instances contribute to the
solution. Can anyone enlighten me?
Roughly, the class hierarchy in
My guess is that it's
class B : public A
and
class C : public A
In this case it seems perfect to use type classes:
class A t where do_x :: t - Integer - Integer - Integer
data B = ...
instance A B where do_x b x y = ...
data C = ...
instance A C where do_x c x y = ...
If you want some general
On Monday 05 July 2010 15:22:43, Simon Courtenage wrote:
Hi,
I am porting a C++ program to Haskell. My current task is to take a
class hierarchy and produce something equivalent in Haskell, but I don't
seem to be able to get a grip on how type classes and instances
contribute to the
Does this work for you?
data A a = A (Int,Int)
data B
data C
class A_Class a where
do_x :: a - Int
instance A_Class (A B) where
do_x (A (a,b)) = a + b
instance A_Class (A C) where
do_x (A (a,b)) = a - b
-- do_x ((A (1,2)) :: A B)
-- 3
-- do_x ((A (1,2)) :: A C)
-- -1
-deech
On Mon,
Simon Courtenage wrote:
I am porting a C++ program to Haskell. My current task is to take a
class hierarchy and produce something equivalent in Haskell, but I don't
seem to be able to get a grip on how type classes and instances
contribute to the solution.
They probably do not contribute
data A_GADT where A_GADT :: A t = t - A_GADT
By the way, is there an extension that enables A_GADT to be automatically
declared as an instance of class A?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
14 matches
Mail list logo