Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Jules Bean
Thomas Schilling wrote: On 21 feb 2008, at 18.35, Johan Tibell wrote: I switched from lazy bytestrings to a left fold in my networking code after reading what Oleg wrote about streams vs folds. No problems with handles, etc. anymore. Do you fold over chunks? Can you continue to use Parsek

[Haskell-cafe] Re: [Haskell] Re: Re: RE: Extensible records: Static duck typing

2008-02-21 Thread Mark P Jones
[Redirecting to haskell-cafe] Ben Franksen wrote: TREX seems to be generally agreed to be too complicated to implement and explain. What evidence do you have for this? Speaking as somebody who implemented Trex for Hugs (and who also witnessed Ben Gaster build an independent implementation), I

Re: [Haskell-cafe] Selecting Array type

2008-02-21 Thread Ryan Ingram
On 2/21/08, Jeff φ <[EMAIL PROTECTED]> wrote: > Thanks again. I'm not familiar with type equality constraints. I could not > find information on this in the GHC users guide. Is it documented > somewhere? Section 7.3 here talks about equality constraints. http://www.haskell.org/haskellwiki/GHC/I

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Conal Elliott
On Thu, Feb 21, 2008 at 5:37 PM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > So the advantage of passing the rest through uninterpreted is that > markdown then interprets it and we get lots of cool markup for free, the > disadvantage is that we get lots more markup that I don't > understand! :-) T

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 16:54 -0800, Conal Elliott wrote: > I guess there was some confusion about the haddock-as-preprocessor > idea. Here's another try: > > Pare the Haddock markup language down to very few markup directives, > say just 'foo' and "Foo.Bar". (Of course, Haddock continues to read

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Conal Elliott
I guess there was some confusion about the haddock-as-preprocessor idea. Here's another try: Pare the Haddock markup language down to very few markup directives, say just 'foo' and "Foo.Bar". (Of course, Haddock continues to read and process type signatures and module import & export specs.) Com

Re: [Haskell-cafe] Re: Can't seem to get `par` working appropriately with lists

2008-02-21 Thread Don Stewart
ben.franksen: > Luke Andrew wrote: > > main = do print $ zipWith (+) (fiblist2 37 `par` fiblist1 37) > > (fiblist2 37) > > > > compilation & testing: > > > > [EMAIL PROTECTED]:~/mcls$ ghc -O2 -threaded --make test2 > > > > [EMAIL PROTECTED]:~/mcls$ time ./test2 +RTS -N1 > > [2,2,

[Haskell-cafe] Re: Can't seem to get `par` working appropriately with lists

2008-02-21 Thread Ben Franksen
Luke Andrew wrote: > main = do print $ zipWith (+) (fiblist2 37 `par` fiblist1 37) > (fiblist2 37) > > compilation & testing: > > [EMAIL PROTECTED]:~/mcls$ ghc -O2 -threaded --make test2 > > [EMAIL PROTECTED]:~/mcls$ time ./test2 +RTS -N1 > [2,2,4,6,10,16,26,42......405774,18

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 13:12 +, Alistair Bayley wrote: > On 21/02/2008, Duncan Coutts <[EMAIL PROTECTED]> wrote: > > > > To be honest I like the fact that haddock's markup is really simple and > > perhaps somewhat restrictive. A great improvement though would be to > > make it easy to extract

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 13:34 +0100, Henning Thielemann wrote: > I suppose we mean the same. My question is: Why do we use ByteString > instead of [Word8] ? Entirely because of efficiency, right? So if we could > stick to List code and only convert to ByteString at the end and the > compiler all re

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Johan Tibell
On Thu, Feb 21, 2008 at 6:58 PM, Thomas Schilling <[EMAIL PROTECTED]> wrote: > > On 21 feb 2008, at 18.35, Johan Tibell wrote: > > > > I switched from lazy bytestrings to a left fold in my networking code > > after reading what Oleg wrote about streams vs folds. No problems with > > handles, e

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 13:37 +0100, Johan Tibell wrote: > I would be very happy if people didn't use the .Char8 versions of > ByteString except for being able to write byte literals using pack. (I > would be even happier if Haskell had byte literals.) If people start > using ByteString in their li

Re: [Haskell-cafe] Selecting Array type

2008-02-21 Thread Ryan Ingram
On 2/20/08, Jeff φ <[EMAIL PROTECTED]> wrote: > -- SURPRISE 1: If function, arrTypeCast, is removed, (from both > -- the class and instance) GHC assumes the kind of a and b are *, > -- instead of * -> * -> * and produce . . . > -- > -- report3.hs:37:24: > -- `UArray' is not applied to enough ty

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Yitzchak Gale
David Menendez wrote: > Markdown is not really a presentation format. > It's an authoring format Its primary design goal is to be easy to read, not easy to parse. That's why I consider it a presentation format, Anyway, it's not suitable for use as API markup. The whole point is that you want to

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread David Menendez
On Thu, Feb 21, 2008 at 12:54 PM, Yitzchak Gale <[EMAIL PROTECTED]> wrote: > Duncan Coutts wrote: > >> To be honest I like the fact that haddock's markup is really simple and > >> perhaps somewhat restrictive. A great improvement though would be... > > >> a generic backend that spits out > >>

Re: [Haskell-cafe] Repeated function application

2008-02-21 Thread Dan Weston
Ben Butler-Cole wrote: Hello I was surprised to be unable to find anything like this in the standard libraries: times :: (a -> a) -> Int -> (a -> a) times f 0 = id times f n = f . (times f (n-1)) Am I missing something more general which would allow me to repeatedly apply a function to an in

Re: [Haskell-cafe] Problem with Python AST

2008-02-21 Thread Roel van Dijk
Your solutions allows a bit more but fails with the equivalent of def foo(): for i in range(10): if i == 6: return None The loop context 'overwrites' the function context which makes the return statement illegal. I think I need a type level list. __

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-21 Thread Chad Scherrer
On Wed, Feb 20, 2008 at 7:57 PM, Henning Thielemann <[EMAIL PROTECTED]> wrote: > I think there can also be problems simply because the element type is no > longer fixed to Word8 but also not entirely free, but restricted to > Storable. E.g. you cannot simply replace > SV.fromList . List.map

Re: [Haskell-cafe] stream/bytestring questions

2008-02-21 Thread Chad Scherrer
On Wed, Feb 20, 2008 at 5:53 PM, Roman Leshchinskiy <[EMAIL PROTECTED]> wrote: > In general, I don't see why programming directly with streams is > something that should be avoided. You do have to be quite careful, > though, if you want to get good performance (but GHC's simplifier is > becomin

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Thomas Schilling
On 21 feb 2008, at 18.35, Johan Tibell wrote: I switched from lazy bytestrings to a left fold in my networking code after reading what Oleg wrote about streams vs folds. No problems with handles, etc. anymore. Do you fold over chunks? Can you continue to use Parsek or other utilities that

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Yitzchak Gale
Duncan Coutts wrote: >> To be honest I like the fact that haddock's markup is really simple and >> perhaps somewhat restrictive. A great improvement though would be... >> a generic backend that spits out >> the info that haddock gathers in a machine readable format. Alistair Bayley wrote: > I

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Johan Tibell
On Thu, Feb 21, 2008 at 5:51 PM, Thomas Schilling <[EMAIL PROTECTED]> wrote: > > I know of an example off-hand: > > http://nominolo.blogspot.com/2007/05/networkhttp-bytestrings.html > > (Of course, as I read that, I see that the lazy code is different from > > the strict code, but I'll just i

Re: [Haskell-cafe] Selecting Array type

2008-02-21 Thread Justin Bailey
2008/2/20 Jeff φ <[EMAIL PROTECTED]>: > I'd love to find a good article that describes the ins and outs of multi > parameter types, functional dependencies, and type assertions, in enough > detail to resolve these surprises. A step-by-step walk through showing how > the compiler resolve a type and

[Haskell-cafe] Haskell + Windows Mobile?

2008-02-21 Thread Bulat Ziganshin
Hello haskell-cafe, is there any haskell implementation for Windows Mobile? does they are support creation of GUI apps and internet networking features? -- Best regards, Bulat mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing

Re[2]: [Haskell-cafe] question about STM and IO

2008-02-21 Thread Bulat Ziganshin
Hello Ryan, Thursday, February 21, 2008, 5:02:52 AM, you wrote: > values, determine that x >= y, and just return (), but it's too late, > the missiles have already been launched. it seems that "asymmetrical answer" of mr.Putin is just to hire a bit more Haskell Hackers :) -- Best regards, Bu

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Thomas Schilling
On 21 feb 2008, at 15.26, Devin Mullins wrote: On Thu, Feb 21, 2008 at 10:21:50AM +, Duncan Coutts wrote: So I'm claiming that the single impl with boundary conversion gives us the best of both worlds, no code bloat due to specialisation and working with whichever string type you like,

Re: [Haskell-cafe] Repeated function application

2008-02-21 Thread Wolfgang Jeltsch
Am Donnerstag, 21. Februar 2008 16:58 schrieb Ben Butler-Cole: > Hello > > I was surprised to be unable to find anything like this in the standard > libraries: > > times :: (a -> a) -> Int -> (a -> a) > times f 0 = id > times f n = f . (times f (n-1)) times f n = (!! n) . iterate f > […] Best wi

Re: [Haskell-cafe] Repeated function application

2008-02-21 Thread jerzy . karczmarczuk
Ben Butler-Cole writes: times :: (a -> a) -> Int -> (a -> a) times f 0 = id times f n = f . (times f (n-1)) Am I missing something more general ...I can't help feeling that there must be a way to get rid of the explicit recursion. How would you implement times? Anything against (apart

[Haskell-cafe] Repeated function application

2008-02-21 Thread Ben Butler-Cole
Hello I was surprised to be unable to find anything like this in the standard libraries: times :: (a -> a) -> Int -> (a -> a) times f 0 = id times f n = f . (times f (n-1)) Am I missing something more general which would allow me to repeatedly apply a function to an input? Or is this not usefu

Re: Re[2]: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-21 Thread Brandon S. Allbery KF8NH
On Feb 21, 2008, at 5:24 , Bulat Ziganshin wrote: Hello Wolfgang, Thursday, February 21, 2008, 2:45:43 AM, you wrote: I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread David Waern
2008/2/21, Conal Elliott <[EMAIL PROTECTED]>: > There was a chat today on #haskell (15:08 to 16:10) about evolving haddock. > I'd like to get comments. > > The goal is to get the full functionality of a general purpose, > programmer-friendly markup language like markdown. One example is image >

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Devin Mullins
On Thu, Feb 21, 2008 at 10:21:50AM +, Duncan Coutts wrote: > So I'm claiming that the single impl with boundary conversion gives us > the best of both worlds, no code bloat due to specialisation and working > with whichever string type you like, by converting it at the beginning > and end. Of c

[Haskell-cafe] Gobbler Benchmarks

2008-02-21 Thread Adrian Hey
Hello Folks, There's been some discussions recently about the pros and cons of various coding styles, particularly whether stack greedy or heap greedy is best, and how (if) ghcs stack management in particular should affect all this. In particular, the problem of implementing an eager take functio

Re: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-21 Thread Ross Paterson
On Wed, Feb 20, 2008 at 09:22:58PM +, Steve Lihn wrote: > I proudly announce a little toy that lists the frequency of modules > being imported by other modules. Do you know Control.Monad is the most > frequently imported module? I did not! > > Currently it only includes GHC 6.8 core library. I

Re: [Haskell-cafe] Doubting Haskell

2008-02-21 Thread Yitzchak Gale
Cale Gibbard wrote: > I woke up rather early, and haven't much to do, so I'll turn this into > a tutorial. :) Cale, this is fantastic, as always. I often find myself searching for material like this when introducing people to Haskell. Would you be willing to put this on the wiki? Thanks, Yitz

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Alistair Bayley
On 21/02/2008, Duncan Coutts <[EMAIL PROTECTED]> wrote: > > To be honest I like the fact that haddock's markup is really simple and > perhaps somewhat restrictive. A great improvement though would be to > make it easy to extract the docs from haddock in a nice format so that > the could be re-us

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Johan Tibell
On Thu, Feb 21, 2008 at 11:37 AM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > > > On Thu, 2008-02-21 at 10:06 +0100, Johan Tibell wrote: > > Hi John! > > > > On Wed, Feb 20, 2008 at 3:39 PM, John Goerzen <[EMAIL PROTECTED]> wrote: > > > 3) Would it make sense to base as much code as possible i

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Henning Thielemann
On Thu, 21 Feb 2008, Duncan Coutts wrote: > On Thu, 2008-02-21 at 05:07 +0100, Henning Thielemann wrote: > > > As long as it is only about speeding up list processing, one might also > > consider this as optimization problem. This could be handled without > > adapting much List based code in appl

Re[2]: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-21 Thread Bulat Ziganshin
Hello Wolfgang, Thursday, February 21, 2008, 2:45:43 AM, you wrote: >> I proudly announce a little toy that lists the frequency of modules >> being imported by other modules. Do you know Control.Monad is the most >> frequently imported module? I did not! > This doesn’t surprise me very much. Wha

Re: [Haskell-cafe] Can't seem to get `par` working appropriately with lists

2008-02-21 Thread Jules Bean
Luke Andrew wrote: import Control.Parallel fib1 n = if n == 0 then 0 else if n == 1 then 1 else fib1 (n-1) + fib1 (n-2) fib2 n = if n == 0 then 0 else if n == 1 then 1 else fib2 (n-1) + fib2 (n-2) main = do print $ (fib2 37 `par` fib1 37) + (fib2 37) "fib2 37" won't be shared. Y

[Haskell-cafe] Can't seem to get `par` working appropriately with lists

2008-02-21 Thread Luke Andrew
Hopefully an easy one here; after reading Don Stewart's blog posts about parallel Haskell and with a shiny new quad-core cpu begging for a workout, i thought I'd give Haskell a try. I've also been meaning to write a ray-tracer, so I started with that. I've got the initial ray-tracer working, and a

Re: [Haskell-cafe] haddock as a markdown preprocessor

2008-02-21 Thread Duncan Coutts
On Wed, 2008-02-20 at 16:43 -0800, Conal Elliott wrote: > There was a chat today on #haskell (15:08 to 16:10) about evolving > haddock. I'd like to get comments. > > The goal is to get the full functionality of a general purpose, > programmer-friendly markup language like markdown. One example

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 05:07 +0100, Henning Thielemann wrote: > As long as it is only about speeding up list processing, one might also > consider this as optimization problem. This could be handled without > adapting much List based code in applications to a generic sequence class. > That is, if

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Duncan Coutts
On Thu, 2008-02-21 at 10:06 +0100, Johan Tibell wrote: > Hi John! > > On Wed, Feb 20, 2008 at 3:39 PM, John Goerzen <[EMAIL PROTECTED]> wrote: > > 3) Would it make sense to base as much code as possible in the Haskell > >core areound ListLike definitions? Here I think of functions such > >

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Duncan Coutts
On Wed, 2008-02-20 at 19:01 -0600, John Goerzen wrote: > On Wednesday 20 February 2008 5:13:34 pm Duncan Coutts wrote: > > On Wed, 2008-02-20 at 08:39 -0600, John Goerzen wrote: > > > * The iconv library works only on lazy ByteStrings, and does not > > >handle Strings or strict ByteStrings > >

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-21 Thread Johan Tibell
Hi John! On Wed, Feb 20, 2008 at 3:39 PM, John Goerzen <[EMAIL PROTECTED]> wrote: > 3) Would it make sense to base as much code as possible in the Haskell >core areound ListLike definitions? Here I think of functions such >as lines and words, which make sense both on [Char] as well as >