Re: [Haskell-cafe] Another point-free question (=, join, ap)

2009-02-14 Thread Edsko de Vries
On Fri, Feb 13, 2009 at 05:21:50PM +0100, Thomas Davie wrote: Hey, Thanks for all the suggestions. I was hoping that there was some uniform pattern that would extend to n arguments (rather than having to use liftM2, litM3, etc. or have different 'application' operators in between

Re: [Haskell-cafe] Another point-free question (=, join, ap)

2009-02-14 Thread Edsko de Vries
Hi Conor, Will this do? http://www.haskell.org/haskellwiki/Idiom_brackets You get to write iI f a1 a2 a3 Ji for do x1 - a1 x2 - a2 x3 - a3 f a1 a2 a3 amongst other things... Cool :-) I had seen those idiom brackets before and put them on my mental

[Haskell-cafe] HaskellDB is alive?

2009-02-14 Thread Felipe Lessa
Hello! There was a new HaskellDB release, but I didn't see any announcement here. Is it back alive? What happened to 0.11? Thanks =) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] HaskellDB is alive?

2009-02-14 Thread Artyom Shalkhakov
Hello, 2009/2/14 Felipe Lessa felipe.le...@gmail.com: There was a new HaskellDB release, but I didn't see any announcement here. Is it back alive? What happened to 0.11? Well, HaskellDB HDBC backend got updated. HaskellDB itself lacks manpower, you can see it for yourself by browsing it's

[Haskell-cafe] Re: Class Instances

2009-02-14 Thread Cetin Sert
Thank you Benedikt! Thanks to your help I also figured out the way to do it using type families yesterday: class Pro p where type I p type O p re :: p → [I p → O p] instance Pro (b → c) where type I (b → c) = b type O (b → c) = c re = repeat instance Pro [b → c] where

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-14 Thread John A. De Goes
On Feb 13, 2009, at 6:31 PM, Krzysztof Skrzętnicki wrote: On Fri, Feb 13, 2009 at 22:37, John A. De Goes j...@n-brain.net wrote: On Feb 13, 2009, at 2:11 PM, Jonathan Cast wrote: The compiler should fail when you tell it two mutually contradictory things, and only when you tell it two

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-14 Thread John A. De Goes
Take, for example, this function: f :: [Char] - Char f [] = chr 0 f (c:cs) = chr (ord c + ord (f cs)) [] is typed as [Char], even though it could be typed in infinitely many other ways. Demonstrating yet again, that the compiler *does* use the additional information that it gathers to

Re: [Haskell-cafe] IO semantics and evaluation - summary

2009-02-14 Thread Stuart Cook
From Fixing Haskell IO: We can summarize the SDIOH (Standard Definition of IO in Haskell) as a value of type IO a is a value, that performs, then delivers a value of type a. I think you've already made a critical mistake here. The quotes you give all describe an IO value as something that when

Re: [Haskell-cafe] Graph library, was: Haskell.org GSoC

2009-02-14 Thread Brent Yorgey
On Thu, Feb 12, 2009 at 04:10:21PM +0100, Wolfgang Jeltsch wrote: Am Donnerstag, 12. Februar 2009 15:34 schrieb Thomas DuBuisson: Daniel Kraft asked: That sounds interesting... What do you mean by no canonical library? Are there already ones but just no standard one? But in this case,

[Haskell-cafe] ANNOUNCE: first Grapefruit release

2009-02-14 Thread Wolfgang Jeltsch
Dear friends of Haskell and Functional Reactive Programming, its my pleasure to announce the first official release of Grapefruit, a library for Functional Reactive Programming (FRP) with a focus on user interfaces. With Grapefruit, you can implement reactive and interactive systems in a

[Haskell-cafe] Re: [Haskell-beginners] Re: permuting a list

2009-02-14 Thread Daniel Fischer
Am Samstag, 14. Februar 2009 16:37 schrieb Heinrich Apfelmus: That of course begs the question whether there is a faster but purely No, it didn't beg any question. (Sorry for being a humourless pedant here) functional algorithm for generating random permutations without indexes and arrays?

Re: [Haskell-cafe] Haddock Markup

2009-02-14 Thread Wolfgang Jeltsch
Am Freitag, 13. Februar 2009 01:30 schrieben Sie: On 12 Feb 2009, at 8:48 pm, Wolfgang Jeltsch wrote: I don’t understand this. The way which works is conversion from MathML to TeX. So your suggestion would be to use MathML as the source language. But this is obviously not what you

Re: [Haskell-cafe] Graph library, was: Haskell.org GSoC

2009-02-14 Thread Wolfgang Jeltsch
Am Samstag, 14. Februar 2009 16:59 schrieb Brent Yorgey: On Thu, Feb 12, 2009 at 04:10:21PM +0100, Wolfgang Jeltsch wrote: Am Donnerstag, 12. Februar 2009 15:34 schrieb Thomas DuBuisson: Get a community.haskell.org account once you are ready to start a repo, it can not only host your repo

Re: [Haskell-cafe] IO semantics and evaluation - summary

2009-02-14 Thread Gregg Reynolds
On Sat, Feb 14, 2009 at 9:15 AM, Stuart Cook sco...@gmail.com wrote: From Fixing Haskell IO: We can summarize the SDIOH (Standard Definition of IO in Haskell) as a value of type IO a is a value, that performs, then delivers a value of type a. I think you've already made a critical

Re: [Haskell-cafe] Possible bug?

2009-02-14 Thread Wolfgang Jeltsch
Am Freitag, 13. Februar 2009 17:16 schrieb Peter Verswyvelen: Can all functional dependencies be completely replaced with associated types when using GHC 6.10.1? It might be possible as long as you don’t use overlapping instances. With overlapping instances, it’s typically not possible since

Re: [Haskell-cafe] Re: space leak with 'concat' ?

2009-02-14 Thread Peter Verswyvelen
it was on MS.NET 3.5 now the problem was the following the problematic object encapsulated a running timer. on each tick of the timer, I added an occurrence to a stream this stream was used in another thread, but the stream itself had no backpointer to the object that generated it so the object

Re: [Haskell-cafe] HaskellDB is alive?

2009-02-14 Thread Don Stewart
felipe.lessa: Hello! There was a new HaskellDB release, but I didn't see any announcement here. Is it back alive? What happened to 0.11? Thanks =) http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskelldb-0.12 ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-14 Thread Tillmann Rendel
John A. De Goes wrote: Take, for example, this function: f :: [Char] - Char f [] = chr 0 f (c:cs) = chr (ord c + ord (f cs)) [] is typed as [Char], even though it could be typed in infinitely many other ways. Demonstrating yet again, that the compiler *does* use the additional

Re: [Haskell-cafe] Graph library, was: Haskell.org GSoC

2009-02-14 Thread Don Stewart
g9ks157k: Am Samstag, 14. Februar 2009 16:59 schrieb Brent Yorgey: On Thu, Feb 12, 2009 at 04:10:21PM +0100, Wolfgang Jeltsch wrote: Am Donnerstag, 12. Februar 2009 15:34 schrieb Thomas DuBuisson: Get a community.haskell.org account once you are ready to start a repo, it can not only

Re: [Haskell-cafe] Re: space leak with 'concat' ?

2009-02-14 Thread Felipe Lessa
On Sat, Feb 14, 2009 at 3:18 PM, Peter Verswyvelen bugf...@gmail.com wrote: Do you think this is something to report as a bug to Microsoft? But this is a bit off topic in Haskell Cafe :-) I don't know how MS treats bug reports, but if you can make a small test case, then you should. It would

Re: [Haskell-cafe] Race condition possible?

2009-02-14 Thread Paul Johnson
Peter Verswyvelen wrote: Consider the following code stamp v x = do t - getCurrentTime putMVar v (x,t) Is it possible - with GHC - that a thread switch happens after the t - getCurrentTime and the putMVar v (x,t)? If so, how would it be possible to make sure that the operation of

Re: [Haskell-cafe] Race condition possible?

2009-02-14 Thread Peter Verswyvelen
If you have two streams of time/value pairs - using MVars as write-once sampling variables - and both streams are fed from another thread (e.g. timers firing), and you want to merge these two streams into a single stream with monotonic time stamps, then you want to be able to check if at time t an

[Haskell-cafe] Confused by SYB example with zipping

2009-02-14 Thread Henry Laxen
Dear Group, When trying to run the example at: http://www.cs.vu.nl/boilerplate/testsuite/gzip/Main.hs ghc 6.10.1 says A pattern type signature cannot bind scoped type variables `a' unless the pattern has a rigid type context In the pattern: f :: a - a - a In the definition of

Re: [Haskell-cafe] Infinite types should be optionally allowed

2009-02-14 Thread Job Vranish
I'm pretty sure that the problem is decidable, at least with haskell 98 types (other type extensions may complicate things a bit). It ends up being a graph unification algorithm. I've tried some simple algorithms and they seem to work. What do you mean by the inference engine is only half of the

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-14 Thread Luke Palmer
On Sat, Feb 14, 2009 at 7:56 AM, John A. De Goes j...@n-brain.net wrote: Don't overlook the advantages of using familiar operators and names: you have some intuition about '+' and 'map', so if you see them, then you'll have some idea what they do (assuming the author is neither stupid nor

Re: [Haskell-cafe] ANNOUNCE: first Grapefruit release

2009-02-14 Thread Roman Cheplyaka
* Wolfgang Jeltsch g9ks1...@acme.softbase.org [2009-02-14 17:19:09+0100] Dear friends of Haskell and Functional Reactive Programming, its my pleasure to announce the first official release of Grapefruit, a library for Functional Reactive Programming (FRP) with a focus on user interfaces.

Re: [Haskell-cafe] Possible bug?

2009-02-14 Thread Ryan Ingram
2009/2/13 Peter Verswyvelen bugf...@gmail.com: No the error I got was Could not deduce (Controller m v c) from the context (Controller m v c2) arising from a use of `MVC' at NM8\GUI\PanZoom.hs:126:32-65 Possible fix: add (Controller m v c) to the context of the constructor

[Haskell-cafe] ANNOUNCE: haha-0.1 - Animated ascii lambda

2009-02-14 Thread Sebastiaan Visser
Always wanted to have an full-color rotating vector based ascii art lambda on your terminal? This is your chance, installing `haha' will do the trick! This is very minimal vector based ascii art library written just for fun. There is a sample program called `rotating-lambda' which does

Re: [Haskell-cafe] Possible bug?

2009-02-14 Thread Peter Verswyvelen
Thanks Ryan. I'm always struggling with functional dependencies since to be honest - I don't really understand how the type inferer figures out all the types and I didn't take the time to study it yet. Your email will help me a bit further with this. My functional dependency was c - m v. It can't

[Haskell-cafe] Amazing

2009-02-14 Thread Peter Verswyvelen
One of the things I liked a lot when working with C# was that as soon as my code compiled, it usually worked after an iteration of two.At least if we forget about the nasty imperative debugging that is needed after a while because of unanticipated and unchecked runtime side effects. After heaving

[Haskell-cafe] Re: permuting a list

2009-02-14 Thread Henning Thielemann
On Sat, 14 Feb 2009, Daniel Fischer wrote: Am Samstag, 14. Februar 2009 16:37 schrieb Heinrich Apfelmus: For the full exposition, see http://apfelmus.nfshost.com/random-permutations.html Excellent work, thanks. Interesting read. Btw. a further development of the PFP library is also

Re: [Haskell-cafe] Amazing

2009-02-14 Thread John Meacham
On Sun, Feb 15, 2009 at 12:51:38AM +0100, Peter Verswyvelen wrote: However, it is just amazing that whenever my Haskell program compiles (which to be fair can take a while for an average Haskeller like me ;-), it just... works! I have heard rumors that this was the case, but I can really

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Rick R
I have been learning Haskell for the last two weeks and was relaying that exact benefit to my friend in attempts to convert him. I spend 3 hours getting a few functions to compile, but when they do, they just work. Every time. 2009/2/14 Peter Verswyvelen bugf...@gmail.com One of the things I

[Haskell-cafe] Re: Iteratee-based IO and lightweight monadic regions in the wild

2009-02-14 Thread Ben Franksen
Artyom Shalkhakov wrote: Is anybody planning to use these shiny new ways for doing IO? Interesting that you ask. I am currently using the 'lightweight monadic region' approach to manage network resources (so called 'channels', connections to a named variable; the context is Haskell support for a

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Felipe Lessa
As this topic popped out, my secrets for programming in Haskell are three words: assert, HUnit, QuickCheck. - Create internal functions that verify the results of the exported ones, or maybe an easier to verify implementation that is slower, and put them on assert's. This has saved me a few

Re: [Haskell-cafe] ANNOUNCE: haha-0.1 - Animated ascii lambda

2009-02-14 Thread Don Stewart
sfvisser: Always wanted to have an full-color rotating vector based ascii art lambda on your terminal? This is your chance, installing `haha' will do the trick! This is very minimal vector based ascii art library written just for fun. There is a sample program called `rotating-lambda' which

Re: [Haskell-cafe] Race condition possible?

2009-02-14 Thread Bryan O'Sullivan
2009/2/14 Peter Verswyvelen bugf...@gmail.com If you have two streams of time/value pairs - using MVars as write-once sampling variables - and both streams are fed from another thread (e.g. timers firing), and you want to merge these two streams into a single stream with monotonic time

Re: [Haskell-cafe] Re: Can this be done?

2009-02-14 Thread wren ng thornton
Chung-chieh Shan wrote: wren ng thornton wrote: It's ugly, but one option is to just reify your continuations as an ADT, where there are constructors for each function and fields for each variable that needs closing over. Serializing that ADT should be simple (unless some of those

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Sebastian Sylvan
2009/2/14 Peter Verswyvelen bugf...@gmail.com One of the things I liked a lot when working with C# was that as soon as my code compiled, it usually worked after an iteration of two.At least if we forget about the nasty imperative debugging that is needed after a while because of unanticipated

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Jeremy Shaw
At Sun, 15 Feb 2009 05:37:12 +, Sebastian Sylvan wrote: So my conclusion is that it's not just static typing, it's functional programming in conjunction with static strong type checking. Indeed. For example, it's pretty hard to accidentally use an 'uninitialized variable' in Haskell,

Re: [Haskell-cafe] Re: Overloading functions based on arguments?

2009-02-14 Thread wren ng thornton
John A. De Goes wrote: On Feb 13, 2009, at 2:11 PM, Jonathan Cast wrote: The compiler should fail when you tell it two mutually contradictory things, and only when you tell it two mutually contradictory things. By definition, it's not a contradiction when the symbol is unambiguously

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Michael D. Adams
2009/2/15 Sebastian Sylvan syl...@student.chalmers.se: 2009/2/14 Peter Verswyvelen bugf...@gmail.com One of the things I liked a lot when working with C# was that as soon as my code compiled, it usually worked after an iteration of two.At least if we forget about the nasty imperative debugging

Re: [Haskell-cafe] Amazing

2009-02-14 Thread Artyom Shalkhakov
Hello, 2009/2/15 Michael D. Adams mdmko...@gmail.com: Has anyone seen any real studies of this phenomenon? There is plenty of anecdotal evidence that Haskell is doing something right to reduce the bugs Let's just call it a miracle of FP, write many books and articles on the matter (i.e.,