Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread ok
On 18 Jul 2007, at 8:52 pm, Bjorn Bringert wrote: Well, the original poster wanted advice on how to improve his Haskell style, not algorithmic complexity. I think that the appropriate response to that is to show different ways to write the same program in idiomatic Haskell. (a) I gave some

Re: [Haskell-cafe] Stream processors as arrows

2007-07-18 Thread Matthew Brecknell
Miguel Mitrofanov, on 9 July [1]: > I'm trying to do Exercise 2.5.2 from John Hughes's "Programming with > Arrows". [...] Sorry for the delayed reply. I've only just started learning about arrow programming, and since no-one else has replied to you, here is what I've discovered so far... I think

Re: [Haskell-cafe] historical question about Haskell and Haskell Curry

2007-07-18 Thread Tim Chevalier
On 7/18/07, Michael Vanier <[EMAIL PROTECTED]> wrote: We always say that Haskell is named for Haskell Curry because his work provided the logical/computational foundations for the language. How exactly is this the case? Specifically, does anyone claim that Curry's combinatorial logic is more

Re: [Haskell-cafe] gui libs? no [...] - bug report

2007-07-18 Thread Marc Weber
Hi Claus Ising ghc-6.6 and Opera 9.20 i thought that everything would work until I tried the page in Firefox 2.0.0.1 Opera: Those maroon rectangles in all four corners appear, alse the text x/y: ... is shown when clicking. But the drawing doesn't appear, does'n show any errors within the Error Co

[Haskell-cafe] historical question about Haskell and Haskell Curry

2007-07-18 Thread Michael Vanier
We always say that Haskell is named for Haskell Curry because his work provided the logical/computational foundations for the language. How exactly is this the case? Specifically, does anyone claim that Curry's combinatorial logic is more relevant to the theoretical foundations of Haskell than

Re: [Haskell-cafe] gui libs? no thanks, i'm just browsing.. ;-)

2007-07-18 Thread Duncan Coutts
On Thu, 2007-07-19 at 00:12 +0100, Claus Reinke wrote: > gui libs are wonderful, but haskell sometimes has too few > and sometimes has too many. and those we have do not > work with every haskell implementation. and when they do > work (usually with ghc, these days), they need to be rebuilt > whe

[Haskell-cafe] gui libs? no thanks, i'm just browsing.. ;-)

2007-07-18 Thread Claus Reinke
gui libs are wonderful, but haskell sometimes has too few and sometimes has too many. and those we have do not work with every haskell implementation. and when they do work (usually with ghc, these days), they need to be rebuilt whenever ghc is updated, even if the gui lib hasn't changed at all

Re: [Haskell-cafe] Re: Practise fingerspelling with Haskell! (Code cleanup request)

2007-07-18 Thread Dougal Stanton
On 18/07/07, J. Garrett Morris <[EMAIL PROTECTED]> wrote: You're partway there - concatMap is flip (>>=), so you have the xs >>= (\x -> ) part. Ah, yes! I read about this equivalence in one of the other threads today but it didn't make any connection. Doh! I think I will have to, sooner or la

Re: [Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Asumu Takikawa
On 23:25 Wed 18 Jul , Andreas Marth wrote: > Thanks for again pointing out that I didn't want another way to get the > information, but I have to defend Simon. > [...] > 1) make the wiki search function return all documents containig the search > term (who can do that?) > 2) consider creating a

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Derek Elkins
On Wed, 2007-07-18 at 14:06 -0500, Antoine Latter wrote: > MediaWiki's search isn't fantastic - what I did was a google search on > "site:www.haskell.org DLL" > > It's not a very good answer, but it's the only answer I know. > In general I find Google's search to be more comprehensive and effect

Re: [Haskell-cafe] Re: Is this haskelly enough?

2007-07-18 Thread Daniel McAllansmith
On Wednesday 18 July 2007 21:16, Johan Tibell wrote: > It would be nice if it was possible to capture this kind of behavior in a > high order function just like map though. I guess the problem is that the > function to map will take different number of arguments depending on the > use case. > > loo

Re: [Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Andreas Marth
Thanks for again pointing out that I didn't want another way to get the information, but I have to defend Simon. His first response was a reworking of the wiki page for the haskell mailing lists. What led me to learning about gmain and its search function. So I added the hint that you can use gmain

Re: [Haskell-cafe] Producing MinimumValue

2007-07-18 Thread Joachim Breitner
Hi, Am Mittwoch, den 18.07.2007, 13:42 -0700 schrieb Alexteslin: > I am trying to define a function as part of the exercises that gives a > result of a minimum value of the input list of ints. Such as this: > > minimumValue :: [Int] -> Int > minimumValue ns ... > > using either filter or map fun

Re: [Haskell-cafe] Producing MinimumValue

2007-07-18 Thread Sebastian Sylvan
On 18/07/07, Alexteslin <[EMAIL PROTECTED]> wrote: Hello, I am trying to define a function as part of the exercises that gives a result of a minimum value of the input list of ints. Such as this: minimumValue :: [Int] -> Int minimumValue ns ... using either filter or map functions but Not fol

Re: [Haskell-cafe] Maintaining the community

2007-07-18 Thread Andrew Coppin
Bryan Burgers wrote: I heard that Fermat didn't even actually have a proof. That's unsubstantiated conjecture! :-P Oh, sure, it took over 300 years to arrive at the modern-day proof, which runs to over 400 pages of cutting-edge mathematics spanning multiple very modern disiplins, and is so d

Re: [Haskell-cafe] Re: Practise fingerspelling with Haskell! (Code cleanup request)

2007-07-18 Thread J. Garrett Morris
On 7/18/07, Dougal Stanton <[EMAIL PROTECTED]> wrote: I worked out that [ (a,b) | a <- as, b <- bs ] must be equivalent to > comp = concatMap (\x -> map ((,) x) ys) xs but I can't really say how conditions like "a /= b" get slotted in to that style. Is there a reference for that? As I underst

[Haskell-cafe] Producing MinimumValue

2007-07-18 Thread Alexteslin
Hello, I am trying to define a function as part of the exercises that gives a result of a minimum value of the input list of ints. Such as this: minimumValue :: [Int] -> Int minimumValue ns ... using either filter or map functions but Not foldr1, because the exercise precedes the section on fol

Re: [Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Steve Schafer
On Wed, 18 Jul 2007 13:00:20 -0700, you wrote: >You can even post via gmane. > >Tip: for more powerful searching, use Thunderbird + gmane's NNTP interface. I think people are missing the original poster's point. He's not looking for alternative ways to get from A to B; he's pointing out that a ty

Re: [Haskell-cafe] Re: Practise fingerspelling with Haskell! (Code cleanup request)

2007-07-18 Thread Dougal Stanton
On 18/07/07, apfelmus <[EMAIL PROTECTED]> wrote: I like it for its elegant point-free style :) Yes, well, I am rather enamoured of them! :-) Apparently, difference can only detect character replacements but not character insertion or deletion, but that's probably not your use case. Yes, th

[Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Simon Michael
You can even post via gmane. Tip: for more powerful searching, use Thunderbird + gmane's NNTP interface. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Using Haskell to investigate ML's value restriction

2007-07-18 Thread Brian Hulley
Hi, Ii is interesting that in ML, the presence of mutable ref cells and parametric polymorphism requires the whole language to be dominated by a "value restriction" [1] to ensure that the type system remains sound, whereas in Haskell, because IORef's can only be created (and used) in the IO mo

Re: [Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Andreas Marth
Now I learned that gmain has a niche interface that can search the mailing list & sort the results. :-) I changed the (read via gmain) into (read & search via gmain) for both links at that page. So one easily can see that he can search the archives via gmain. (I didn't know gmain at all, so had no

[Haskell-cafe] Re: Frustrating experience of a wannabe contributor

2007-07-18 Thread Simon Michael
Hi Andreas - very good problem report, thanks. I have just cleaned up the archive links at http://www.haskell.org/haskellwiki/Mailing_lists a bit. I added the ever-excellent gmane and an overview of all archives. I think some of the archive descriptive text is no longer needed, but I stopped h

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Antoine Latter
MediaWiki's search isn't fantastic - what I did was a google search on "site:www.haskell.org DLL" It's not a very good answer, but it's the only answer I know. On 7/18/07, Andreas Marth <[EMAIL PROTECTED]> wrote: - Original Message - From: "Antoine Latter" <[EMAIL PROTECTED]> To: Sent

Re[2]: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Bulat Ziganshin
Hello Andreas, Wednesday, July 18, 2007, 10:36:14 PM, you wrote: > I am not sure what you are refering to. i will go into Special pages -> All pages and not seeing any "dll" here, will go to ask in haskell-cafe/irc -- Best regards, Bulatmailto:[EMAIL PROTECTED] __

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Andreas Marth
- Original Message - From: "Antoine Latter" <[EMAIL PROTECTED]> To: Sent: Wednesday, July 18, 2007 8:26 PM Subject: Re: [Haskell-cafe] Frustrating experience of a wannabe contributor > The closest existing page I could find on the wiki was this one: > > http://www.haskell.org/haskellwik

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Andreas Marth
I am not sure what you are refering to. Are there any pages about DLLs that I didn't find? If so why couldn't I find them? Are you refering to wiki pages in general? I never said that there are no wiki pages. I just said that I couldn't find an appropriate place where I would post something about c

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Antoine Latter
The closest existing page I could find on the wiki was this one: http://www.haskell.org/haskellwiki/GHC/Using_the_FFI But it is a Wiki. If you were to just make a page and put it somewhere, I doubt anyone would get too mad. On 7/18/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: Hello Andreas,

Re: [Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Bulat Ziganshin
Hello Andreas, Wednesday, July 18, 2007, 8:17:38 PM, you wrote: > So I tried to find a place where it might have posted or at least fit into. there is a full list of wiki pages -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: Re[2]: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread J. Garrett Morris
This is probably just me, but I've always mentally separated the list monad (representing choice) from operations on ordered sets implemented by lists (which don't always have to represent choice). In this case, since the remainder of the code wasn't monadic, I find it much easier to understand wh

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Dan Weston
> Btw, if you don't want the empty lists, you can use > > concatMap (init . tails) . tail . inits Would it not be more efficient and perspicuous to keep the sublists definition as is, just interchanging inits and tails? where sublists = filter (not . null) . concatMap tails . inits Or a

[Haskell-cafe] Frustrating experience of a wannabe contributor

2007-07-18 Thread Andreas Marth
Today I had 2 hours time and thought I might contribute to the haskell community. The topic I thought I might be able to give some hints is about creating DLLs. So I went to www.haskell.org which redirected me to the wiki www.haskell.org/haskellwiki/Haskell. So I entered "DLL" into the search to fi

[Haskell-cafe] Re: Practise fingerspelling with Haskell! (Code cleanup request)

2007-07-18 Thread apfelmus
Dougal Stanton wrote: > The following is a slap-dash program for generating a list of pairs of > words which differ by, at most, one letter. It's quite verbose at the > moment, because (a) that was the way I wrote it, a snippet at a time, > and (b) I lack the wit to make it shorter. > > Can anyone

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Olivier Boudry
Hi Dmitri, I built gtk2hs on Windows with GHC 6.6.1 and gtk2hs-0.9.11. Here's are the steps that worked for me: (not sure I didn't missed some) First you need to install a GTK+ development package for windows. I think mine comes from http://gladewin32.sourceforge.net/modules/wfdownloads/ Then y

[Haskell-cafe] "How to Help Mailing Lists Help Readers"

2007-07-18 Thread Justin Bailey
Andy Oram over at O'Reilly just posted an article analyzing how mailing list readers are helped or hindered in the Perl and Ruby on Rails communities. His most interesting conclusion is that many posters come without the background needed to understand answers. That is certainly been the case on t

Re: [Haskell-cafe] Re: Is this haskelly enough?

2007-07-18 Thread Jonathan Cast
On Wednesday 18 July 2007, Johan Tibell wrote: > It would be nice if it was possible to capture this kind of behavior in a > high order function just like map though. I guess the problem is that the > function to map will take different number of arguments depending on the > use case. > > lookAtTwo

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Bertram Felgenhauer
J. Garrett Morris wrote: >-- the tails function returns each tail of the given list; the > inits function >-- is similar. By mapping inits over tails, we get all the sublists. >where sublists = filter (not . null) . concatMap inits . tails Nice, but concatMap tails . inits is mu

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Johan Tibell
Sounds like what I want. I'll give it a try. Thanks. On 7/18/07, Tillmann Rendel <[EMAIL PROTECTED]> wrote: Johan Tibell wrote: > I found myself wanting a map that looks at neighboring elements. This is > where I used explicit recursion the most. Something like this: > > f [] = [] > f ((Foo a)

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Tillmann Rendel
Johan Tibell wrote: I found myself wanting a map that looks at neighboring elements. This is where I used explicit recursion the most. Something like this: f [] = [] f ((Foo a) : (Bar b) : xs) | fooBar a b = Foo a : f xs | otherwise = Bar b : f xs This is almost a map. A variation is when f

Re: [Haskell-cafe] Maintaining the community

2007-07-18 Thread Bryan Burgers
On 7/18/07, Martin Coxall <[EMAIL PROTECTED]> wrote: On 7/18/07, Jon Harrop <[EMAIL PROTECTED]> wrote: > On Tuesday 17 July 2007 23:26:08 Hugh Perkins wrote: > > Am I the only person who finds it interesting/worrying that there are few > > to no people in the group who are ex-C# programmers. I m

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Dmitri O.Kondratiev
On 7/17/07, Malte Milatz <[EMAIL PROTECTED]> wrote: Dmitri O.Kondratiev: > It looks like Graphics.SOE does not anymore exist in GHC 6.6.1. > Where one can get it or what to use instead of it? You may try Gtk2Hs, which includes an implementation of SOE, called Graphics.SOE.Gtk. (It works ind

Re: [Haskell-cafe] RE: haskell for web

2007-07-18 Thread Arthur van Leeuwen
On 18-jul-2007, at 14:09, Marc Weber wrote: On Tue, Jul 17, 2007 at 03:27:20PM -0700, brad clawsie wrote: On Wed, Jul 18, 2007 at 12:17:12AM +0200, Hugh Perkins wrote: On 7/17/07, Martin Coxall <[EMAIL PROTECTED]> wrote: I wonder why 'we' aren't pushing things like this big time. When Rub

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread Mirko Rahn
Arie Groeneveld wrote: Ok, so when do I use nub instead of 'map head.group.sort'? Never. If |nub_sort=map head.group.sort| is applicable, then you are dealing with a member of class Ord, so use the O(n*log n) |nub_sort|. If you want to preserve the relative order of the input list, use somet

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread haskell
Arie Groeneveld wrote: Hi, Wondering about time space consuming: 'nub' vs 'map head.group.sort' Consider: ry = [1..1] ++ replicate 13 5 ++ replicate 21 34 *Main> length . nub $ ry 1 (5.18 secs, 105 bytes) *Main> length . map head . group . sort $ ry 1 (0.03 secs, 6293384 b

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread Stuart Cook
On 7/18/07, Arie Groeneveld <[EMAIL PROTECTED]> wrote: Ok, so when do I use nub instead of 'map head.group.sort' ? Using nub gave me a lot of trouble in terms of time consumption while handling long lists. Well, nub is non-strict, so you can use it on infinite or partial lists, provided you do

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Salvatore Insalaco
I think that it's simply a buildfile error, that requires X11 even if you are on windows. The problem is that the building process requires running a configure script, so it requires a cygwin environment under windows. If you need HGL only for "educational" purposes, I strongly suggest you to dow

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Andrea Rossato
On Wed, Jul 18, 2007 at 03:58:58PM +0400, Dmitri O.Kondratiev wrote: > Andrea thanks! > I tried to install HGL on Win32 and got this unresolved dependency: > > HGL-3.1>runghc Setup.hs configure > Configuring HGL-3.1... > configure: Dependency base-any: using base-2.1.1 > Setup.hs: cannot sat

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread Stefan Holdermans
Arie, Ok, so when do I use nub instead of 'map head.group.sort' ? Well, for one thing, |map head . group . sort| produces a sorted list, wheras |nub| preserves the order of the input list. Cheers, Stefan ___ Haskell-Cafe mailing list Haskell-C

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread Arie Groeneveld
Miguel Mitrofanov wrote: > AG> Wondering about time space consuming: 'nub' vs 'map > AG> head.group.sort' > > Prelude> :t Data.List.nub > Data.List.nub :: (Eq a) => [a] -> [a] > Prelude> :t Data.List.sort > Data.List.sort :: (Ord a) => [a] -> [a] > > nub uses less information than sort, so it MUST

Re: [Haskell-cafe] Time consumption nub

2007-07-18 Thread Miguel Mitrofanov
AG> Wondering about time space consuming: 'nub' vs 'map AG> head.group.sort' Prelude> :t Data.List.nub Data.List.nub :: (Eq a) => [a] -> [a] Prelude> :t Data.List.sort Data.List.sort :: (Ord a) => [a] -> [a] nub uses less information than sort, so it MUST be slower. _

Re[2]: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Miguel Mitrofanov
DFP> Yes, but that generality is entirely wasted here and thus an DFP> obscuring element. There is no way that this function can be DFP> generalized to work with other monads. As for me, concatMap (and concat.map as well) seems much more obscuring. (>>=) is so general, that I use it almost everywh

Re: [Haskell-cafe] RE: haskell for web

2007-07-18 Thread Marc Weber
On Tue, Jul 17, 2007 at 03:27:20PM -0700, brad clawsie wrote: > On Wed, Jul 18, 2007 at 12:17:12AM +0200, Hugh Perkins wrote: > > On 7/17/07, Martin Coxall <[EMAIL PROTECTED]> wrote: > >> > >> I wonder why 'we' aren't pushing things like this big time. When Ruby > >> took off, more than anything e

[Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Dmitri O.Kondratiev
*Andrea Rossato* wrote: Hi! as far as I know what you are looking for (Graphics.SOE) is part of HGL. Have a look here: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HGL-3.1 Hope I got it right and that this helps. All the best, Andrea Andrea thanks! I tried to install HGL on Wi

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread David F. Place
On Jul 17, 2007, at 10:13 PM, Tony Morris wrote: David F. Place wrote: The use of >>= is just an obscure way of saying (flip concatMap). Correction. The use of >>= is a more general way of saying (flip concatMap). Tony Morris Yes, but that generality is entirely wasted here and thus an

[Haskell-cafe] Time consumption nub

2007-07-18 Thread Arie Groeneveld
Hi, Wondering about time space consuming: 'nub' vs 'map head.group.sort' Consider: ry = [1..1] ++ replicate 13 5 ++ replicate 21 34 *Main> length . nub $ ry 1 (5.18 secs, 105 bytes) *Main> length . map head . group . sort $ ry 1 (0.03 secs, 6293384 bytes) Time sp

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Andrea Rossato
On Tue, Jul 17, 2007 at 06:52:43PM +0400, Dmitri O.Kondratiev wrote: > I am trying to use Graphics.SOE (that was present at least in GHC 6.4) to > go through "Simple Graphics" examples as described in Pail Hudak book "The > Haskell School of Expression. Learning functional programming through >

Re: [Haskell-cafe] Re: Is this haskelly enough?

2007-07-18 Thread Johan Tibell
It would be nice if it was possible to capture this kind of behavior in a high order function just like map though. I guess the problem is that the function to map will take different number of arguments depending on the use case. lookAtTwo a b = ... lookAtThree a b c = ... map' :: (a -> ... ->

[Haskell-cafe] Re: "no-coding" functional data structures via lazyness

2007-07-18 Thread apfelmus
Dave Bayer wrote: > Here is a prime sieve that can hang within a factor of two of the fastest > code in that thread, until it blows up on garbage collection: > > - > > diff :: Ord a => [a] -> [a] -> [a] > diff xs@(x:xt) ys@(y:yt) = c

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Bjorn Bringert
On Jul 18, 2007, at 2:13 , ok wrote: On Jul 17, 2007, at 22:26 , James Hunt wrote: As a struggling newbie, I've started to try various exercises in order to improve. I decided to try the latest Ruby Quiz (http:// www.rubyquiz.com/quiz131.html) in Haskell. Haskell guru level: I am comforta

[Haskell-cafe] Re: Is this haskelly enough?

2007-07-18 Thread apfelmus
Johan Tibell wrote: > I found myself wanting a map that looks at neighboring elements. This is > where I used explicit recursion the most. Something like this: > > f [] = [] > f ((Foo a) : (Bar b) : xs) > | fooBar a b = Foo a : f xs > | otherwise = Bar b : f xs > > This is almost a map. A var

Re: [Haskell-cafe] Is this haskelly enough?

2007-07-18 Thread Johan Tibell
I found myself wanting a map that looks at neighboring elements. This is where I used explicit recursion the most. Something like this: f [] = [] f ((Foo a) : (Bar b) : xs) | fooBar a b = Foo a : f xs | otherwise = Bar b : f xs This is almost a map. A variation is when filtering and you want

Re: [Haskell-cafe] Maintaining the community

2007-07-18 Thread Martin Coxall
On 7/18/07, Jon Harrop <[EMAIL PROTECTED]> wrote: On Tuesday 17 July 2007 23:26:08 Hugh Perkins wrote: > Am I the only person who finds it interesting/worrying that there are few > to no people in the group who are ex-C# programmers. I mean, you could > argue that C# programmers are simply too s

Re: [Haskell-cafe] Maintaining the community

2007-07-18 Thread Martin Coxall
On 7/17/07, Thomas Conway <[EMAIL PROTECTED]> wrote: On 7/18/07, Hugh Perkins <[EMAIL PROTECTED]> wrote: > Am I the only person who finds it interesting/worrying that there are few to > no people in the group who are ex-C# programmers. I mean, you could argue > that C# programmers are simply too