Re: [Haskell-cafe] a minor bug (memory leak) in ListLike package

2011-08-24 Thread Ivan Lazar Miljenovic
On 24 August 2011 15:54, Sebastian Fischer fisc...@nii.ac.jp wrote: I _think_ this may cause problems with some data types (e.g. http://hackage.haskell.org/packages/archive/numbers/2009.8.9/doc/html/Data-Number-Natural.html ) that require the extra laziness (that is, you can do things like ` 3

Re: [Haskell-cafe] Existential question

2011-08-24 Thread oleg
I had simplified the type to make the plumbing simpler. My intention was to include an initial value to use the function as a sequence transformer / generator: data Kl i o = forall s. Kl s (i - s - (s, o)) That change makes a world of difference! For example, the above type (Kl i) is

Re: [Haskell-cafe] Existential question

2011-08-24 Thread MigMit
Ehm... what? How can you do such a replacement without losing, for example, functions like this: f (KI s h) i = snd $ h i $ fst $ h i s Отправлено с iPad 24.08.2011, в 11:43, o...@okmij.org написал(а): I had simplified the type to make the plumbing simpler. My intention was to include

Re: [Haskell-cafe] - Try to install ssh package by cabal.

2011-08-24 Thread Loïc Maury
Hello Thomas, Finally, I have installed the version 0.3. Thank you for your help Loïc On Tue, Aug 23, 2011 at 9:27 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: FYI: It's usually good to CC the package maintainer when a build fails for non-trivial reasons. At first glance it

[Haskell-cafe] different results after compilation

2011-08-24 Thread Комар Максим
I have some script: $ runhaskell readfile.hs fromList [(Merchant {nick = 01010, location = prontera, x = 184, y = 94},Shop {buy = ShopBuy {titleB = AB Green Salad=5k, itemsB = fromList [(Item {itemId = 12065, price = 5000, refine = , card1 = 0, card2 = 0, card3 = 0, card4 = 0},(100,97))]}, sell =

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread Iustin Pop
On Wed, Aug 24, 2011 at 04:35:42PM +0400, dokondr wrote: Hi, What is the Haskell way to compose functions in run-time? Depending on configuration parameters I need to be able to compose function in several ways without recompilation. When program starts it reads configuration parameters from

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread Arseniy Alekseyev
If your functions have the same type, then you can easily collect them in a data structure, say list, and fold that. For example: function :: String - (String - String) function f1 = f1 function f2 = f2 function f3 = f3 runAUserSpecifiedComposition :: String - F runAUserSpecifiedComposition =

Re: [Haskell-cafe] different results after compilation

2011-08-24 Thread Daniel Fischer
On Wednesday 24 August 2011, 14:45:19, Комар Максим wrote: I have some script: $ runhaskell readfile.hs fromList [(Merchant {nick = 01010, location = prontera, x = 184, y = 94},Shop {buy = ShopBuy {titleB = AB Green Salad=5k, itemsB = fromList [(Item {itemId = 12065, price = 5000, refine = ,

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread dokondr
On Wed, Aug 24, 2011 at 4:44 PM, Iustin Pop ius...@google.com wrote: On Wed, Aug 24, 2011 at 04:35:42PM +0400, dokondr wrote: Hi, What is the Haskell way to compose functions in run-time? Depending on configuration parameters I need to be able to compose function in several ways without

Re: [Haskell-cafe] different results after compilation

2011-08-24 Thread Arseniy Alekseyev
The reason may be that you are not printing the result in your program. runhaskell script prints the result of the main computation by default. The compiled programs don't do that. You'll have to call print in your program to achieve the same. On 24 August 2011 13:45, Комар Максим m...@mtw.ru

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread Iustin Pop
On Wed, Aug 24, 2011 at 04:57:19PM +0400, dokondr wrote: On Wed, Aug 24, 2011 at 4:44 PM, Iustin Pop ius...@google.com wrote: On Wed, Aug 24, 2011 at 04:35:42PM +0400, dokondr wrote: Hi, What is the Haskell way to compose functions in run-time? Depending on configuration parameters I

Re: [Haskell-cafe] why the name lambda calculus?

2011-08-24 Thread Tony Finch
Ezra Cooper e...@ezrakilty.net wrote: I believe this to be a general trait of things described as calculi--that they have some form of name-binders, but I have never seen that observation written down. Combinator calculi are a counter-example. Tony. -- f.anthony.n.finch d...@dotat.at

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread dokondr
On Wed, Aug 24, 2011 at 4:52 PM, Arseniy Alekseyev arseniy.alekse...@gmail.com wrote: If your functions have the same type, then you can easily collect them in a data structure, say list, and fold that. For example: function :: String - (String - String) function f1 = f1 function f2 = f2

Re: [Haskell-cafe] why the name lambda calculus?

2011-08-24 Thread Dominic Mulligan
On Wed, 2011-08-24 at 14:01 +0100, Tony Finch wrote: Ezra Cooper e...@ezrakilty.net wrote: I believe this to be a general trait of things described as calculi--that they have some form of name-binders, but I have never seen that observation written down. Combinator calculi are a

Re: [Haskell-cafe] Performance of concurrent array access

2011-08-24 Thread Andreas Voellmy
One more observation... I tried a third variation in which the test program still uses a single shared IOArray but each thread writes to different indices in the array. In this case I get good scaling with performance similar to the use of IOUArray. In detail, I made the following two changes to

Re: [Haskell-cafe] Function composition in run-time?

2011-08-24 Thread Ertugrul Soeylemez
dokondr doko...@gmail.com wrote: This is a nice one, looks already like tiny DSL ) I think I've got the main idea - enumerate in my program all function compositions in some data structure for Haskell to compile, and the associate these with parameter values in external file. In Haskell you

Re: [Haskell-cafe] Performance of concurrent array access

2011-08-24 Thread Andreas Voellmy
I should have double-checked my work before I sent the last message; I accidentally benchmarked the wrong program. It turns out that the modifications I last described do not improve the scaling of the program to more cores when used with IOArray. And there was a bug: the line startIx = numixs *

[Haskell-cafe] Lifting an enumerator

2011-08-24 Thread Michael Snoyman
Hi all, Max asked earlier[1] how to create a new instance of a class in Persistent using a monad transformer. Without getting into the specific details of persistent, I wanted to pose a question based on a much more general question: how can we lift the inner monad of an enumerator? We can easily

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Lenz
On 08/24/2011 09:02 AM, Michael Snoyman wrote: Hi all, Max asked earlier[1] how to create a new instance of a class in Persistent using a monad transformer. Without getting into the specific details of persistent, I wanted to pose a question based on a much more general question: how can we

Re: [Haskell-cafe] why the name lambda calculus?

2011-08-24 Thread Jack Henahan
It's always been my understanding that calculi were systems that defined particular symbols and the legal methods of their manipulation in the context of a particular calculus. The point, generally (har har), seems to be abstraction. The lambda calculus describes computation without actually

[Haskell-cafe] How to make callCC more dynamic

2011-08-24 Thread bob zhang
Hi, all I thought the right type for ContT should be newtype ContT m a = ContT {runContT :: forall r. (a- m r) - m r} and other control operators shift :: Monad m = (forall r . (a- ContT m r) - ContT m r) - ContT m a reset :: Monad m = ContT m a - ContT m a callCC :: ((a- (forall r . ContT m r)) -

Re: [Haskell-cafe] How to make callCC more dynamic

2011-08-24 Thread Jason Dagit
On Wed, Aug 24, 2011 at 9:19 AM, bob zhang bobzhang1...@gmail.com wrote: Hi, all I thought the right type for ContT should be newtype ContT m a = ContT {runContT :: forall r. (a- m r) - m r} and other control operators shift :: Monad m = (forall r . (a- ContT m r) - ContT m r) - ContT m a

Re: [Haskell-cafe] How to make callCC more dynamic

2011-08-24 Thread Ertugrul Soeylemez
bob zhang bobzhang1...@gmail.com wrote: I thought the right type for ContT should be newtype ContT m a = ContT {runContT :: forall r. (a- m r) - m r} No, that will effectively make it impossible to make use of CPS effects, hence turning your ContT into an IdentityT-like monad transformer,

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Millikin
The type signature liftEnum :: (Monad m, MonadTrans t) = Enumerator a m b - Enumerator a (t m) b expands to: liftEnum :: (Monad m, MonadTrans t) = (Step a m b - Iteratee a m b) - Step a (t m) b - Iteratee a (t m) b So you could implement it iff you can define: lower :: (Monad m,

Re: [Haskell-cafe] How to make callCC more dynamic

2011-08-24 Thread bob zhang
Hi Jason, thanks for your reply. I was curious that we could bring really continuations into haskell, the traditional callCC brings a lot of unnecessary type restrictions On Wed, Aug 24, 2011 at 12:45 PM, Jason Dagit dag...@gmail.com wrote: On Wed, Aug 24, 2011 at 9:19 AM, bob zhang

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread Michael Snoyman
Actually, I'm looking for a slightly different type signature. Look at how I've implemented the special case of ErrorT: liftEnum :: Enumerator In IO (Either OcrError Out) - Enumerator In (ErrorT OcrError IO) Out There's a slightly different value for b, which is what keeps track of the

[Haskell-cafe] haskell or lazy functional as procedure language

2011-08-24 Thread Permjacov Evgeniy
Ok, I know, I want something strange. But consider situation, when one is starting a project and finds, that he need s 1) ACID relational storage 2) Power of good RDBMS system (postgresql for example) 3) Power of some very hight level language and compiled (haskell for example) for stored

[Haskell-cafe] Using - as both type and value constructor

2011-08-24 Thread Armando Blancas
Studying the paper *A Simple Implementation for Priority Search Queues*, by Ralf Hinze, I came across the following syntax that I didn't understand and I couldn't use in GHCi 7.0.3 for defining a binding data type (page 3): Bindings are represented by the following data type: *data k - p = k - p*

Re: [Haskell-cafe] Using - as both type and value constructor

2011-08-24 Thread Daniel Fischer
On Wednesday 24 August 2011, 20:24:14, Armando Blancas wrote: Studying the paper *A Simple Implementation for Priority Search Queues*, by Ralf Hinze, I came across the following syntax that I didn't understand and I couldn't use in GHCi 7.0.3 for defining a binding data type (page 3):

Re: [Haskell-cafe] haskell or lazy functional as procedure language

2011-08-24 Thread A.M.
On Aug 24, 2011, at 1:43 PM, Permjacov Evgeniy wrote: Ok, I know, I want something strange. But consider situation, when one is starting a project and finds, that he need s 1) ACID relational storage 2) Power of good RDBMS system (postgresql for example) 3) Power of some very hight level

Re: [Haskell-cafe] Using - as both type and value constructor

2011-08-24 Thread Armando Blancas
I didn't see that claim in the linked slides, and it's not Haskell '98 (nor Haskell 2010). I didn't realize it linked to the slides; I thought that pointed to the article. I just found another version of the paper, A Simple Implementation Technique for Priority Search Queues, by Hinze,

[Haskell-cafe] (Repa) hFlush: illegal operation

2011-08-24 Thread Michael Orlitzky
I'm using Repa to process a ton of MRI data. The basic process is, * Read in the data * Create a big 'ol data structure (grid) from it * Compute the output in parallel using 'traverse' * Write the output to file However, during the last step, I'm getting, $ ./bin/spline3 +RTS -N4

Re: [Haskell-cafe] Using - as both type and value constructor

2011-08-24 Thread wren ng thornton
On 8/24/11 5:03 PM, Armando Blancas wrote: I didn't see that claim in the linked slides, and it's not Haskell '98 (nor Haskell 2010). I didn't realize it linked to the slides; I thought that pointed to the article. I just found another version of the paper, A Simple Implementation Technique

[Haskell-cafe] Haskell Weekly News: Issue 196

2011-08-24 Thread Daniel Santa Cruz
Welcome to issue 196 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of August 14 to 20, 2011. [1] http://goo.gl/8hDku New and Updated Projects * graphziz (Update - Ivan Lazar Miljenovic) Wraper around Graphviz. [2]

Re: [Haskell-cafe] a minor bug (memory leak) in ListLike package

2011-08-24 Thread John Lato
Thanks for reporting this. I understand the problem, however I don't want to bloat the interface even more with a bunch of strict versions of functions. Even so, the current implementation is definitely the worst possible option as it has the slow performance of building thunks without the

Re: [Haskell-cafe] Using - as both type and value constructor

2011-08-24 Thread Armando Blancas
Thanks for the info; that's good to know. The ICFP '01 version uses pairs; not sure when the other came out or where. On Wed, Aug 24, 2011 at 4:46 PM, wren ng thornton w...@freegeek.org wrote: On 8/24/11 5:03 PM, Armando Blancas wrote: I didn't see that claim in the linked slides, and it's

Re: [Haskell-cafe] a minor bug (memory leak) in ListLike package

2011-08-24 Thread John Lato
On Wed, Aug 24, 2011 at 7:47 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: I was just trying to remember some of the tricks Daniel Peebles (aka {co}pumpkin) used to do in #haskell with Data.List.genericLength. I've never really used ListLike, but was just trying to guess why the

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Lato
Message: 17 Date: Wed, 24 Aug 2011 17:02:49 +0300 From: Michael Snoyman mich...@snoyman.com Subject: [Haskell-cafe] Lifting an enumerator To: Haskell Cafe haskell-cafe@haskell.org Cc: John Millikin jmilli...@gmail.com Message-ID:        

Re: [Haskell-cafe] (Repa) hFlush: illegal operation

2011-08-24 Thread Ben Lippmeier
On 25/08/2011, at 7:15 , Michael Orlitzky wrote: I'm using Repa to process a ton of MRI data. The basic process is, * Read in the data * Create a big 'ol data structure (grid) from it * Compute the output in parallel using 'traverse' * Write the output to file However, during the

[Haskell-cafe] do-re-mi

2011-08-24 Thread Albert Y. C. Lai
do, a block, a monad block rec, a knot tied in the block mu, a name that calls itself (mu is pronounced as me in modern Greek) forM_, a long long list to run SO, a state aborting threads (SO is stack overflow) la, a state to follow SO T's, tranformers of monads that will bring us back to do

Re: [Haskell-cafe] do-re-mi

2011-08-24 Thread Ivan Lazar Miljenovic
On 25 August 2011 11:59, Albert Y. C. Lai tre...@vex.net wrote: do, a block, a monad block rec, a knot tied in the block mu, a name that calls itself (mu is pronounced as me in modern Greek) forM_, a long long list to run SO, a state aborting threads (SO is stack overflow) la, a state to

Re: [Haskell-cafe] How to make callCC more dynamic

2011-08-24 Thread oleg
bob zhang wrote: I thought the right type for ContT should be newtype ContT m a = ContT {runContT :: forall r. (a- m r) - m r} and other control operators shift :: Monad m = (forall r . (a- ContT m r) - ContT m r) - ContT m a reset :: Monad m = ContT m a - ContT m a callCC :: ((a- (forall