[Haskell-cafe] TFM09: Last CFP (FMWeek, Eindhoven, November 6th 2009)

2009-05-18 Thread J.N. Oliveira
TFM2009 2nd Int. FME Conference on Teaching Formal Methods Widening Access to Formal Methods Friday, November 6th 2009, co-located with FM2009 : 16th International Symposium

[Haskell-cafe] community.haskell.org and code.haskell.org problems

2009-05-18 Thread Neil Mitchell
Hi, I regularly (almost daily) have problems reaching both community and code.haskell.org, getting 500 server error messages. I've decided to make all my Haskell code available on community, which means that when it goes down, I can't access my repos - which is not great. Is there a reason for

Re: [Haskell-cafe] Free theorems for dependent types?

2009-05-18 Thread Conor McBride
Hi Questions of parametricity in dependent types are made more complex by the way in which the Pi-type (x : S) - T corresponds to universal quantification. It's good to think of this type as a very large product, tupling up individual T's for each possible x you can distinguish by

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Neil Brown
Michael P Mossey wrote: I've got one of those algorithms which threatens to march off the right edge (in the words of Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So I presume I need StateT or MaybeT. However, I'm still (slowly) learning about

[Haskell-cafe] community.haskell.org and code.haskell.org problems

2009-05-18 Thread Neil Mitchell
Hi, I regularly (almost daily) have problems reaching both community and code.haskell.org, getting 500 server error messages. I've decided to make all my Haskell code available on community, which means that when it goes down, I can't access my repos - which is not great. Is there a reason for

Re: [Haskell-cafe] ghc ./configure stalls on docbook DTD

2009-05-18 Thread Simon Marlow
On 13/05/2009 19:53, Donnie Jones wrote: Hello Dan, Best place to ask is glasgow-haskell-us...@haskell.org since that is the GHC users list. I have CC'd your email to the GHC user list. Cheers. -- Donnie Jones On Wed, May 13, 2009 at 1:35 PM, Dandanielkc...@gmail.com wrote: Hi, Not sure if

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Claus Reinke
I've got one of those algorithms which threatens to march off the right edge (in the words of Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So I presume I need StateT or MaybeT. However, I'm still (slowly) learning about monads from first

Re: [Haskell-cafe] Haskell philosophy question

2009-05-18 Thread Henning Thielemann
Vasili I. Galchin schrieb: Hello, I am confused between Haskell as delineated in the Haskell Report VS ghc pragmas which extend Haskell beyond the Haskell Report. I am sure I am not the first to ask. Caveat: on my part, I am not against innovation/extensions, but I don't like to see

[Haskell-cafe] Re: The HP and PackedString

2009-05-18 Thread Simon Marlow
On 13/05/2009 13:07, Duncan Coutts wrote: On Wed, 2009-05-13 at 15:37 +0400, Bulat Ziganshin wrote: Hello Duncan, Wednesday, May 13, 2009, 3:33:13 PM, you wrote: I think it should remain deprecated and we should work on the replacement so that TH can switch its dependency. TH isn't

[Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Kenneth Hoste
Hello, For a while now, I've been trying to come up with a fast Haskell-only function which implements Euclidean distance in n-dimensional space. So far, I've been disappointed by the performance of my best effort in Haskell, compared to C. I'm hoping some of the Haskell experts and/or

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
My current best try uses the uvector package, has two 'vectors' of type (UArr Double) as input, and relies on the sumU and zipWithU functions which use streaming to compute the result: dist_fast :: UArr Double - UArr Double - Double dist_fast p1 p2 = sumDs `seq` sqrt sumDs where

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Don Stewart
kenneth.hoste: Hello, For a while now, I've been trying to come up with a fast Haskell-only function which implements Euclidean distance in n-dimensional space. So far, I've been disappointed by the performance of my best effort in Haskell, compared to C. I'm hoping some of the Haskell

[Haskell-cafe] Trying to Express Constraints using a data structure

2009-05-18 Thread GüŸnther Schmidt
Hi all, I'm trying to express a constraint using a data structure. Let's say I'd want to express a mapping of a to b, c to b, d to b and e to f. A mapping can also be from a to a, b to b and so on. The constraint is that one cannot map a to b if b was already mapped to let's say c. I'd

[Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread John Van Enk
Hi all, I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at the end of June. I need a 3 to 4 slide introduction to Haskell. What suggestions does the community have? Is such a short intro possible? It just needs to introduce the basics so I can show some code without

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Eugene Kirpichov
Just please don't show them qsort and fibonacci! 2009/5/18 John Van Enk vane...@gmail.com: Hi all, I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at the end of June. I need a 3 to 4 slide introduction to Haskell. What suggestions does the community have? Is such a

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Don Stewart
vanenkj: Hi all, I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at the end of June. I need a 3 to 4 slide introduction to Haskell. What suggestions does the community have? Is such a short intro possible? It just needs to introduce the basics so I can show

[Haskell-cafe] de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C)

2009-05-18 Thread Sam Martin
Hi Don (and cafe), Given the example you just posted, is there a simple way to generate the de-sugared haskell / core / STG / labelled-assembly versions of a piece of haskell code? For instance, how did you generate the content below? I guess this is the core language version? I'm a C/C++

Re: [Haskell-cafe] de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C)

2009-05-18 Thread Eugene Kirpichov
That's the output of ghc -ddump-simpl. 2009/5/18 Sam Martin sam.mar...@geomerics.com: Hi Don (and cafe), Given the example you just posted, is there a simple way to generate the de-sugared haskell / core / STG / labelled-assembly versions of a piece of haskell code? For instance, how did you

[Haskell-cafe] Re: de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C)

2009-05-18 Thread Don Stewart
Yes, I use the ghc-core tool: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ghc-core sam.martin: Hi Don (and cafe), Given the example you just posted, is there a simple way to generate the de-sugared haskell / core / STG / labelled-assembly versions of a piece of haskell

[Haskell-cafe] RE: de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C)

2009-05-18 Thread Sam Martin
Brilliant! Thanks. -Original Message- From: Don Stewart [mailto:d...@galois.com] Sent: Mon 18/05/2009 16:21 To: Sam Martin Cc: Kenneth Hoste; Haskell Cafe mailing list Subject: Re: de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C) Yes, I use the ghc-core tool:

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
dist_fast :: UArr Double - UArr Double - Double dist_fast p1 p2 = sumDs `seq` sqrt sumDs where sumDs = sumU ds ds= zipWithU euclidean p1 p2 euclidean x y = d*d where

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread David Leimbach
Use an incredibly small font. On Mon, May 18, 2009 at 8:16 AM, John Van Enk vane...@gmail.com wrote: Hi all, I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at the end of June. I need a 3 to 4 slide introduction to Haskell. What suggestions does the community have?

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Don Stewart
claus.reinke: dist_fast :: UArr Double - UArr Double - Double dist_fast p1 p2 = sumDs `seq` sqrt sumDs where sumDs = sumU ds ds= zipWithU euclidean p1 p2 euclidean x y = d*d where

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Donnie Jones
Use an incredibly small font AND Haskell FRP [1] to zoom and enlarge the font as you move your mouse over the text. ;) 1. http://en.wikipedia.org/wiki/Functional_reactive_programming -- Donnie Jones On Mon, May 18, 2009 at 10:56 AM, David Leimbach leim...@gmail.com wrote: Use an incredibly

Re: [Haskell-cafe] Trying to Express Constraints using a data structure

2009-05-18 Thread Steffen Schuldenzucker
On 16:25 Mon 18 May , Gü?nther Schmidt wrote: Hi all, I'm trying to express a constraint using a data structure. Let's say I'd want to express a mapping of a to b, c to b, d to b and e to f. A mapping can also be from a to a, b to b and so on. The constraint is that one cannot map a

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Joe Fredette
While an incredibly small font is a clever option, a more serious suggestion may be as follows. 3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest topics in haskell? I would think they would be: * Purity/Referential Transparency * Lazy Evaluation * Strong Typing + Type

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread John Van Enk
Thanks Joe, Your assumption is correct--the whole presentation will be longer. I wanted to use 3 or 4 slides to introduce the language and the balance for the interesting stuff. :P /jve PS to Joe: I will not forget to reply to all. I will not forget to reply to all. I will not forget to reply

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Andrew Wagner
Don't forget to include higher-order functions in one of those important points. On Mon, May 18, 2009 at 12:36 PM, John Van Enk vane...@gmail.com wrote: Thanks Joe, Your assumption is correct--the whole presentation will be longer. I wanted to use 3 or 4 slides to introduce the language and

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Eugene Kirpichov
Actually, I don't think it's a good idea to introduce monads on one of the 3-4 slides. While it *is* a core concept, it's not one of the advertising bullet points; and 1 slide is not enough to show what *use* monads are, let alone what they actually *are*. I'd probably suggest you to show

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-18 Thread Sven Panne
Am Sonntag, 17. Mai 2009 15:08:29 schrieb Don Stewart: Sven.Panne: [...] I think most problems can be fixed in a rather pragmatic way by adding a few functions to the binary package: [...] Patches are welcome. Attached. A few remarks: * This is only a quick and mildly tested

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Ryan Ingram
On Mon, May 18, 2009 at 3:08 AM, Neil Brown nc...@kent.ac.uk wrote: With ErrorT you can use throwError when you want to break out of the block and give back an error, which seems to fit what you were doing. Of course, now that you are using throwError, you can remove a lot of the extra

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Claus Reinke
I've got one of those algorithms which threatens to march off the right edge (in the words of Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So I presume I need StateT or MaybeT. However, I'm still (sdlowly) learning about monads from first

[Haskell-cafe] ANN: Hieroglyph-2.21 and buster, buster-gtk, and buster-network-2.0

2009-05-18 Thread Jeff Heard
Tons of relevant changes. Almost too many to count... Buster: - Fixed performance and bugs in buster, - split out buster, buster-network, and buster-gtk to make it easier to only build components of the system. - Added new functions in buster for selection and debugging. - Added behaviours in

[Haskell-cafe] Re: [Haskell] [ANN] Safe Lazy IO in Haskell

2009-05-18 Thread Nicolas Pouillard
Excerpts from Jason Dusek's message of Sun May 17 15:45:25 +0200 2009: From the documentation: LI could be a strict monad and a strict applicative functor. However it is not a lazy monad nor a lazy applicative functor as required Haskell. Hopefully it is a lazy (pointed)

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Joe Fredette
Well, since the topic was EDSLs, and those generally involve monads (at least from what I've seen), it might be wise to touch on them. However, perhaps the fourth slide would just be a catchall? HOFs, some STM/Monad stuff, etc? The topics I suggested just seem to me to be the 4 core concepts

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Miguel Mitrofanov
On 18 May 2009, at 20:29, Joe Fredette wrote: While an incredibly small font is a clever option, a more serious suggestion may be as follows. 3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest topics in haskell? I would think they would be: * Purity/Referential

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Don Stewart
jfredett: While an incredibly small font is a clever option, a more serious suggestion may be as follows. 3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest topics in haskell? I would think they would be: * Purity/Referential Transparency * Lazy Evaluation *

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Don Stewart
ekirpichov: Actually, I don't think it's a good idea to introduce monads on one of the 3-4 slides. While it *is* a core concept, it's not one of the advertising bullet points; and 1 slide is not enough to show what *use* monads are, let alone what they actually *are*. I'd probably suggest

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Adam Turoff
On Mon, May 18, 2009 at 2:06 PM, Don Stewart d...@galois.com wrote: Exactly: focus on what the user wants to do (e.g. write multicore code, write safe code, write code quickly), not how that is achieved: bounded parametric polymorphism or monads Parametric polymorphism is a big win, and

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Don Stewart
adam.turoff: On Mon, May 18, 2009 at 2:06 PM, Don Stewart d...@galois.com wrote: Exactly: focus on what the user wants to do (e.g. write multicore code, write safe code, write code quickly), not how that is achieved: bounded parametric polymorphism or monads Parametric polymorphism is a

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Eugene Kirpichov
The main bullet point is missing: Correctness. How could we have forgotten quickcheck? quickCheck (\xs - sort (sort xs) == sort xs) OK, 100 tests passed. 2009/5/18 Don Stewart d...@galois.com: adam.turoff: On Mon, May 18, 2009 at 2:06 PM, Don Stewart d...@galois.com wrote: Exactly: focus

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
Once I actually add a 'dist_fast_inline_caller', that indirection disappears in the inlined code, just as it does for dist_fast itself. dist_fast_inlined_caller :: UArr Double - UArr Double - Bool dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2 2 However, in the simpl output

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Don Stewart
claus.reinke: Once I actually add a 'dist_fast_inline_caller', that indirection disappears in the inlined code, just as it does for dist_fast itself. dist_fast_inlined_caller :: UArr Double - UArr Double - Bool dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2 2 However, in

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
As I said, I don't get the fusion if I just add the function above to the original Dist.hs, export it and compile the module with '-c -O2 -ddump-simpl': I can't reproduce this. Interesting. I'm using ghc 6.11.20090320 (windows), uvector-0.1.0.3. I attach the modified Dist.hs and its simpl

Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-18 Thread Ryan Ingram
On Mon, May 18, 2009 at 11:33 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: The main bullet point is missing: Correctness. How could we have forgotten quickcheck? quickCheck (\xs - sort (sort xs) == sort xs) OK, 100 tests passed. I like this, but given that you have a whole slide, I

[Haskell-cafe] Re: [Haskell] [ANN] Safe Lazy IO in Haskell

2009-05-18 Thread Taral
On Mon, May 18, 2009 at 10:30 AM, Nicolas Pouillard nicolas.pouill...@gmail.com wrote: The type I would need for bind is this one:  (=) :: NFData sa = LI sa - (sa - LI b) - LI b Will this do? (=) :: (NFData sa, NFData b) = LI sa - (sa - LI b) - LI b -- Taral tar...@gmail.com Please let me

[Haskell-cafe] old Hugs libraries?

2009-05-18 Thread Vasili I. Galchin
Hello, Do newSTArray, readSTArray, writeSTArray, etc. belong to an old deprecated Hugs library/module? If so, what is the Haskell 98 replacement? Thanks, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] showing a user defined type

2009-05-18 Thread michael rice
I've been playing around with The Little MLer (pg. 95, 96) to try to improve my understanding of types. I can ask ML:   - ints(0); val it = Link (1,fn) : chain - and Haskell: *Main :t ints 0 ints 0 :: Chain *Main ints 0 interactive:1:0:     No instance for (Show Chain)   arising from a

[Haskell-cafe] showing a user defined type

2009-05-18 Thread michael rice
I've been playing around with The Little MLer (pg. 95, 96) to try to improve my understanding of types. I can ask ML:   - ints(0); val it = Link (1,fn) : chain - and Haskell: *Main :t ints 0 ints 0 :: Chain *Main ints 0 interactive:1:0:     No instance for (Show Chain)   arising from a

Re: [Haskell-cafe] old Hugs libraries?

2009-05-18 Thread Brandon S. Allbery KF8NH
On May 18, 2009, at 18:34 , Vasili I. Galchin wrote: Do newSTArray, readSTArray, writeSTArray, etc. belong to an old deprecated Hugs library/module? If so, what is the Haskell 98 replacement? My understanding is they should be in the provided STArray module. -- brandon s. allbery

Re: [Haskell-cafe] showing a user defined type

2009-05-18 Thread Brandon S. Allbery KF8NH
On May 18, 2009, at 21:19 , michael rice wrote: *Main :t ints 0 ints 0 :: Chain *Main ints 0 interactive:1:0: No instance for (Show Chain) In general, you want to append deriving Show to your types. You may also want to be able to input them in ghci, so instead say

Re: [Haskell-cafe] showing a user defined type

2009-05-18 Thread Ryan Ingram
Unfortunately, you can't derive Show on Chain as defined, because it contains a function: data Chain = Link Int (Int - Chain) You can write this: instance Show Chain where show (Link n _) = Link ++ show n ++ fn Or you can make a dummy Show instance for functions: instance Show (a -

Re: [Haskell-cafe] showing a user defined type

2009-05-18 Thread David Menendez
On Mon, May 18, 2009 at 10:02 PM, Ryan Ingram ryani.s...@gmail.com wrote: Unfortunately, you can't derive Show on Chain as defined, because it contains a function: Sure you can. I just tried the following, and it compiled without complaints. import Text.Show.Functions data Chain = Link Int

Re: [Haskell-cafe] old Hugs libraries?

2009-05-18 Thread David Menendez
On Mon, May 18, 2009 at 6:34 PM, Vasili I. Galchin vigalc...@gmail.com wrote: Hello,   Do newSTArray, readSTArray, writeSTArray, etc. belong to an old deprecated Hugs library/module? If so, what is the Haskell 98 replacement? I don't know about Haskell 98, but I think the modern solution

RE: [Haskell-cafe] Request for feedback: HaskellDB + HList

2009-05-18 Thread Brian Bloniarz
_ Insert movie times and more without leaving Hotmail®. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009___ Haskell-Cafe mailing list

Re: [Haskell-cafe] old Hugs libraries?

2009-05-18 Thread Vasili I. Galchin
thank to all respondents! Vasili On Mon, May 18, 2009 at 9:41 PM, David Menendez d...@zednenem.com wrote: On Mon, May 18, 2009 at 6:34 PM, Vasili I. Galchin vigalc...@gmail.com wrote: Hello, Do newSTArray, readSTArray, writeSTArray, etc. belong to an old deprecated Hugs

[Haskell-cafe] Lawvere papers

2009-05-18 Thread Vasili I. Galchin
Hello, I know that some Lawvere papers are available on TAC, but is there a list of all Lawvere papers online and where? Kind regards, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: [Haskell] [ANN] Safe Lazy IO in Haskell

2009-05-18 Thread Ryan Ingram
On Mon, May 18, 2009 at 3:05 PM, Taral tar...@gmail.com wrote: Will this do? (=) :: (NFData sa, NFData b) = LI sa - (sa - LI b) - LI b No, the problem is that = on monads has no constraints, it must have the type LI a - (a - LI b) - LI b This is a common problem with trying to use

[Haskell-cafe] How to use Data.ByteString ?

2009-05-18 Thread z_axis
Hi, friends the following function works well rollDice n = getStdRandom (randomR (1,n)) :: IO Int now i want to use /dev/random to produce better random number, but it doesnot work rollDice_t n = do hd - openFile /dev/random ReadMode v - B.hGet hd 1 return (v `mod` n) + 1 No

Re: [Haskell-cafe] How to use Data.ByteString ?

2009-05-18 Thread Brandon S. Allbery KF8NH
On May 19, 2009, at 01:07 , z_axis wrote: rollDice_t n = do hd - openFile /dev/random ReadMode v - B.hGet hd 1 return (v `mod` n) + 1 No instance for (Integral B.ByteString) You can't just read a binary string and have it interpreted as a number; you want to use Data.Binary to

Re: [Haskell-cafe] How to use Data.ByteString ?

2009-05-18 Thread Thomas DuBuisson
On Mon, May 18, 2009 at 10:13 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On May 19, 2009, at 01:07 , z_axis wrote: rollDice_t n = do     hd - openFile /dev/random ReadMode     v -  B.hGet hd 1     return (v `mod` n) + 1  No instance for (Integral B.ByteString) You can't just

Re: [Haskell-cafe] How to use Data.ByteString ?

2009-05-18 Thread Jason Dagit
On Mon, May 18, 2009 at 10:13 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On May 19, 2009, at 01:07 , z_axis wrote: rollDice_t n = do     hd - openFile /dev/random ReadMode     v -  B.hGet hd 1     return (v `mod` n) + 1  No instance for (Integral B.ByteString) You can't just