Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread serialhex
On Fri, Mar 16, 2012 at 8:35 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: If you're asking about performance, as in is there a problem that can be solved in O(f(n)) time in Java but not in Haskell-sans-IO-and-ST?, then it becomes a harder question. I'm not sure what the answer

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Chris Smith
On Fri, Mar 16, 2012 at 3:43 PM, serialhex serial...@gmail.com wrote: an interesting question emerges:  even though i may be able to implement an algorithm with O(f(n)) in Haskell, and write a program that is O(g(n)) O(f(n)) in C++ or Java...  could Haskell be said to be more efficient

[Haskell-cafe] Are side effects necessary is a non question; you compute so as to change the state of the world.

2012-03-16 Thread KC
Casey -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] The Theoretical Question would be; are side effects necessary for computational heavy lifting.

2012-03-16 Thread KC
Casey -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread David Thomas
If the question is when can I have my output, then both are equally relevant and can be safely conflated. That said, while some programming problems *are* of this type, I think most aren't, and your points certainly stand. On Fri, Mar 16, 2012 at 3:31 PM, Chris Smith cdsm...@gmail.com wrote

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Ryan Ingram
IO objects are pure, but they conceptually represent functions that modify the state of reality. -- ryan On Fri, Mar 16, 2012 at 5:23 AM, Christopher Svanefalk christopher.svanef...@gmail.com wrote: Dear all, there is a question I have been thinking about a bit. In short, we could simply

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Jerzy Karczmarczuk
, in classical physics the state of the world changes constantly (in a quantum world it is extremely ambiguous...), but the question of purity of a program - in my opinion - concerns the program, and nothing else. The networking is not expected to break the referential transparency, or does it? Jerzy

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread KC
On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. The networking is not expected to break

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Donn Cave
Quoth KC kc1...@gmail.com, On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. Or software

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Jeff Shaw
It is the third or the fourth time that somebody recently puts the equivalence between the communication with the outer world, and side effects. I contest that very strongly, perhaps a TRUE guru might instruct me. I think there are three key concepts rumbling around in this discussion that

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-12 Thread Paul Graphov
Hi! Thanks to all who responded! I got a lot of information to read and think about. For now I decided to use stm-channelize as the simplest approach which seem to be enough. On Mon, Mar 5, 2012 at 9:50 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello. I've also written

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread C K Kashyap
Thank you Jason. On Mon, Mar 5, 2012 at 1:05 PM, Jason Dagit dag...@gmail.com wrote: I don't know if timeline has been established, but my understanding is that there is a need for this and that the right people are aware of it and looking into it. The GHC trac has a ticket for this:

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread Simon Marlow
There is a possibility that the IHG might fund this during the next cycle, which would mean that it would be in 7.6.1. Cheers, Simon On 05/03/2012 07:35, Jason Dagit wrote: I don't know if timeline has been established, but my understanding is that there is a need for this and that

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread C K Kashyap
On Mon, Mar 5, 2012 at 2:54 PM, Simon Marlow marlo...@gmail.com wrote: There is a possibility that the IHG might fund this during the next cycle, which would mean that it would be in 7.6.1. Cheers, Simon That is very good to hear!!! Regards, Kashyap

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-05 Thread Alexander V Vershilov
Hello. I've also written simple chat server based on conduits and stm channels https://github.com/qnikst/chat-server/blob/master/src/Main.hs it has quite similar aproach and maybe this solution can be used together to have better results. -- Alexander Vershilov Sat, Mar 03, 2012 at 02:05:17AM

[Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-04 Thread C K Kashyap
Hi All, Can someone please let me know if there is a 64bit target on Windows on the horizon for GHC? I am trying to push for changing the current implementation in my organization in C++ to Haskell - Our primary targets are Windows and Mac. Not being able to generate 64bit DLL's on Windows would

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-04 Thread Jason Dagit
I don't know if timeline has been established, but my understanding is that there is a need for this and that the right people are aware of it and looking into it. The GHC trac has a ticket for this: http://hackage.haskell.org/trac/ghc/ticket/1884 On Sun, Mar 4, 2012 at 9:59 PM, C K Kashyap

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Gregory Collins
On Fri, Mar 2, 2012 at 5:19 PM, Paul Graphov grap...@gmail.com wrote: Hello Cafe! I am trying to implement networked application in Haskell. It should accept many client connections and support bidirectional conversation, that is not just loop with Request - Response function but also

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Alp Mestanogullari
Hi, On Sat, Mar 3, 2012 at 10:38 AM, Gregory Collins g...@gregorycollins.netwrote: Hi, The tutorial I gave for CUFP 2011 was a multi-user web chat program using the Snap Framework. STM channels make this kind of problem super-easy to deal with. Don't be afraid of forking lots of Haskell

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Gregory Collins
On Sat, Mar 3, 2012 at 12:50 PM, Alp Mestanogullari alpmes...@gmail.comwrote: That's exactly what I would have needed, several times in the past 2 years. I've been wondering about a good way to abstract this to have a library where you'd just plug your business logic and thus not have to care

[Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Paul Graphov
Hello Cafe! I am trying to implement networked application in Haskell. It should accept many client connections and support bidirectional conversation, that is not just loop with Request - Response function but also sending notifications to clients etc. NB: I came from C++ background and used to

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Alexander V Vershilov
Hello, Paul. It seems you should not use 3 threads, but run in a data-driven behaviour with one thread per client. You can take a look at network-conduit [1] example, there is a very good aproach to tcp-network application. There are some iteratee based examples but they are not so extensible.

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Joey Adams
On Fri, Mar 2, 2012 at 3:04 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, Paul. It seems you should not use 3 threads, but run in a data-driven behaviour with one thread per client. I don't think this will work for Paul's situation. He needs to be able to send

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Alexander V Vershilov
for such a case, but conduit aproach seems quite easy and take care about resources. Recently I wrote a question about such a situation [1] and it simplification [1] http://www.haskell.org/pipermail/haskell-cafe/2012-February/099770.html I've used smth like stm-channelize approach to make virtual

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Joey Adams
On Fri, Mar 2, 2012 at 7:34 PM, Joey Adams joeyadams3.14...@gmail.com wrote: I'll try to put together a simple chat server example, like the one I wrote for stm-channelize. Here it is: https://github.com/joeyadams/haskell-chat-server-example See, in particular, the serveLoop function.

[Haskell-cafe] question about conduit source

2012-02-28 Thread Alexander V Vershilov
Hello, cafe. Is it possible to read data from different concurrent sources, i.e. read data from source as soon as it become avaliable, e.g. runResourceT $ (source1 stdin $= CL.map Left) = (source2 handle $= CL.map Right) $= application $$ sink

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Michael Snoyman
On Tue, Feb 28, 2012 at 6:04 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, cafe. Is it possible to read data from different concurrent sources, i.e. read data from source as soon as it become avaliable, e.g.  runResourceT $ (source1 stdin $= CL.map Left)              

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Clark Gaebel
First of all, I'd probably name that operator =, since = is Kleisli composition in Control.Monad. Second, you're going to need new threads for this, since you'll be reading from two sources concurrently. This isn't as big a problem as you might think, because Haskell threads are dirt cheap,

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Clark Gaebel
Finally, I've uploaded a new version of stm-conduit [1] with these combinators included. You should cabal update and then cabal install stm-conduit to get the latest version, and now you can vertically compose your sources! Regards, - clark [1]

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Alexander V Vershilov
Hello. Naming operator = instead of = is a good idea. But this functions are looks very good and will make code easier to understand. Also I'll try using non-STM channel (as Michael adviced) because in such a task I don't need all STM power. Thanks for response. -- Alexander Tue, Feb 28,

[Haskell-cafe] question in install gtk2hs's webkit hackage

2012-02-26 Thread Canhua
hi, I am cabal-installing webkit hackage on windows, and get a error: pkg-config pckage webkit-1.0 version 1.1.15 is required but could be not found What should I next? install webkit? How to? I find there is a webkitgtk+ project. Which one should I install. I have try to install both of them

Re: [Haskell-cafe] question regarding Data.Array.Accelerate

2012-02-12 Thread Philipp
Nevermind, I just realised I got something mixed up. Sorry to bother you. -- View this message in context: http://haskell.1045720.n5.nabble.com/question-regarding-Data-Array-Accelerate-tp5476144p5476586.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com

Re: [Haskell-cafe] some question about conduit usage

2012-02-11 Thread Michael Snoyman
On Fri, Feb 10, 2012 at 4:26 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, cafe! I have somq questions about proper conduit usage in some usecases, I can't find a good way to solve this problems 1). adding additional source to conduit processing [1] Sometimes I want

[Haskell-cafe] question regarding Data.Array.Accelerate

2012-02-11 Thread Philipp
I'm missing something obvious, so if any of you could point it out to me I would be glad. Thanks, Philipp -- View this message in context: http://haskell.1045720.n5.nabble.com/question-regarding-Data-Array-Accelerate-tp5476144p5476144.html Sent from the Haskell - Haskell-Cafe mailing list archive

[Haskell-cafe] some question about conduit usage

2012-02-10 Thread Alexander V Vershilov
Hello, cafe! I have somq questions about proper conduit usage in some usecases, I can't find a good way to solve this problems 1). adding additional source to conduit processing [1] Sometimes I want to run a Source and send use it to produce output e.g. have something like: runSource ::

Re: FW: A Garbage Collection Question

2012-01-26 Thread Simon Marlow
On 25/01/2012 07:16, Andres Löh wrote: You seem to assume that old strategies use a different GC policy than new strategies. My understanding is that this is not true. The WEAK policy is used in general now. So old strategies shouldn't be used with more recent GHCs, or you'll lose parallelism.

Re: FW: A Garbage Collection Question

2012-01-24 Thread Andres Löh
Hi Burak. You seem to assume that old strategies use a different GC policy than new strategies. My understanding is that this is not true. The WEAK policy is used in general now. So old strategies shouldn't be used with more recent GHCs, or you'll lose parallelism. Cheers, Andres

[Haskell-cafe] Module name space question

2011-12-12 Thread Christoph Breitkopf
Hi, I recently asked about what interfaces to implement for a new data type. Following the rule that the last 10% of work take the second 90% of time, some other questions have come up. If anyone wants to look at the code in question: http://www.chr-breitkopf.de/comp/IntervalMap Some time ago

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread John Lato
From: Christoph Breitkopf chbreitk...@googlemail.com Hi, I recently asked about what interfaces to implement for a new data type. Following the rule that the last 10% of work take the second 90% of time, some other questions have come up. If anyone wants to look at the code in question

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Ryan Newton
I don't know why Hoogle didn't find one of the packages. I've often wondered about this related question: * Is there a place to browse the union of all namespaces in all hackage packages? This would show the global Haskell/Hackage namespace as it currently stands and I think would be useful

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread wren ng thornton
On 12/12/11 9:32 AM, Ryan Newton wrote: I don't know why Hoogle didn't find one of the packages. I've often wondered about this related question: * Is there a place to browse the union of all namespaces in all hackage packages? There is, and it's awesome: http://folk.ntnu.no/hammar

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Alejandro Serrano Mena
You can try the Haskell Browser in the Eclipse plug-in. 2011/12/12 wren ng thornton w...@freegeek.org On 12/12/11 9:32 AM, Ryan Newton wrote: I don't know why Hoogle didn't find one of the packages. I've often wondered about this related question: * Is there a place to browse the union

Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Michael Craig
update was in May. Mike S Craig On Mon, Dec 12, 2011 at 3:45 PM, wren ng thornton w...@freegeek.org wrote: On 12/12/11 9:32 AM, Ryan Newton wrote: I don't know why Hoogle didn't find one of the packages. I've often wondered about this related question: * Is there a place to browse

Re: [Haskell-cafe] Haskellers.com polls (specifically, the mascot question)

2011-11-27 Thread Richard O'Keefe
On 25/11/2011, at 11:01 PM, Michael Snoyman wrote: Hi all, I've just added the polls feature to Haskellers.com, and created an initial poll about mascots[1]. Let me know if there are any issues. You must be logged in to submit an answer. I don't know how many opinions you'll lose from

Re: [Haskell-cafe] Haskellers.com polls (specifically, the mascot question)

2011-11-27 Thread Michael Snoyman
On Mon, Nov 28, 2011 at 7:41 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 28/11/2011, at 6:10 PM, Ivan Lazar Miljenovic wrote: You must be logged in to submit an answer. I don't know how many opinions you'll lose from that, but you'll certainly lose mine. Well, I thought that was part

[Haskell-cafe] Haskellers.com polls (specifically, the mascot question)

2011-11-25 Thread Michael Snoyman
Hi all, I've just added the polls feature to Haskellers.com, and created an initial poll about mascots[1]. Let me know if there are any issues. Michael PS: I've also added Google+ profile link support, just go to your edit profile page and paste in the link. [1]

Re: [Haskell-cafe] Haskellers.com polls (specifically, the mascot question)

2011-11-25 Thread Michael Snoyman
For everyone emailing about email verification not working: it's fixed now, the date on the server was incorrect, and therefore Amazon SES was rejecting the request. Side point: I'd recommend people start using BrowserID for login, it automatically verifies your email address for you. Michael

Re: [Haskell-cafe] Haskellers.com polls (specifically, the mascot question)

2011-11-25 Thread heathmatlock
Posted on reddit. http://redd.it/mpb54 On Fri, Nov 25, 2011 at 6:02 AM, Michael Snoyman mich...@snoyman.comwrote: For everyone emailing about email verification not working: it's fixed now, the date on the server was incorrect, and therefore Amazon SES was rejecting the request. Side point:

Re: [Haskell-cafe] Usage question with TemplateHaskell and Generic

2011-11-11 Thread Magicloud Magiclouds
2011/11/7 José Pedro Magalhães j...@cs.uu.nl: Hi, I'm not sure I understand your question. But if you mean that you want to retrieve the type variable names, as they were defined in the source, then I can tell you that the generic deriving mechanism cannot do this. Cheers, Pedro On Sun

Re: [Haskell-cafe] Usage question with TemplateHaskell and Generic

2011-11-07 Thread José Pedro Magalhães
Hi, I'm not sure I understand your question. But if you mean that you want to retrieve the type variable names, as they were defined in the source, then I can tell you that the generic deriving mechanism cannot do this. Cheers, Pedro On Sun, Nov 6, 2011 at 14:35, Magicloud Magiclouds

[Haskell-cafe] Usage question with TemplateHaskell and Generic

2011-11-06 Thread Magicloud Magiclouds
Hi, I'd like to simpler the work of deriving MyClass. And I have two ways to do: TemplateHaskell $(derivingMyClass), or Generic deriving (MyClass). Since I need to get the type name in the deriving, then I met this question: If I have data A b = C b, then with TemplateHaskell, the type would

[Haskell-cafe] Question on `runState'

2011-10-17 Thread Captain Freako
In this excerpt from the `StateArrow' page: runState :: Arrowhttp://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:Arrowa = StateArrowhttp://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-State.html#t:StateArrows a *e* b -

Re: [Haskell-cafe] Question on `runState'

2011-10-17 Thread Conrad Parker
On 17 October 2011 23:59, Captain Freako capn.fre...@gmail.com wrote: In this excerpt from the `StateArrow' page: runState :: Arrow a = StateArrow s a e b - a (e, s) (b, s)Source what's the significance of having written StateArrow s a e b, instead of StateArrow s a b c? In the context of

Re: [Haskell-cafe] Question on `runState'

2011-10-17 Thread David Fox
On Mon, Oct 17, 2011 at 5:32 PM, Conrad Parker con...@metadecks.org wrote: On 17 October 2011 23:59, Captain Freako capn.fre...@gmail.com wrote: In this excerpt from the `StateArrow' page: runState :: Arrow a = StateArrow s a e b - a (e, s) (b, s)Source what's the significance of having

Re: [Haskell-cafe] Question, re: using Automaton

2011-10-16 Thread Ertugrul Soeylemez
Captain Freako capn.fre...@gmail.com wrote: Encapsulating an automaton by running it on a stream of inputs, obtaining a stream of outputs. Typical usage in arrow notation: proc p - do ...*ys - (|runAutomaton (\x - ...)|) xs* Here xs refers to the input

Re: [Haskell-cafe] Question, re: using Automaton

2011-10-16 Thread Paterson, Ross
Captain Freako (quoting Control.Arrow.Transformer.Automaton): Encapsulating an automaton by running it on a stream of inputs, obtaining a stream of outputs. Typical usage in arrow notation: proc p - do ... ys - (|runAutomaton (\x - ...)|) xs Here

Re: [Haskell-cafe] A question about causality in FRP

2011-10-15 Thread Alan Jeffrey
One more thing... The function: return :: a - Beh a return x t = x fails to be causal when a is itself a behaviour, since it specializes to (after a bit of eta-conversion): return :: Beh a - Beh (Beh a) return b t u = b u which isn't causal. This rules out return, which in turn

[Haskell-cafe] Question, re: using Automaton

2011-10-15 Thread Captain Freako
Hi all, In this excerpt from the Automatonhttp://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-Automaton.html#t:Automatonpage: runAutomaton :: (ArrowLoopChttp://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:ArrowLoopa,

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread Ertugrul Soeylemez
David Barbour dmbarb...@gmail.com wrote: If you want first-class behaviors or behavior transformers, those will need a different abstraction than 'nested' behaviors. Nested != First Class. You'd have special functions to lift a first-class behavior as an argument (e.g. add a phantom type to

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread David Barbour
On Fri, Oct 14, 2011 at 1:31 AM, Ertugrul Soeylemez e...@ertes.de wrote: David Barbour dmbarb...@gmail.com wrote: If you want first-class behaviors or behavior transformers, those will need a different abstraction than 'nested' behaviors. Nested != First Class. You'd have special

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread Ertugrul Soeylemez
David Barbour dmbarb...@gmail.com wrote: The usual model for arrowized FRP is based on this type: newtype Auto a b = Auto (a - (b, Auto a b)) I would be very interested in how you would write an ArrowApply instance for such a type. So far my conclusion is: It's impossible.

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread Heinrich Apfelmus
David Barbour wrote: Alan Jeffrey wrote: A function (f : Beh A - Beh B) is causal whenever it respects =t, i.e. (forall t . a =t b = f a =t f b). Yes. Function outputs only depend on the past values of the input function. Your solutions for double and weird are accurate. Double is lifting

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread Alan Jeffrey
On 10/13/2011 10:43 PM, David Barbour wrote: On Thu, Oct 13, 2011 at 7:54 AM, Alan Jeffrey ajeff...@bell-labs.com mailto:ajeff...@bell-labs.com wrote: The `problem` such as it exists: you will be unable to causally construct the argument toith the `weird` function, except by modeling a

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread David Barbour
On Fri, Oct 14, 2011 at 3:07 AM, Ertugrul Soeylemez e...@ertes.de wrote: It's not about the laws, it's about losing state. I think you should not accumulate state; the abstraction gives me a fresh arrow each instant, conceptually and pragmatically. But it would not be difficult to create an

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread David Barbour
On Fri, Oct 14, 2011 at 7:27 AM, Alan Jeffrey ajeff...@bell-labs.comwrote: On 10/13/2011 10:43 PM, David Barbour wrote: On Thu, Oct 13, 2011 at 7:54 AM, Alan Jeffrey ajeff...@bell-labs.com mailto:ajeff...@bell-labs.com** wrote: The `problem` such as it exists: you will be unable to causally

Re: [Haskell-cafe] A question about causality in FRP

2011-10-14 Thread Alan Jeffrey
I should add that I have a pragmatic reason for asking about causality, which is that over at https://github.com/agda/agda-frp-js I have an implementation of FRP for Agda running in the browser using an Agda-to-JS back end I wrote. In that model, I can see how to implement deep causality, but

[Haskell-cafe] A question about causality in FRP

2011-10-13 Thread Alan Jeffrey
Hi everyone, Not sure this is the right venue, as this is a question about the semantics of FRP rather than Haskell... I have a question about the definition of causality for stream functions. A quick recap... Given a totally ordered set T (of times), the type of behaviours Beh A is defined

Re: [Haskell-cafe] A question about causality in FRP

2011-10-13 Thread David Barbour
On Thu, Oct 13, 2011 at 7:54 AM, Alan Jeffrey ajeff...@bell-labs.comwrote: A function (f : Beh A - Beh B) is causal whenever it respects =t, i.e. (forall t . a =t b = f a =t f b). Yes. Function outputs only depend on the past values of the input function. Your solutions for double and weird

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-10 Thread Christian Maeder
Am 08.10.2011 16:04, schrieb Captain Freako: Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError a parse p = runP p () what's the significance of `Identity t'? (`t' isn't used

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-10 Thread Benjamin Redelings
written in C++. Therefore, a certain amount of overhead seems tolerable. ) 2. Another question would be: most of the self-adjusting computation frameworks seem to assume that we always throw away the old computation. For function optimization (or, alternatively, Markov chain Monte Carlo

[Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Arnaud Bailly
Hello, I am trying to move a web application I wrote that initially used raw sockets for doing HTTP by hand to a more sensible Wai-based framework, and I am running into a design issue. I initially thought it would be a good idea to be able to support various I/O methods so I defined a layer

Re: [Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Antoine Latter
On Sun, Oct 9, 2011 at 3:57 PM, Arnaud Bailly arnaud.oq...@gmail.com wrote: Hello, I am trying to move a web application I wrote that initially used raw sockets for doing HTTP by hand to a more sensible Wai-based framework, and I am running into a design issue. I initially thought it would be

Re: [Haskell-cafe] Simple design question using Wai

2011-10-09 Thread Arnaud Bailly
Hi Antoine, Thanks for your interest. On Sun, Oct 9, 2011 at 11:57 PM, Antoine Latter aslat...@gmail.com wrote: interpret :: (CommandIO io, Map t) = Commands t io CommandResult What is the 'Commands' type? What is the 'Map' class? More details here :

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Heinrich Apfelmus
David Barbour wrote: Heinrich Apfelmus wrote: Even then, events and behaviors are one abstraction level too low. In my opinion, you are better off with a library/approach geared directly towards incremental computations. I believe behaviors are precisely the 'right' abstraction if the goal is

[Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Captain Freako
Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError aparse p = runP p () what's the significance of `Identity t'? (`t' isn't used anywhere.) Thanks, -db ___

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Jan-Willem Maessen
On Fri, Oct 7, 2011 at 2:46 PM, Brandon Moore brandon_m_mo...@yahoo.com wrote: Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps there is an implementation on Hackage or on his website. This stuff also goes by the moniker

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
If I have this right, Stream is a monad transformer. Stream s m t means that it parses 's', is stacked with monad 'm' and has a result of type 't' So Identity is a monad, the simplest monad, defined as such: newtype Indentity t = Identity { runIdentity :: t } It's the identity monad, that does

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
Wow... my bad. Stream is in no way a monad transformer. I really should read before speaking... Stream s m t is such as An instance of Stream has stream type s, underlying monad m and token type t determined by the stream (

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-07 Thread David Barbour
-Pull FRP). On Thu, Oct 6, 2011 at 2:55 PM, Benjamin Redelings I benjamin.redeli...@duke.edu wrote: Hi all, I'm not sure this is the right forum for this question. If so, please let me know where else might be more appropriate. My question is, roughly, is there already an existing

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-07 Thread Sean Leather
Hi Benjamin, My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? We at Utrecht have done some work on this: http://people.cs.uu.nl/andres/Incrementalization/ Simply put, if your computation is a fold/catamorphism, then you can easily take

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-07 Thread Heinrich Apfelmus
David Barbour wrote: Benjamin Redelings wrote: My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? Functional Reactive Programming can model this sort of 'change over time' incremental computation, but I doubt you'd get a performance benefit

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-07 Thread David Barbour
On Fri, Oct 7, 2011 at 3:17 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: FRP is somewhat orthogonal to incremental computation because FRP is focusing on expressiveness while incremental computation focuses on performance. You can formulate some incremental algorithms in terms of

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-07 Thread Brandon Moore
From: Peter Gammie pete...@gmail.com Oct 6. 2011 6:58 PM Ben, On 07/10/2011, at 8:55 AM, Benjamin Redelings I wrote: My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? Margnus Carlsson did something monadic several years ago

[Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-06 Thread Benjamin Redelings I
Hi all, I'm not sure this is the right forum for this question. If so, please let me know where else might be more appropriate. My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? That is, if I write a program using Haskell

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-06 Thread Peter Gammie
Ben, On 07/10/2011, at 8:55 AM, Benjamin Redelings I wrote: My question is, roughly, is there already an existing framework for incremental evaluation in Haskell? Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps

Re: [Haskell-cafe] Parsing binary data question

2011-09-28 Thread Eric Rasmussen
Hi Michael, I recommend Attoparsec when parsing raw data into custom data types. There aren't as many examples and tutorials as there are for Parsec, but the API is very similar, and some of the important differences are listed on Attoparsec's Hackage entry. There are also helpful examples of its

[Haskell-cafe] Parsing binary data question

2011-09-27 Thread Michael Oswald
Hello all, I am currently working on parser for some packets received via the network. The data structure currently is like that: data Value = ValUInt8 Int8 | ValUInt16 Int16 | ValUInt32 Int32 -- more datatypes data Parameter = Parameter { paramName ::

[Haskell-cafe] Question about type families

2011-09-13 Thread Grigory Sarnitskiy
Is there a way to make the following code working? {-# LANGUAGE TypeFamilies #-} data family Foo a data instance (Num a)= Foo a = A a deriving Show data instance (Fractional a) = Foo a = B a deriving Show I want to have different constructors for 'Foo a' depending on a class of 'a'.

Re: [Haskell-cafe] Question about type families

2011-09-13 Thread Gábor Lehel
On Tue, Sep 13, 2011 at 4:58 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote: Is there a way to make the following code working? {-# LANGUAGE TypeFamilies #-} data family Foo a data instance (Num a)        = Foo a = A a deriving Show data instance (Fractional a) = Foo a = B a deriving Show

Re: [Haskell-cafe] Question about type families

2011-09-13 Thread Gábor Lehel
On Tue, Sep 13, 2011 at 4:58 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote: Is there a way to make the following code working? {-# LANGUAGE TypeFamilies #-} data family Foo a data instance (Num a)        = Foo a = A a deriving Show data instance (Fractional a) = Foo a = B a deriving Show

Re: [Haskell-cafe] GHC API question

2011-08-30 Thread Christiaan Baaij
Hi, This is what I've was referring to in my previous mail. Even though you're compiling to machine code, you are using the in-memory linker (i.e., the GHCi linker). It seems like that this is a fundamental limitation of the internal linker. You may be using it in a way that doesn't trigger

Re: [Haskell-cafe] GHC API question

2011-08-29 Thread Albert Y. C. Lai
On 11-08-28 11:38 AM, Chris Smith wrote: Okay, I should have waited until morning to post this... so actually, things still work fine when I build without profiling. However, when I build with profiling, I get the segfault. I'm guessing either I need to set different dynamic flags with the

Re: [Haskell-cafe] GHC API question

2011-08-29 Thread Thomas Schilling
code, you are using the in-memory linker (i.e., the GHCi linker). It seems like that this is a fundamental limitation of the internal linker. You may be using it in a way that doesn't trigger the sanity check and end up causing a panic. I suggest you pose this question on the glasgow-haskell

Re: [Haskell-cafe] GHC API question

2011-08-28 Thread Chris Smith
Okay, I should have waited until morning to post this... so actually, things still work fine when I build without profiling. However, when I build with profiling, I get the segfault. I'm guessing either I need to set different dynamic flags with the profiling build to match the options of the

Re: [Haskell-cafe] GHC API question

2011-08-28 Thread Thomas Schilling
I don't think you can link GHCi with binaries compiled in profiling mode. You'll have to build an executable. On 28 August 2011 16:38, Chris Smith cdsm...@gmail.com wrote: Okay, I should have waited until morning to post this... so actually, things still work fine when I build without

Re: [Haskell-cafe] GHC API question

2011-08-28 Thread Chris Smith
On Sun, 2011-08-28 at 17:47 +0100, Thomas Schilling wrote: I don't think you can link GHCi with binaries compiled in profiling mode. You'll have to build an executable. Okay... sorry to be obtuse, but what exactly does this mean? I'm not using GHCi at all: I *am* in an executable built with

[Haskell-cafe] GHC API question

2011-08-27 Thread Chris Smith
I'm using the GHC API in GHC 7.2, and running into some problems. For background, I have working code that uses compileExpr to get a value from a dynamically loaded module. However, I'd like to do some profiling, and it appears that compileExpr doesn't work from executables that are built with

Re: [Haskell-cafe] Existential question

2011-08-25 Thread oleg
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 Well, if we eliminate the existential from data Kl i o = forall s. Kl s (i - s - (s, o)) following strictly the procedure we obtain data S i

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

<    1   2   3   4   5   6   7   8   9   10   >