Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-12 Thread Bertram Felgenhauer
Petr Pudlak wrote: Would it be possible to create a lazy selection/sorting algorithm so that getting any element of the sorted list/array by its index would require just O(n) time, and getting all the elements would still be in O(n * log n)? The (merge) sorting algorithm provided by Data.List

Re: [Haskell-cafe] Re: Adding an ignore function to Control.Monad

2009-07-12 Thread Magnus Therning
Stephan Friedrichs wrote: Johan Tibell wrote: [...] I also think void is clearer than ignore. So do I. Another point is, that it's familiar from other languages; a function void f(...) doesn't return anything but may have an effect on the environment. That depends on what languages you are

Re[2]: [Haskell-cafe] Re: Adding an ignore function to Control.Monad

2009-07-12 Thread Bulat Ziganshin
Hello Magnus, Sunday, July 12, 2009, 12:12:01 PM, you wrote: That depends on what languages you are familiar with, of course. To me void is a type (C/C++) while ignore is a function (OCaml) ;-) you can write (void) :) -- Best regards, Bulat

Re: [Haskell-cafe] Re: excercise - a completely lazy sorting algorithm

2009-07-12 Thread Raynor Vliegendhart
On 7/9/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Of course, some part of algorithm has to be recursive, but this can be outsourced to a general recursion scheme, like the hylomorphism hylo :: Functor f = (a - f a) - (f b - b) - (a - b) hylo f g = g . fmap (hylo f g) . f

Re: [Haskell-cafe] Type families and polymorphism

2009-07-12 Thread Bertram Felgenhauer
Jeremy Yallop wrote: Why does compiling the following program give an error? {-# LANGUAGE TypeFamilies, RankNTypes #-} type family TF a identity :: (forall a. TF a) - (forall a. TF a) identity x = x GHC 6.10.3 gives me: Couldn't match expected type `TF a1' against inferred type `TF

Re: [Haskell-cafe] Haskell used for data analysis - OLAP?

2009-07-12 Thread Edward Kmett
2009/7/9 Günther Schmidt gue.schm...@web.de Hi, I've developed this commercial app in Haskell with all of the business logic coded in SQL with the help of haskelldb. Some of the intermediate results (of queries) I had to manifest in extra tables because the initial query was expensive, the

Re: [Haskell-cafe] Mixing C and Haskell code in the same file

2009-07-12 Thread Henk-Jan van Tuyl
On Fri, 10 Jul 2009 15:24:51 +0200, Maurí­cio briqueabra...@yahoo.com wrote: Is it possible to insert C code directly to, say, .hsc files? I see this construct in ghc user docs: I think you can find your answer here: http://www.haskell.org/ghc/docs/latest/html/users_guide/hsc2hs.html --

[Haskell-cafe] Goldman Sachs - your home for OCaml and Erlang?

2009-07-12 Thread Max Cantor
I know that this is a bit off topic, but thought it would interest several readers. Apparently, GS, which. AFAIK, doesn't make a lot of noise in the FP space compared to some other banks, does use some FP: http://www.zerohedge.com/article/aleynikov-code-dump-uncovered

[Haskell-cafe] Re: excercise - a completely lazy sorting algorithm

2009-07-12 Thread Heinrich Apfelmus
Raynor Vliegendhart wrote: On 7/9/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Of course, some part of algorithm has to be recursive, but this can be outsourced to a general recursion scheme, like the hylomorphism hylo :: Functor f = (a - f a) - (f b - b) - (a - b) hylo f g =

[Haskell-cafe] Haskell Weekly News: Issue 125 - July 12, 2009

2009-07-12 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090712 Issue 125 - July 12, 2009 --- Welcome to issue 125 of HWN, a newsletter covering

Hylomorphisms (was: [Haskell-cafe] excercise - a completely lazy sorting algorithm)

2009-07-12 Thread Raynor Vliegendhart
On 7/12/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Raynor Vliegendhart wrote: On 7/9/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Of course, some part of algorithm has to be recursive, but this can be outsourced to a general recursion scheme, like the hylomorphism

[Haskell-cafe] Re: Mixing C and Haskell code in the same file

2009-07-12 Thread Maurí­cio
Is it possible to insert C code directly to, say, .hsc files? I see this construct in ghc user docs: I think you can find your answer here: http://www.haskell.org/ghc/docs/latest/html/users_guide/hsc2hs.html I did read that. It says I can use #def to insert a C definition, but there are no

Re: Hylomorphisms (was: [Haskell-cafe] excercise - a completely lazy sorting algorithm)

2009-07-12 Thread Brent Yorgey
On Sun, Jul 12, 2009 at 07:01:11PM +0200, Raynor Vliegendhart wrote: On 7/12/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Raynor Vliegendhart wrote: On 7/9/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Of course, some part of algorithm has to be recursive, but this can

[Haskell-cafe] Could C libraries be part of Haskell Platform?

2009-07-12 Thread Maurí­cio
Probably not, but... There are stable and portable libraries that implement functionality missing in Haskell. It could be nice to be able to list then in a cabal file (using, say, pkgconfig-depends) and know for sure that any system with Haskell Platform will have then available for use with FFI.

Re: [Haskell-cafe] Re: Mixing C and Haskell code in the same file

2009-07-12 Thread Bulat Ziganshin
Hello Maurí­cio, Sunday, July 12, 2009, 9:11:53 PM, you wrote: I did read that. It says I can use #def to insert a C definition, but there are no examples of use, and I could not find one. #def inline int signof(int x) {return x0?-1:x0?1:0;} foreign import ccall safe signof :: CInt - CInt

Re: [Haskell-cafe] Could C libraries be part of Haskell Platform?

2009-07-12 Thread Bulat Ziganshin
Hello Maurí­cio, Sunday, July 12, 2009, 9:40:06 PM, you wrote: An example would be sqlite3. w/o haskell binding it's useless for most of HP users -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe

Re: [Haskell-cafe] Could C libraries be part of Haskell Platform?

2009-07-12 Thread Brandon S. Allbery KF8NH
On Jul 12, 2009, at 13:40 , Maurí cio wrote: Probably not, but... There are stable and portable libraries that implement functionality missing in Haskell. It could be nice to be able to list then in a cabal file (using, say, pkgconfig-depends) and know for sure that any system with Haskell

[Haskell-cafe] Re: Could C libraries be part of Haskell Platform?

2009-07-12 Thread Maurí­cio
Probably not, but... There are stable and portable libraries that implement functionality missing in Haskell. It could be nice to be able to list then in a cabal file (using, say, pkgconfig-depends) and know for sure that any system with Haskell Platform will have then available for use with

Re: [Haskell-cafe] Re: Could C libraries be part of Haskell Platform?

2009-07-12 Thread Brandon S. Allbery KF8NH
On Jul 12, 2009, at 19:38 , Maurí cio wrote: That, of course, would be the goal. Today, it's disappointing to write bindings, since Hackage won't build them properly (since the libraries are not installed on hackage. Of course, for simple packages like zlib or sqlite3 you have the alternative of

Re: [Haskell-cafe] Re: Could C libraries be part of Haskell Platform?

2009-07-12 Thread Brandon S. Allbery KF8NH
On Jul 12, 2009, at 20:06 , Brandon S. Allbery KF8NH wrote: This isn't clear to me; in general you only need to bind them once and then they're available in Haskell. Why not include the library with its bindings? The exception here is the still-evolving bindings to e.g. BLAS. It's not

[Haskell-cafe] ICFP09 Final Call for Participation

2009-07-12 Thread Matthew Fluet (ICFP Publicity Chair)
= Final Call for Participation The 14th ACM SIGPLAN International Conference on Functional Programming (ICFP 2009) http://www.cs.nott.ac.uk/~gmh/icfp09.html

[Haskell-cafe] Re: Could C libraries be part of Haskell Platform?

2009-07-12 Thread Maurí­cio
This isn't clear to me; in general you only need to bind them once and then they're available in Haskell. Why not include the library with its bindings? There are many ways to bind to a library. The first one isn't usually the best. Including the library with its bindings means you have to