[Haskell-cafe] Lack of inlining - slow parsing with Data.Binary

2008-12-26 Thread Eugene Kirpichov
Hi, I'm parsing Java classfiles with Data.Binary, the code is here: http://paste.org/index.php?id=4625 The problem is that the resulting code parses rt.jar from JDK6 (about 15K classes, 47Mb zipped) in 15 seconds (run the program with main -mclose rt.jar, for instance), which is 10 times slower

[Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Thomas DuBuisson
Hello cafe, This is just a small thought, but its been bugging me. We have these things called type classes for a reason (I like to think). When making a new data type 'Data', it is not productive to avoid type classes such as 'Show' and export a 'showData' function. Examples of what I'm

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Henning Thielemann
On Fri, 26 Dec 2008, Thomas DuBuisson wrote: Hello cafe, This is just a small thought, but its been bugging me.  We have these things called type classes for a reason (I like to think).  When making a new data type 'Data', it is not productive to avoid type classes such as 'Show' and export

Re: [Haskell-cafe] What are side effects in Haskell?

2008-12-26 Thread Peter Verswyvelen
Using GHCi I found it informative to see that IO indeed is a kind of state monad. Here's a GHCi session to show that: Prelude :m GHC.Prim Prelude GHC.Prim :i IO newtype IO a = GHC.IOBase.IO (State# RealWorld - (# State# RealWorld, a #)) -- Defined in GHC.IOBase instance Monad IO --

RE: [Haskell-cafe] forkIO on multicore[MESSAGE NOT SCANNED]

2008-12-26 Thread Duncan Coutts
On Tue, 2008-12-23 at 18:27 +, Paul Keir wrote: Hi Duncan, I'm following the story regarding (parallel) GC in this example with interest, but forgive me if I ask a more minor question regarding your modification of an extra parameter, n, to heavytask. Does this really help (to ensure

[Haskell-cafe] Re: [Haskell] hsc2hs can't find gcc under windows

2008-12-26 Thread Duncan Coutts
On Thu, 2008-12-25 at 15:17 +0900, Curt Sampson wrote: I'm trying to upgrade from ghc 6.8.3 to 6.10.1. Unfortunately, there seem to be problems with the Windows version. (I've installed it on two different machines, both Windows XP, and they've both had the same problem. Both worked fine with

[Haskell-cafe] Re: [Haskell] Haskell Weekly News: Issue 98 - December 25, 2008

2008-12-26 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brent Yorgey wrote: 50. file://localhost/home/brent/hacking/hwn/20081225.html :( -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jonathan Cast
On Fri, 2008-12-26 at 11:51 +, Thomas DuBuisson wrote: Hello cafe, This is just a small thought, but its been bugging me. We have these things called type classes for a reason (I like to think). Type classes were invented for two reasons: 1) To imitate mathematical convention. Addition,

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jeff Heard
I don't think that making Show a type class was a mistake. I think that we have long since overloaded the meaning of Show and made it ambiguous. There are multiple distinct reasons people use Show, and this gets confusing. It would be good if we as a community tried to nail down these different

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Henning Thielemann
On Fri, 26 Dec 2008, Jeff Heard wrote: I don't think that making Show a type class was a mistake. I think that we have long since overloaded the meaning of Show and made it ambiguous. There are multiple distinct reasons people use Show, and this gets confusing. It would be good if we as a

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread brian
On Fri, Dec 26, 2008 at 1:55 PM, Jeff Heard jefferson.r.he...@gmail.com wrote: Off the top of my head, I would say that the traditional meaning of Show could be changed to Serial, where serial encompasses both Read and Show -- possibly we could find a more efficient read function, several have

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jonathan Cast
On Fri, 2008-12-26 at 13:55 -0600, Jeff Heard wrote: I don't think that making Show a type class was a mistake. I think that we have long since overloaded the meaning of Show and made it ambiguous. There are multiple distinct reasons people use Show, and this gets confusing. It would be

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Donn Cave
Quoth brian brianchina60...@gmail.com: | On Fri, Dec 26, 2008 at 1:55 PM, Jeff Heard jefferson.r.he...@gmail.com wrote: | Off the top of my head, I would say that the traditional meaning of | Show could be changed to Serial, where serial encompasses both Read | and Show -- possibly we could find

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Thomas DuBuisson
Jeff Heard proclaimed: There are multiple distinct reasons people use Show, and this gets confusing. This is exactly what I was getting at. I see four uses being discussed: 1) Programmer readable / compiler parsable. For this we have 'Show' and 'Read', but the community has a lack of

[Haskell-cafe] Request for feedback: Understanding Haskell Monads

2008-12-26 Thread Ertugrul Soeylemez
Hello fellow Haskellers, In the last few weeks I have written a comprehensive tutorial about Haskell monads [1], and I was hoping to get some constructive feedback. I'd appreciate any well meant criticism. [1] http://ertes.de/articles/monads.html Greets, Ertugrul. -- nightmare =

[Haskell-cafe] Function composition

2008-12-26 Thread Oscar Picasso
Hi, I can write: *Main let yes = not . not *Main :t yes yes :: Bool - Bool But not: *Main let isNotEqual = not . (==) interactive:1:23: Couldn't match expected type `Bool' against inferred type `a - Bool' Probable cause: `==' is applied to too few arguments In the second

Re: [Haskell-cafe] Function composition

2008-12-26 Thread Luke Palmer
2008/12/26 Oscar Picasso oscarpica...@gmail.com Hi, I can write: *Main let yes = not . not *Main :t yes yes :: Bool - Bool But not: *Main let isNotEqual = not . (==) The definition of (.): f . g = \x - f (g x) So: not . (==) = \x - not ((==) x) But (==) x is a function (of type a -

Re: [Haskell-cafe] Function composition

2008-12-26 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Check the type of (.) Prelude :t (.) (.) :: (b - c) - (a - b) - a - c Then the type of (.) not Prelude :t (.) not (.) not :: (a - Bool) - a - Bool Now try to apply (==) Prelude :t (.) not (==) -- not going to happen Won't happen. What do you

[Haskell-cafe] ByteString typechecking issues....

2008-12-26 Thread Galchin, Vasili
Hello, I have a ByteString - [ByteString] - ByteString situation, i.e. concatenation . -- marshall into ByteString representation join (encode (buildHeader ss)) -- ByteString (map encode (buildEntries

[Haskell-cafe] Type classes

2008-12-26 Thread Oscar Picasso
From Real World Haskell: data JValue = JString String | JNumber Double | JBool Bool | JNull | JObject [(String, JValue)] | JArray [JValue] deriving (Eq, Ord, Show) type JSONError = String class JSON a where

[Haskell-cafe] Re: Type classes

2008-12-26 Thread Oscar Picasso
Forget it. It's more clear reading further. Sorry for the noise. On Sat, Dec 27, 2008 at 1:02 AM, Oscar Picasso oscarpica...@gmail.comwrote: From Real World Haskell: data JValue = JString String | JNumber Double | JBool Bool | JNull |

[Haskell-cafe] Re: ByteString typechecking issues....

2008-12-26 Thread Galchin, Vasili
Hello, Using a strongly-typed language so should just have to check domain and co-domain of functions? Vasili On Fri, Dec 26, 2008 at 11:13 PM, Galchin, Vasili vigalc...@gmail.comwrote: Hello, I have a ByteString - [ByteString] - ByteString situation, i.e. concatenation .

Re: [Haskell-cafe] ByteString typechecking issues....

2008-12-26 Thread Luke Palmer
2008/12/26 Galchin, Vasili vigalc...@gmail.com Hello, I have a ByteString - [ByteString] - ByteString situation, i.e. concatenation . -- marshall into ByteString representation join (encode (buildHeader ss)) --