[Haskell-cafe] Re: [Haskell] ANNOUNCE: CPython / libpython bindings

2009-12-28 Thread Yitzchak Gale
John Millikin wrote: ...Python language, has a C API... The cpython[2] package is a binding to this API. I wrote: How does this package compare to the classic MissingPy package? MissingPy appears to be a set of data types which implement MissingH classes using the Python library. Not

Re: [Haskell-cafe] time of day

2009-12-28 Thread Yitzchak Gale
Brian Denheyer wrote: What's the best way to get the year/month/day/hour/min/sec of the current time ? import Data.Time ... now - getCurrentTime tz - getCurrentTimeZone let t = utcToLocalTime tz now (year, month, day) = toGregorian $ localDay t TimeOfDay hour minute sec =

[Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Günther Schmidt
Hi, I'm still trying to build an *abstract* Relation Algebra using the finally tagless style. My guess is that finally tagless style allows one to create a syntax without any initial dependency to an implementation. Ie. once one has created the syntax in this style one can then proceed to

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Jacques Carette
Günther Schmidt wrote: My guess is that finally tagless style allows one to create a syntax without any initial dependency to an implementation. Ie. once one has created the syntax in this style one can then proceed to construct terms. Yes. So this is my goal, create a syntax for relational

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Günther Schmidt
Hi Jacques, well in short my post is supposed to pretty much lay bare my lack of understanding of the problem I try to solve, with the hope that someone is willing to fill the gaps. I do know that I could express my algorithms via list-comprehension or in a List Monad, all using tuples. And

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-28 Thread Aaron Tomb
On Dec 22, 2009, at 9:36 PM, wren ng thornton wrote: Aaron Tomb wrote: I've come across the issue with iconv, as well. The problem seems to be that some versions of iconv define iconv_open and some related functions as macros (that then call libiconv_open, etc.), and some versions of

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Jacques Carette
Günther Schmidt wrote: I do know that I could express my algorithms via list-comprehension or in a List Monad, all using tuples. And that would be concrete and grossly inefficient. You should probably tell us what these algorithms accomplish, rather than how one implementation goes. From a

Re: [Haskell-cafe] Performance of functional priority queues

2009-12-28 Thread Gautam bt
On Sat, Dec 26, 2009 at 12:49 AM, Svein Ove Aas svein@aas.no wrote: Lazyness can be considered to be a controlled form of mutation Can someone explain why this is true (or link me to an explanation)? -- Gautam ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Performance of functional priority queues

2009-12-28 Thread Jon Harrop
On Monday 28 December 2009 17:11:14 Gautam bt wrote: On Sat, Dec 26, 2009 at 12:49 AM, Svein Ove Aas svein@aas.no wrote: Lazyness can be considered to be a controlled form of mutation Can someone explain why this is true (or link me to an explanation)? Forcing the evaluating of a thunk

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Günther Schmidt
Dear Jacques, I'll try to explain by a concrete example and what I'm hoping to achieve. my app imports 4 CSV files, generated from a hospital's IT system and nationally standardized (Germany). Theses 4 files contain records of how much money the hospital received for a patient, when he was

[Haskell-cafe] Re: [Haskell] ANNOUNCE: CPython / libpython bindings

2009-12-28 Thread John Millikin
On Mon, Dec 28, 2009 at 03:52, Yitzchak Gale g...@sefer.org wrote: John Millikin wrote: It has only a minimal binding to libpython, enough to implement its class instances but not enough for general-purpose use of libpython. I'm not sure what you mean by that. Using MissingPy, you can

Re: [Haskell-cafe] Performance of functional priority queues

2009-12-28 Thread Gautam bt
On Tue, Dec 29, 2009 at 12:04 AM, Jon Harrop j...@ffconsultancy.com wrote: Forcing the evaluating of a thunk replaces the unevaluated expression with the value it evaluates to. That is effectively in-place mutation. How can one use that to gain on efficiency? I understand that laziness

Re: [Haskell-cafe] Performance of functional priority queues

2009-12-28 Thread Jon Harrop
On Monday 28 December 2009 18:04:32 Gautam bt wrote: On Tue, Dec 29, 2009 at 12:04 AM, Jon Harrop j...@ffconsultancy.com wrote: Forcing the evaluating of a thunk replaces the unevaluated expression with the value it evaluates to. That is effectively in-place mutation. How can one use that

Re: [Haskell-cafe] Upgraded to GHC 6.12 and can't find anything

2009-12-28 Thread Gregory Propf
Ok, I'm trying to build the haskell platform but getting this.  Anyone know what the problem is?  As far as I know I have all the development libs for OpenGL.  I'm not sure what this means.  I'm running Ubuntu 9.04 on a 64bit dual core AMD. Preprocessing library GLUT-2.1.1.2... Building

Re: [Haskell-cafe] Upgraded to GHC 6.12 and can't find anything

2009-12-28 Thread Jon Harrop
On Monday 28 December 2009 21:06:20 Gregory Propf wrote: Ok, I'm trying to build the haskell platform but getting this.  Anyone know what the problem is?  As far as I know I have all the development libs for OpenGL.  I'm not sure what this means.  I'm running Ubuntu 9.04 on a 64bit dual core

[Haskell-cafe] Control.Parallel missing

2009-12-28 Thread Mitar
Hi! A friend of mine tried to learn Haskell and asked me for an advice because he had problems with Haskell in 5 steps: http://www.haskell.org/haskellwiki/Haskell_in_5_steps Under Write your first parallel Haskell program section there is import Control.Parallel which is simply missing in 6.12

Re: [Haskell-cafe] Control.Parallel missing

2009-12-28 Thread Sjoerd Visscher
Hi Mitar, I think that step 1 should link to the Haskell Platform, and not to GHC or Hugs specifically. A beginner should not be using GHC 6.12 yet! greetings, Sjoerd On Dec 29, 2009, at 12:03 AM, Mitar wrote: Hi! A friend of mine tried to learn Haskell and asked me for an advice because

Re: [Haskell-cafe] Upgraded to GHC 6.12 and can't find anything

2009-12-28 Thread Tom Hawkins
Jon, I haven't tried GHC 6.12 or the Haskell Platform yet, but here is our standard install procedure for our company, which has worked consistently for us since GHC 6.8 (we use ubuntu 9.04 32-bit): - Add ~/.ghc/bin and ~/.cabal/bin to PATH. - Download and extract latest ghc. Then from

Re: [Haskell-cafe] FGL/Haskell and Hierarchical Clustering/dendograms

2009-12-28 Thread Nikolas Borrel-Jensen
Thank you very much for your reply! I have been looking at the code, and there are two problems, as I can see. First, trying with the example t1 :: Tree (Id, Cost) t1 = Node (4,0) [Node (3,2) [Node (1,12) []] ,Node (2,3) [Node (5,1) [Node (6,2) [Node (7,2) [] printed as (4,0) |

[Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2009-12-28 Thread Will Ness
apfelmus apfelmus at quantentunnel.de writes: Dave Bayer wrote: What I'm calling a venturi venturi :: Ord a = [[a]] - [a] merges an infinite list of infinite lists into one list, under the assumption that each list, and the heads of the lists, are in increasing order. I

[Haskell-cafe] Invertible functions list

2009-12-28 Thread Jonathan Fischoff
Hi, I would to create a list of tuples (or something similar) of invertible functions [((a - b), (b - a)), ((b - c), (c - b)), Such that I could call forward invertibleFuctionList domainValue = ? -- composite all the functions backward invertibleFuctionList rangeValue = forward

[Haskell-cafe] FASTER primes (was: Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve))

2009-12-28 Thread Will Ness
apfelmus apfelmus at quantentunnel.de writes: ~~ This is a repost, with apologies to anyone who sees this twice (I've replied to a two years old thread, and it doesn't show up in GMANE as I thought it would). ~~ Dave Bayer wrote: What I'm calling a venturi venturi :: Ord a =

Re: [Haskell-cafe] Invertible functions list

2009-12-28 Thread Dan Weston
This might be pertinent: Alimarine et al, There and Back Again: Arrows for Invertible Programming http://www.cs.ru.nl/A.vanWeelden/bi-arrows/ Jonathan Fischoff wrote: Hi, I would to create a list of tuples (or something similar) of invertible functions [((a - b), (b - a)), ((b - c), (c -

Re: [Haskell-cafe] Invertible functions list

2009-12-28 Thread Ryan Ingram
Do you need to be able to extract the intermediate types? If not, then the only observable value for your function list is the composition (forward/backward), and you can easily represent it like this: data Inv a b = Inv { forward :: (a - b), backward :: (b - a) } nil :: Inv a a nll = Inv id id

Re: [Haskell-cafe] Invertible functions list

2009-12-28 Thread Antoine Latter
On Mon, Dec 28, 2009 at 10:32 PM, Jonathan Fischoff jonathangfisch...@gmail.com wrote: Hi, I would to create a list of tuples (or something similar) of invertible functions [((a - b), (b - a)), ((b - c), (c - b)), Such that I could call forward invertibleFuctionList domainValue = ? --

[Haskell-cafe] Re: FASTER primes (was: Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve))

2009-12-28 Thread Will Ness
Will Ness will_n48 at yahoo.com writes: wheelSums = roll 0 wdiffs roll = scanl (+) wheel = wdiffs ++ wheel wdiffs = 2:4:2:4:6:2:6:4:2:4:6:6:2:6:4:2:6:4:6:8:4:2:4:2: 4:8:6:4:6:2:4:6:2:6:6:4:2:4:6:2:6:4:2:4:2:10:2:10:wdiffs Apparently that works

Re: [Haskell-cafe] Design question

2009-12-28 Thread Alexander Solla
There are many SVG elements, of which only a few are valid as the content of each other SVG elements. SvgDocumentElement defines the allowed subset for the SVG document. I want to generate a DList Char for all those sub-elements and finally collapse them to one DList Char representing

[Haskell-cafe] Request to review my attempt at understanding Monads

2009-12-28 Thread CK Kashyap
Hi, I've been reading the papers titled Comprehending Monads and Monadic Parser Combinator to understand Monads and I think I am beginning to understand it. In my attempt to validate my understanding, I've written my version of List data structure with Monadic behaviour - I'd appreciate answers

[Haskell-cafe] Configuring cabal install readline on Snow Leopard with MacPorts

2009-12-28 Thread Alexy Khrabrov
I've tried to do cabal install readline on Snow Leopard with MacPorts and it fails with the infamous: $ cabal install readline ... checking for GNUreadline.framework... checking for readline... no checking for tputs in -lncurses... yes checking for readline in -lreadline... yes checking for