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] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Christian Maeder
Am 12.10.2011 16:02, schrieb Bas van Dijk: All your ByteString are belong to us... Hello, I'm pleased to announce the beta release of vector-bytestring. This library provides the type ByteString which is defined as a type synonym for a storable Vector of Word8s (from the vector package):

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Bas van Dijk
On 14 October 2011 12:58, Christian Maeder christian.mae...@dfki.de wrote: Would it not be simple to use a newtype for ByteString (rather than a synonym)? My vision for the future of bytestring and vector-bytestring is that they will be replaced by vector directly. This way users don't have to

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Ivan Lazar Miljenovic
On 14 October 2011 22:37, Bas van Dijk v.dijk@gmail.com wrote: On 14 October 2011 12:58, Christian Maeder christian.mae...@dfki.de wrote: Would it not be simple to use a newtype for ByteString (rather than a synonym)? If there's need for a specific Show instance for Vectors of Word8s we

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Max Rabkin
On Fri, Oct 14, 2011 at 13:45, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Though I would argue that unless you're trying to actually use for Show/Read for serialisation, does it really matter what the Show/Read instances for Bytestring are? Convenient debugging and REPL interaction

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Ertugrul Soeylemez
Max Rabkin max.rab...@gmail.com wrote: Though I would argue that unless you're trying to actually use for Show/Read for serialisation, does it really matter what the Show/Read instances for Bytestring are? Convenient debugging and REPL interaction certainly matter! On the other hand,

Re: [Haskell-cafe] [Haskell] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Bas van Dijk
On 14 October 2011 14:01, Ertugrul Soeylemez e...@ertes.de wrote: Is there any particular reason to prefer storable vectors instead of unboxed vectors?  The element type is fixed to Word8 anyway. To be able to safely interface with foreign libraries. Note that unboxed vectors are represented

[Haskell-cafe] lhs2tex-hl 1.4.3 released

2011-10-14 Thread Alessandro Vermeulen
Dear all, I've uploaded a new version of lhs2tex-hl [1] to hackage [2]. It includes: 1. It now builds on GHC 7.2.x 2. You can list the LaTeX commands you have to implement (with a default implementation) with lhs2TeX-hl --action=ListCommands 3. Binary operators should now be typeset correctly.

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] Lists concatenation being O(n)

2011-10-14 Thread Heinrich Apfelmus
Yves Parès wrote: I re-read recently a bit of RealWorldHaskell, and I saw something that puzzles me now that I have a better understanding of the language. It concerns the list concatenation being costful, and the need to use another type like DList. [] ++ ys = ys (x:xs) ++ ys = x : (xs ++

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Bas van Dijk
On 14 October 2011 13:37, Bas van Dijk v.dijk@gmail.com wrote: If there's need for a specific Show instance for Vectors of Word8s we can always add one directly to vector. (Roman, what are your thoughts on this?) Ok I have proposed and implemented this for vector:

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

[Haskell-cafe] hello Haskell

2011-10-14 Thread R J
hey Haskell this is sick http://www.bestsource10.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1

2011-10-14 Thread JP Moresmau
Hello list, I must be doing something stupid, but what? ghc --version The Glorious Glasgow Haskell Compilation System, version 7.2.1 ghc -E -optP-dM -cpp Main.hs (per http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html) {-# LINE 1 Main.hs #-} #define mingw32_HOST_OS 1

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Bas van Dijk
On 13 October 2011 20:53, Albert Y. C. Lai tre...@vex.net wrote: The number of new cons cells created in due course is Θ(length xs). I was actually surprised by this because I expected: length(xs++ys) to fuse into one efficient loop which doesn't create cons cells at all. Unfortunately, I was

Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1

2011-10-14 Thread Bas van Dijk
On 14 October 2011 16:47, JP Moresmau jpmores...@gmail.com wrote: I must be doing something stupid, but what? Nothing stupid, you're just misinterpreting the value of __GLASGOW_HASKELL__. See: http://www.haskell.org/ghc/docs/latest/html/users_guide/version-numbering.html for the correct

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Yves Parès
Wow, I don't get core haskell, but I get you point. It's indeed odd foldl' doesn't use foldr (and sum doesn't use foldl' instead of foldl as (+) is strict (*)) if foldr permits loop fusion. (*) Anyway, is there a place where foldl is preferable over foldl' ? Never happened to me, I always use

Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1

2011-10-14 Thread Daniel Fischer
On Friday 14 October 2011, 16:47:45, JP Moresmau wrote: Hello list, I must be doing something stupid, but what? ghc --version The Glorious Glasgow Haskell Compilation System, version 7.2.1 ghc -E -optP-dM -cpp Main.hs (per

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Bas van Dijk
2011/10/14 Yves Parès limestr...@gmail.com: (*) Anyway, is there a place where foldl is preferable over foldl' ? To quote http://www.haskell.org/haskellwiki/Foldr_Foldl_Foldl' : Usually the choice is between foldr and foldl', since foldl and foldl' are the same except for their strictness

Re: [Haskell-cafe] __GLASGOW_HASKELL__ macro in 7.2.1

2011-10-14 Thread JP Moresmau
Thank you both, I misread that page on the versions and didn't see the difference between minor version number and release number. So I can confirm, my 7.0.3 install gives me 700 and my 7.2.1 gives me 702. Everything is good. Thanks! JP On Fri, Oct 14, 2011 at 5:13 PM, Daniel Fischer

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Daniel Fischer
On Friday 14 October 2011, 16:55:14, Bas van Dijk wrote: On 13 October 2011 20:53, Albert Y. C. Lai tre...@vex.net wrote: The number of new cons cells created in due course is Θ(length xs). I was actually surprised by this because I expected: length(xs++ys) to fuse into one efficient loop

Re: [Haskell-cafe] Lists concatenation being O(n)

2011-10-14 Thread Daniel Fischer
On Friday 14 October 2011, 17:10:00, Yves Parès wrote: Wow, I don't get core haskell, but I get you point. It's indeed odd foldl' doesn't use foldr (and sum doesn't use foldl' instead of foldl as (+) is strict (*)) if foldr permits loop fusion. No, it's not odd. The fusion technology isn't yet

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] Cabal's dependence mechanism can be more available

2011-10-14 Thread Aur Saraf
That a package builds with a certain version of another package does not mean that the code is correct. I once had to maintain code that used CSV 0.0.0.1, and it turned out that in CSV-0.0.0.2 there wasn't a newline appended to the end of the string anymore (in the old version there was), so the

[Haskell-cafe] Implementing a New primop

2011-10-14 Thread Paul Monday
Alright, I wandered through some primtype issues, but I'm having another odd problem as I try to define my own primop. I've followed what the various wiki pages have to offer (primarily http://hackage.haskell.org/trac/ghc/wiki/AddingNewPrimitiveOperations and

Re: [Haskell-cafe] Implementing a New primop

2011-10-14 Thread Antoine Latter
Hi Paul, The ghc-users list might get you a quicker response to this sort of question. Maybe a good start would be to give us a listing of which files you've modified so far. Antoine On Fri, Oct 14, 2011 at 4:49 PM, Paul Monday paul.mon...@parsci.com wrote: Alright, I wandered through some

Re: [Haskell-cafe] Implementing a New primop

2011-10-14 Thread Paul Monday
I didn't know about glasgow-haskell-users, thanks! The files and their modifications are below, I was hoping this was going to be just a quick experiment (copying someone else's primop) … the web references identify only the two files to add an inline primop ...

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

Re: [Haskell-cafe] Implementing a New primop

2011-10-14 Thread Erik de Castro Lopo
Paul Monday wrote: I didn't know about glasgow-haskell-users, thanks! Actually the ghc-cvs list may be even better. Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/

Re: [Haskell-cafe] Implementing a New primop

2011-10-14 Thread Antoine Latter
Perhaps! I wasn't sure if it was too noisy to be noticed. On Oct 14, 2011 5:54 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Paul Monday wrote: I didn't know about glasgow-haskell-users, thanks! Actually the ghc-cvs list may be even better. Cheers, Erik --