Re: [Haskell-cafe] OpenCL target for DPH?

2009-12-07 Thread Olex P
Hi, Good question. I'd like to know the answer too. Cheers, Alex. On Mon, Dec 7, 2009 at 4:10 AM, Marcus G. Daniels mdani...@lanl.gov wrote: Hi, I'm wondering if anyone has looked at OpenCL as target for Data Parallel Haskell? Specifically, having Haskell generate CL kernels, i.e. SIMD

Re: [Haskell-cafe] Type synonyms vs standard types

2009-09-30 Thread Olex P
of that function what kind of parameters function expects! :-D On Wed, Sep 30, 2009 at 5:47 AM, wren ng thornton w...@freegeek.org wrote: Olex P wrote: This idea with new level of abstraction is good but in some cases it can make things overcomplicated / less efficient. Does that mean leave simple built

[Haskell-cafe] Type synonyms vs standard types

2009-09-29 Thread Olex P
Hi everyone, Dumb question about declaring a function and type synonyms. There are to different declarations of the same function: attrNames :: String - AttrDict - [String] attrNames :: AttrClass - AttrDict - AttrNames First gives you the idea about exact types it expects (except AttrDict for

Re: [Haskell-cafe] Type synonyms vs standard types

2009-09-29 Thread Olex P
...@gmail.com wrote: On Tue, Sep 29, 2009 at 11:40 AM, Olex P hoknam...@gmail.com wrote: Hi everyone, Dumb question about declaring a function and type synonyms. There are to different declarations of the same function: attrNames :: String - AttrDict - [String] attrNames :: AttrClass

[Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Olex P
Hi guys, Do we have anything like half precision floats in Haskell? Maybe in some non standard libraries? Or I have to use FFI + OpenEXR library to achieve this? Cheers, Oleksandr. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Olex P
27, 2009, at 2:42 PM, Olex P wrote: Hi guys, Do we have anything like half precision floats in Haskell? Maybe in some non standard libraries? Or I have to use FFI + OpenEXR library to achieve this? Cheers, Oleksandr. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Olex P
, 2009, at 2:42 PM, Olex P wrote: Hi guys, Do we have anything like half precision floats in Haskell? Maybe in some non standard libraries? Or I have to use FFI + OpenEXR library to achieve this? Cheers, Oleksandr. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Olex P
Okay looks like FFI is the only way to go, Thanks. Cheers, Oleksandr. On Sun, Sep 27, 2009 at 9:50 PM, wren ng thornton w...@freegeek.org wrote: Olex P wrote: Hi, Yes, I mean sizeOf 2. It's useful not only on GPUs but also in normal software. Think of huge data sets in computer graphics

Re: [Haskell-cafe] Parallel graphics

2009-09-24 Thread Olex P
Awesome! On Thu, Sep 24, 2009 at 7:47 AM, Peter Verswyvelen bugf...@gmail.comwrote: This is seriously cool stuff!!! Maybe it's time to start a Haskell Demo Scene :-) (what's a demo scene? See http://en.wikipedia.org/wiki/Demoscene ) PS: Note that Conal Elliott also was generating GPU code

[Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
Hey guys, It's a dumb question but I'd like to know a right answer... Let's say we have some geometry data that can be Sphere, Cylinder, Circle and so on. We can implement it as new data type plus a bunch of functions that work on this data: data Geometry = Sphere Position Radius

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
perimeter) list --- [12.566370614359172] On Tue, Sep 15, 2009 at 6:29 PM, Olex P hoknam...@gmail.com wrote: Hey guys, It's a dumb question but I'd like to know a right answer... Let's say we have some geometry data that can be Sphere, Cylinder, Circle and so on. We can implement it as new

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
this: perimeter :: Geometry - Double perimeter (Sphere _ r) = 0.0 perimeter (Circle _ r) = 2.0 * pi * r The latter is even simpler because there is no need in extraction of Double value from Maybe. So the question is still there: do I need a type class? On Tue, Sep 15, 2009 at 12:21 PM, Olex P hoknam

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
Cool. It's more and more clear guys. Thanks a lot. I'll check that expression problem. Existential types sounds a bit scary :) On Tue, Sep 15, 2009 at 3:26 PM, Sean Leather leat...@cs.uu.nl wrote: Perimeter doesn't make sense for Sphere or Cylinder. So we could define a type class for

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
On Tue, Sep 15, 2009 at 11:29 AM, Olex P hoknam...@gmail.com wrote: Hey guys, It's a dumb question but I'd like to know a right answer... Let's say we have some geometry data that can be Sphere, Cylinder, Circle and so on. We can implement it as new data type plus a bunch of functions

Re: [Haskell-cafe] Typeclasses vs simple functions?

2009-09-15 Thread Olex P
Thanks for explanation Sean! On Tue, Sep 15, 2009 at 4:30 PM, Sean Leather leat...@cs.uu.nl wrote: Existential types sounds a bit scary :) It's unfortunate that they've developed a scariness feeling associated with them. They can be used in strange ways, but simple uses are quite

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-24 Thread Olex P
. Allbery KF8NH allb...@ece.cmu.edu On 2009 Jan 23, at 17:58, Olex P wrote: class Vector v where (^+^) :: v - v - v class Matrix m where (^+^) :: m - m - m You can't reuse the same operator in different classes. Vector owns (^+^), so Matrix can't use it itself. You could

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-24 Thread Olex P
* is not commutative in this case 2009/1/24 Olex P hoknam...@gmail.com Yeah guys. I confused myself. I forgot why I had to implement several + operators (^+^, ^+, ^+. etc.) for Vector class. Now I've got an idea again. Different names make a perfect sense. Thanks a lot. On Sat, Jan 24, 2009 at 6:34

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-24 Thread Olex P
, Jan 24, 2009 at 3:59 PM, Luke Palmer lrpal...@gmail.com wrote: 2009/1/24 Olex P hoknam...@gmail.com But you know it doesn't make too much sense because I also have to define addition Scalar + Vector (that means construct vector from scalar and add a vector), Vector + Scalar and so on. And as we

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-24 Thread Olex P
Cool! Thanks Ryan! On Sat, Jan 24, 2009 at 8:31 PM, Ryan Ingram ryani.s...@gmail.com wrote: 2009/1/24 Olex P hoknam...@gmail.com: What I want to ask you guys can we define a function with arbitrary number of parameters? Actually not really arbitrary but just several possibilities (as we

[Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Olex P
Hello Haskellers! It's probably a simple question but I can't find a proper solution... Suppose we have a class Vector which overloads (+) operation. I'd like to represent a Matrix data type as a set of vectors: data Matrix3 = M3 !Vector3 !Vector3 !Vector3 In this case (+) for matrices could be

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Olex P
Well if telepaths on vacation... class Vector v where (^+^) :: v - v - v data Vector3 = V3 !Double !Double !Double instance Vector Vector3 where (V3 x1 y1 z1) ^+^ (V3 x2 y2 z2) = V3 (x1 + x2) (y1 + y2) (z1 + z2) class Matrix m where (^+^) :: m - m - m data Matrix3 = M3

Re: [Haskell-cafe] Haskell as a scripting language.

2008-09-10 Thread Olex P
Hi guys, Any ideas how to integrate Haskell into other software as scripting engine? Similarly to Python in Blender or GIMP or to JavaScript in the products from Adobe. Which possibilities we have? Cheers, Alex. On Wed, Sep 10, 2008 at 10:20 PM, David F. Place [EMAIL PROTECTED] wrote: Hi,

[Haskell-cafe] Suggestion for implementation of vector library

2008-06-17 Thread Olex P
Hi guys, Sorry for a silly questions but I didn't find a proper answer in Google. I've started to learn Haskell and would like to implement a library for work with vectors. I found different implementations of this stuff but all of them made just for fun in a short as possible terms using lists

Re: [Haskell-cafe] Suggestion for implementation of vector library

2008-06-17 Thread Olex P
Thank you guys, I'll check it. On Tue, Jun 17, 2008 at 4:30 PM, Henning Thielemann [EMAIL PROTECTED] wrote: On Tue, 17 Jun 2008, Olex P wrote: Hi guys, Sorry for a silly questions but I didn't find a proper answer in Google. I've started to learn Haskell and would like to implement