Re: [Haskell-cafe] Comments requested: succ Java
On 28/09/2009, at 7:38 AM, Peter Verswyvelen wrote: That's not really true. Just use CAL from the Open Quark framework... It's almost Haskell 98, with some extras, and compiles to fast JVM code. http://openquark.org/Open_Quark/Welcome.html They even seem to do all kinds of advanced optimizations - like converting tail calls to loops - to get good Java performance. And they have a better record system, a graphical environment to learn it, etc. So I think CAL should be in the list, and since it's basically Haskell... Liking CAL, I suggested it be included in a comment when the original post was made, but I never made the time to write up a matching set of examples myself. Curt, your first blog post is almost compatible with CAL -- you don't need to use a record type to get named accessors, CAL doesn't support list comprehension syntax, and the isBlank implementation would be different. Obviously the Java interop capabilities of CAL are very different to Haskell (and a bit verbose, though quite extensive). Dispatch comes out more-or-less the same -- although CAL doesn't do equational style function defs or comprehensive pattern matching like Haskell. In CAL I'd write letter_grade something like (untested): letter_grade :: Num a = a - Maybe Char; letter_grade val = find (\pair - fst pair $ val) [( 90, 'A'), ... )] `bind` (\p - return $ snd p); where bind is = Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] 16 bit floating point data in Haskell?
2009/9/28 Casey Hawthorne cas...@istar.ca: On Mon, 28 Sep 2009 12:06:47 +1300, you wrote: On Sep 28, 2009, at 9:40 AM, Olex P wrote: Hi, Yes, I mean sizeOf 2. It's useful not only on GPUs but also in normal software. Think of huge data sets in computer graphics (particle clouds, volumetric data, images etc.) Some data (normals, density, temperature and so on) can be easily represented as float 16 making files 200 GB instead of 300 GB. Good benefits. From the OpenEXR technical introduction: half numbers have 1 sign bit, 5 exponent bits, and 10 mantissa bits. The interpretation of the sign, exponent and mantissa is analogous to IEEE-754 floating-point numbers. half supports normalized and denormalized numbers, infinities and NANs (Not A Number). The range of representable numbers is roughly 6.0E-8 to 6.5E4; numbers smaller than 6.1E-5 are denormalized. Single-precision floats are already dangerously short for many computations. (Oh the dear old B6700 with 39 bits of precision in single-precision floats...) Half-precision floats actually have less than half the precision of singles (11 bits instead of 23). It's probably best to think of binary 16 as a form of compression for Float, and to write stuff that will read half-precision from a binary stream as single-precision, and conversely stuff that will accept single-precision values and write them to a binary stream in half-precision form. I agree with the above. I hadn't realized how dangerously short for many computations single-precision is. So, as he says, for computing, you do want to convert half-precision to single-precision, if not double-precision. If you want to save storage space, then some sort of compression scheme might be better on secondary storage. As for the video card, some sort of fast decompression scheme would be necessary for the half-precision numbers coming in. 'Half', as they are called, are supported in GPU. The half-precision floating point is a core feature in OpenGL 3.0. As said above, they are merely a data storage format, which should be translated to floats or doubles before any computation. Cheers, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
Hello Curt, Sunday, September 27, 2009, 8:16:53 PM, you wrote: http://www.starling-software.com/en/blog/drafts/2009/09/27.succ-java-summary.html what are the types of balance and interest in balance * interest expression? ;) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
On 2009-09-28 11:13 +0400 (Mon), Bulat Ziganshin wrote: http://www.starling-software.com/en/blog/drafts/2009/09/27.succ-java-summary.html what are the types of balance and interest in balance * interest expression? ;) I dunno, but I think it's not really relevant to the point of the example from the original article cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] 80 bit floating point data in Haskell?
Ross Mellgren wrote: What about the built-in Float type? Prelude Foreign.Storable sizeOf (undefined :: Float) 4 Prelude Foreign.Storable sizeOf (undefined :: Double) 8 While we're on the subject... I understand that certain FPUs support 80-bit precision. Is there any way to get at that? Or is this going to require FFI too? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A proposals
wren ng thornton wrote: Another nice thing this suggests is the ability to use underscore as a pattern for when you know the compiler will infer the type but it's too complex to want to write out (e.g. while experimenting). I'd love this! M. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] A proposals
Martijn van Steenbergen wrote: wren ng thornton wrote: Another nice thing this suggests is the ability to use underscore as a pattern for when you know the compiler will infer the type but it's too complex to want to write out (e.g. while experimenting). I'd love this! F# has this and I find it very useful. Ganesh === Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html === ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] A proposals
Hello Martijn, Monday, September 28, 2009, 1:42:10 PM, you wrote: Another nice thing this suggests is the ability to use underscore as a pattern for when you know the compiler will infer the type but it's too complex to want to write out (e.g. while experimenting). in case you not seen this and may be interested: http://okmij.org/ftp/Haskell/types.html#partial-sigs -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: JSONb-0.0.2
JSONb is a ByteString parser for JSON, yielding a simple JSON type composed of Rationals, ByteString tries and strict ByteStrings. http://hackage.haskell.org/package/json-b-0.0.2 An example application program, `json-schema`, is provided. It derives schema for JSON input. When first looking at a web API, for example, you can feed it a few thousand lines of input and see what you got. A sample schema, derived from a stream of the Twitter API, is here: http://wiki.github.com/jsnx/JSONb/schema-example It's worth noting that the schema has a lone object at the bottom that has exactly the format of the user property of the schema ahead of it -- why is that? Well, `json-schema` uses a fault tolerant parsing approach; the very last Tweet was cut off and the user property's value was among the things that could be salvaged. -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A proposals
Bulat Ziganshin wrote: in case you not seen this and may be interested: http://okmij.org/ftp/Haskell/types.html#partial-sigs Yes, I know there are workarounds (and I use them sometimes). It'd be nice if there was direct support for them. :-) Thanks, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] 80 bit floating point data in Haskell?
wren ng thornton wrote: Andrew Coppin wrote: While we're on the subject... I understand that certain FPUs support 80-bit precision. Is there any way to get at that? Or is this going to require FFI too? Perhaps you want Foreign.C.Types.CLDouble ? http://hackage.haskell.org/packages/archive/base/latest/doc/html/Foreign-C-Types.html#t%3ACLDouble http://en.wikipedia.org/wiki/Long_double (Or do you really want to ensure that it's 80-bits regardless of platform and the whims of the C compiler?) Yep, that'll do. :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Fwd: [Haskell-cafe] frag game-compiling error
-- Forwarded message -- From: selahaddin gerdan selahattin.ger...@gmail.com Date: 2009/9/28 Subject: Re: [Haskell-cafe] frag game-compiling error To: Lyndon Maydwell maydw...@gmail.com Sorry I'm just learning haskell, so I don't get your suggestion. Could you explain to me what exactly I have to do? According to thishttp://cvs.haskell.org/Hugs/pages/libraries/OpenGL/Graphics-Rendering-OpenGL-GL-BasicTypes.html#t%3AGLfloatpage GLfloat is just a type synonym for type Float. How come the error message differentiates between them? 2009/9/28 Lyndon Maydwell maydw...@gmail.com I think this is an opengl version problem. I came across this error in vacuum-opengl after I had upgraded my opengl. I patched it up using a fromnumeric type call. On Mon, Sep 28, 2009 at 8:00 AM, selahaddin gerdan selahattin.ger...@gmail.com wrote: Hi there, when I try to install frag,I get this error: .cabal/bin/cabal install frag Resolving dependencies... Downloading frag-1.1.2... Configuring frag-1.1.2... Preprocessing executables for frag-1.1.2... Building frag-1.1.2... [ 1 of 39] Compiling IdentityList ( src/IdentityList.hs, dist/build/frag/frag-tmp/ IdentityList.o ) [ 2 of 39] Compiling Quaternion ( src/Quaternion.hs, dist/build/frag/frag-tmp/Quaternion.o ) src/Quaternion.hs:22:27: Couldn't match expected type `GLfloat' against inferred type `Float' In the expression: (r00 :: GLfloat) In the second argument of `newMatrix', namely `[(r00 :: GLfloat), r01, r02, r03, ]' In the expression: newMatrix ColumnMajor [(r00 :: GLfloat), r01, r02, r03, ] cabal: Error: some packages failed to install: frag-1.1.2 failed during the building phase. The exception was: exit: ExitFailure 1 Why? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Fwd: [Haskell-cafe] frag game-compiling error
On Mon, Sep 28, 2009 at 01:57:03PM +0300, selahaddin gerdan wrote: Sorry I'm just learning haskell, so I don't get your suggestion. Could you explain to me what exactly I have to do? According to thishttp://cvs.haskell.org/Hugs/pages/libraries/OpenGL/Graphics-Rendering-OpenGL-GL-BasicTypes.html#t%3AGLfloatpage GLfloat is just a type synonym for type Float. How come the error message differentiates between them? That's not the latest documentation, you should go to [1] if you want it. Nowadays GLfloat isn't a type synonym anymore[2]. HTH, [1] http://hackage.haskell.org/package/OpenGL [2] http://hackage.haskell.org/packages/archive/OpenGLRaw/1.1.0.0/doc/html/Graphics-Rendering-OpenGL-Raw-Core31.html#t%3AGLfloat -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] 80 bit floating point data in Haskell?
On Mon, Sep 28, 2009 at 5:52 AM, Andrew Coppin andrewcop...@btinternet.com wrote: wren ng thornton wrote: Andrew Coppin wrote: While we're on the subject... I understand that certain FPUs support 80-bit precision. Is there any way to get at that? Or is this going to require FFI too? Perhaps you want Foreign.C.Types.CLDouble ? http://hackage.haskell.org/packages/archive/base/latest/doc/html/Foreign-C-Types.html#t%3ACLDouble http://en.wikipedia.org/wiki/Long_double (Or do you really want to ensure that it's 80-bits regardless of platform and the whims of the C compiler?) Yep, that'll do. :-) From the source: -- HACK: Currently no long double in the FFI, so we simply re-use double -- | Haskell type representing the C @long double@ type. FLOATING_TYPE(CLDouble,tyConCLDouble,CLDouble,HTYPE_DOUBLE) I also believe that CLDouble is gone in GHC 6.12.1, since it isn't really there. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: ANN: CmdArgs - easy command line argument processing
2009/9/28 Ben Franksen ben.frank...@online.de: To expose an impure function (!) in an API, I don't know... I mean, couldn't one just wrap the value like this data Attributed a -- opaque (=) :: a - Attrib - Attributed a mode :: Data a = Attributed a - Mode a and thus retain a purely functional interface? Hi Ben, I don't think this would work because you need to be able to put the Attributed things in the fields of your command options data type. If they are wrapped in an Attributed then this may not be possible. In particular the sample won't compile in your proposal: data Sample = Sample {hello :: String} deriving (Show, Data, Typeable) sample = mode $ Sample{hello = def = text World argument empty world} Because the = would return an Attributed String whereas you are actually after a String. Essential the problem is that attributes are attached to *fields*, but mode consumes a *record*. The best way to do this typefully is to paramaterise the options data type with a functor: data Sample f = Sample {hello :: f String} deriving (Show, Data, Typeable) Now you can do what you want, where mode :: Data a = a Attribute - Mode (a Id). In fact, you could even do away with Data and substitute some sort of Foldable/Traversable as long as you were happy with the library not being able to fill in a default argument name from the record field name. The current interface is the best tradeoff given what Neil is trying to do IMHO - though the side effects make me shudder too! Cheers, Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Fwd: [Haskell-cafe] frag game-compiling error
src/Quaternion.hs:22:27 This would probably be the place to start. On Mon, Sep 28, 2009 at 7:28 PM, Felipe Lessa felipe.le...@gmail.com wrote: On Mon, Sep 28, 2009 at 01:57:03PM +0300, selahaddin gerdan wrote: Sorry I'm just learning haskell, so I don't get your suggestion. Could you explain to me what exactly I have to do? According to thishttp://cvs.haskell.org/Hugs/pages/libraries/OpenGL/Graphics-Rendering-OpenGL-GL-BasicTypes.html#t%3AGLfloatpage GLfloat is just a type synonym for type Float. How come the error message differentiates between them? That's not the latest documentation, you should go to [1] if you want it. Nowadays GLfloat isn't a type synonym anymore[2]. HTH, [1] http://hackage.haskell.org/package/OpenGL [2] http://hackage.haskell.org/packages/archive/OpenGLRaw/1.1.0.0/doc/html/Graphics-Rendering-OpenGL-Raw-Core31.html#t%3AGLfloat -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Market Place for Haskell development teams?
In the last months, I made the experience it seems difficult to find commercial Haskell developer teams to take responsibility for projects in the range of $ 10.000 - 100.000. The Industrial Haskell Group does not seem to be the appropriate place for this, while harvesting Haskell team at general market places appears to be tedious. I would be very interested in others' experiences, and inhowfar my opinion is shared that there should be a demand for such a market place, for developer teams as well as those sympathizing with introducing Haskell somewhere. Nick ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
Interop between Haskell and Java is too difficult to be practical. And I stand by my statement that no Java shop is going to switch over to Haskell, precisely because they cannot afford to abandon either their existing investment, or the _billions of dollars_ worth of commercial- friendly open source libraries available for the Java platform. But I do agree on this: the JVM does indeed need a Haskell-like language. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 8:10 PM, Curt Sampson wrote: On 2009-09-27 10:36 -0600 (Sun), John A. De Goes wrote: I'm not sure what the point of your series is. No one who is using Java now commercially can move to Haskell because Haskell doesn't run on the JVM. That's a rather strong statement, and I don't accept it. I can not only think of many possible circumstances where it would be possible for a Java-using shop to write a piece of software that doesn't run on the JVM, but I have sween many of these. There are lots of shops out there using, e.g., C++ code as well as Java code, who are already obviously able to use non-JVM languages. Given that, one point would be to show that there are more benefits to be gained by switching from Java to Haskell than there are from switching from Java to one of the other languages mentioned. This may be enough to tip some shops into Haskell. Second, it might inspire people to have a look at bringing a more Haskell-like language to the JVM, or add more Haskell-like features to existing JVM languages. Third, even if a shop is not going to switch, having people understand what's out there, and where many of these ideas come from, is a good thing, I feel. cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
CAL is interesting, but unfortunately dead, and has no community. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 3:38 PM, Peter Verswyvelen wrote: That's not really true. Just use CAL from the Open Quark framework... It's almost Haskell 98, with some extras, and compiles to fast JVM code. http://openquark.org/Open_Quark/Welcome.html They even seem to do all kinds of advanced optimizations - like converting tail calls to loops - to get good Java performance. And they have a better record system, a graphical environment to learn it, etc. So I think CAL should be in the list, and since it's basically Haskell... On Sun, Sep 27, 2009 at 6:36 PM, John A. De Goes j...@n-brain.net wrote: I'm not sure what the point of your series is. No one who is using Java now commercially can move to Haskell because Haskell doesn't run on the JVM. It makes sense to discuss Clojure, Groovy, JRuby, Scala, Fan, etc., as next Java's, because they all run on the JVM and have seamless interop with Java. Haskell is not in this category. It's stuck in a different world, wholly inaccessible to the masses. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 10:16 AM, Curt Sampson wrote: No, it's not quite what it sounds like. :-) Stuart Halloway recently posted a series of blog entries entitled Java.next[1], discussing the benefits of four other languages that compile to JVM bytecode and interoperate with Java: Clojure, Groovy, JRuby, and Scala. I thought I'd put my oar in and write a parallel series comparing Haskell to these. I've finished a draft of the first posting, started on the third, and made a couple of notes on the second and fourth, and I thought I'd post the drafts[2] and solicit comments here. If you have time to read and comment, I'd greatly appreciate the help; feel free either to e-mail me privately or post here. Also feel free to forward this to anybody else you feel might be interested in commenting. I'll probably be posting these about one per week, starting some time next week. [1]: http://blog.thinkrelevance.com/2008/9/24/java-next-overview [2]: http://www.starling-software.com/en/blog/drafts/2009/09/27.succ-java-summary.html cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] unicode text libraries
Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Thanks titto -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Market Place for Haskell development teams?
It's very difficult to find information on: 1. How many Haskell developers are out there; 2. What a typical salary is for a Haskell developer; 3. Whether or not the skills of a typical Haskell developer scale to large applications (most Haskell developers are hobby Haskellers and have only written tiny to small Haskell apps); 4. How many shops are capable of handling Haskell development maintenance. These are the kinds of information one needs to make an informed decision about whether to introduce Haskell into the workplace. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 28, 2009, at 7:01 AM, Jörg Roman Rudnick wrote: In the last months, I made the experience it seems difficult to find commercial Haskell developer teams to take responsibility for projects in the range of $ 10.000 - 100.000. The Industrial Haskell Group does not seem to be the appropriate place for this, while harvesting Haskell team at general market places appears to be tedious. I would be very interested in others' experiences, and inhowfar my opinion is shared that there should be a demand for such a market place, for developer teams as well as those sympathizing with introducing Haskell somewhere. Nick ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
On 2009-09-28 07:01 -0600 (Mon), John A. De Goes wrote: And I stand by my statement that no Java shop is going to switch over to Haskell I have counterexamples. So pt! ...or the _billions of dollars_ worth of commercial- friendly open source libraries available for the Java platform. Right; the library myth. I rank this one up there with, Haskell can never be an effective programming language, because it doesn't have objects. I've been hearing that having lots of libraries is an insurmountable advantage, and you're doomed if you give them up, since long before I took up Haskell. It's mostly myth promulgated by people driven by fear. I'm sure it's the case in some shops that they have lots of people who can glue libraries together but can't program, and they somehow manage to produce applications this way, but even that I suspect is not so frequent a situation as you'd think. Nonetheless, since all of this is rather missing the point of my articles, anyway, I think I'll leave that as my last word on the topic. cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
If you have counterexamples, then perhaps you can name them. I'm looking for Java shops with 5+ developers and code bases of 100k converting over to Haskell. I don't know _any such shop_ that has switched to Haskell, and I doubt any exist, but I'd be delighted to learn I'm wrong. Let me ask you this question: how long would it take you to get an HTML/CSS, W3 compliant browser in Haskell? Or how about a peer-to-peer networking system with seamless scaling and automatic failover? How about a scalable BigTable implementation? In Java, the answer to these questions -- and just about any others you can think of -- is a few minutes, because the code has already been written. Libraries are _everything_. In many cases, they can increase your effective budget by 10x or even 100x. That means instead of having $100k for a project, you suddenly have $1 - 10 million worth of resources at your disposal. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 28, 2009, at 7:49 AM, Curt Sampson wrote: On 2009-09-28 07:01 -0600 (Mon), John A. De Goes wrote: And I stand by my statement that no Java shop is going to switch over to Haskell I have counterexamples. So pt! ...or the _billions of dollars_ worth of commercial- friendly open source libraries available for the Java platform. Right; the library myth. I rank this one up there with, Haskell can never be an effective programming language, because it doesn't have objects. I've been hearing that having lots of libraries is an insurmountable advantage, and you're doomed if you give them up, since long before I took up Haskell. It's mostly myth promulgated by people driven by fear. I'm sure it's the case in some shops that they have lots of people who can glue libraries together but can't program, and they somehow manage to produce applications this way, but even that I suspect is not so frequent a situation as you'd think. Nonetheless, since all of this is rather missing the point of my articles, anyway, I think I'll leave that as my last word on the topic. cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: ListTree 0.1
Hi, I haven't seen that paper. I certainly agree with their point that Haskell easily allows to separate the code of the search and pruning algorithms from the code of the search-space etc. It seems that my package and their paper focus on different algorithms. They mostly focus on pruning methods, and it seems that the order they search in is always depth-first, although sometimes with reordering of nodes' children. They also use a different structure for the search trees. Theirs is like Data.Tree's. My package uses monadic trees (like ListT []) and so allows the iteration of the tree to be monadic, allowing to add stateful pruning to the mix (by adding a StateT to the tree's underlying monad). In their paper they also describe stateful pruning methods, but if I understand correctly, the consumption of the trees has to be made by their backtracking functions which are aware of their pruning methods. cheers, Yair On Sep 27, 9:35 pm, wren ng thornton w...@freegeek.org wrote: yair...@gmail.com wrote: Hi, I am pleased to announce the release of ListTree. ListTree is a package for combinatorial search and pruning of trees, and should be useful for problems such as those in Google Code Jam (where I, and possibly others* could make use of it), but possibly could even be useful for real applications! [...] One problem with my package (which I'll attempt fixing), however, is speed. I haven't used it during the competition, and the quick and dirty, less modular code, that I coded in the competition, which performs exactly the same algorithm, runs a 100 times faster! Both are fast enough, but this is still troubling. I guess I should look into Stream Fusion to try and make my package faster. Have you seen Andrew Tolmach Thomas Nordin's Modular Lazy Search for Constraint Satisfaction Problems? They describe a very similar project which incorporates many of the common optimizations in the field (backjumping, backmarking, forward-checking, fail-first,...) and provide their code as well. paper:http://web.cecs.pdx.edu/~apt/jfp01.ps code: http://web.cecs.pdx.edu/~apt/CSP_jfp.hs -- Live well, ~wren ___ Haskell-Cafe mailing list haskell-c...@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
John A. De Goes wrote: If you have counterexamples, then perhaps you can name them. I'm looking for Java shops with 5+ developers and code bases of 100k converting over to Haskell. I don't know _any such shop_ that has switched to Haskell, and I doubt any exist, but I'd be delighted to learn I'm wrong. http://portal.acm.org/citation.cfm?doid=1596550.1596578 Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Comments requested: succ Java
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Edward Middleton If you have counterexamples, then perhaps you can name them. I'm looking for Java shops with 5+ developers and code bases of 100k converting over to Haskell. I don't know _any such shop_ that has switched to Haskell, and I doubt any exist, but I'd be delighted to learn I'm wrong. http://portal.acm.org/citation.cfm?doid=1596550.1596578 If you lack an ACM subscription, then this is likely the same document: http://www.starling-software.com/misc/icfp-2009-cjs.pdf Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Cheers -nwn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Comments requested: succ Java
Hello Edward, Monday, September 28, 2009, 6:26:12 PM, you wrote: If you have counterexamples, then perhaps you can name them. I'm looking for Java shops with 5+ developers and code bases of 100k converting over to Haskell. I don't know _any such shop_ that has switched to Haskell, and I doubt any exist, but I'd be delighted to learn I'm wrong. http://portal.acm.org/citation.cfm?doid=1596550.1596578 citation: we thought we might have to interface with Java libraries. This turned out not to be the case -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
On Mon, Sep 28, 2009 at 10:59 AM, Yusaku Hashimoto nonow...@gmail.com wrote: After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Cheers -nwn I don't think there's any automated way to come up with good properties given a function; that seems tantamount to solving AI. One thing I've meant to do is look at checkers: http://hackage.haskell.org/package/checkers - which I understand includes a collection of lots of properties for various datatypes and classes. Presumably you could look through it for ideas ('ooh, I forgot that my results should monotonically increase!') or pick the module closest to what you're testing and steal as many of its properties as you can. -- gwern signature.asc Description: OpenPGP digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
Not sure this is what you want, but I thought I'd mention Formal Specifications for Free: http://www.erlang.org/euc/08/1005Hughes2.pdf (I wasn't able to find a better link. That talk is for Erlang, but people are working on this for Haskell QuickCheck.) / Emil Yusaku Hashimoto skrev: After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Cheers -nwn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: frag game-compiling error
Lyndon Maydwell wrote: src/Quaternion.hs:22:27 This would probably be the place to start. Ok,I managed to get past the error like this: newMatrix ColumnMajor [realToFrac r00,realToFrac r01,realToFrac r02,realToFrac r03, realToFrac r10,realToFrac r11,realToFrac r12,realToFrac r13, realToFrac r20,realToFrac r21,realToFrac r22,realToFrac r23, realToFrac r30,realToFrac r31,realToFrac r32,realToFrac r33] So Quaternion.hs compiled fine,but now it gives error messages in another file. As far as I understand, this games code is incompatible with the new version of haskell opengl libraries. Am I right? -- View this message in context: http://www.nabble.com/frag-game-compiling-error-tp25638949p25645411.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
titto: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Data.Text ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
That's a really shame. Any idea why? On Mon, Sep 28, 2009 at 3:02 PM, John A. De Goes j...@n-brain.net wrote: CAL is interesting, but unfortunately dead, and has no community. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 3:38 PM, Peter Verswyvelen wrote: That's not really true. Just use CAL from the Open Quark framework... It's almost Haskell 98, with some extras, and compiles to fast JVM code. http://openquark.org/Open_Quark/Welcome.html http://openquark.org/Open_Quark/Welcome.htmlThey even seem to do all kinds of advanced optimizations - like converting tail calls to loops - to get good Java performance. And they have a better record system, a graphical environment to learn it, etc. So I think CAL should be in the list, and since it's basically Haskell... On Sun, Sep 27, 2009 at 6:36 PM, John A. De Goes j...@n-brain.net wrote: I'm not sure what the point of your series is. No one who is using Java now commercially can move to Haskell because Haskell doesn't run on the JVM. It makes sense to discuss Clojure, Groovy, JRuby, Scala, Fan, etc., as next Java's, because they all run on the JVM and have seamless interop with Java. Haskell is not in this category. It's stuck in a different world, wholly inaccessible to the masses. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 10:16 AM, Curt Sampson wrote: No, it's not quite what it sounds like. :-) Stuart Halloway recently posted a series of blog entries entitled Java.next[1], discussing the benefits of four other languages that compile to JVM bytecode and interoperate with Java: Clojure, Groovy, JRuby, and Scala. I thought I'd put my oar in and write a parallel series comparing Haskell to these. I've finished a draft of the first posting, started on the third, and made a couple of notes on the second and fourth, and I thought I'd post the drafts[2] and solicit comments here. If you have time to read and comment, I'd greatly appreciate the help; feel free either to e-mail me privately or post here. Also feel free to forward this to anybody else you feel might be interested in commenting. I'll probably be posting these about one per week, starting some time next week. [1]: http://blog.thinkrelevance.com/2008/9/24/java-next-overview [2]: http://www.starling-software.com/en/blog/drafts/2009/09/27.succ-java-summary.html cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
tittoassini: 2009/9/28 Don Stewart d...@galois.com: titto: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Data.Text Thanks , but .. why? Sorry, was on the way out the door. Data.Text has growing use, is well designed, and builds on the pedigree of bytestring and the vector* series of fusion libraries. I trust that code. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
On Mon, Sep 28, 2009 at 6:15 PM, Don Stewart d...@galois.com wrote: tittoassini: 2009/9/28 Don Stewart d...@galois.com: titto: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Data.Text Thanks , but .. why? Sorry, was on the way out the door. Data.Text has growing use, is well designed, and builds on the pedigree of bytestring and the vector* series of fusion libraries. I trust that code. I agree with Don. Also, I don't think that a Unicode type should mention what encoding it uses as it's an implementation detail. -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hackage bug? Autobuild failure on literate source with ignored code blocks.
On Sun, 2009-09-27 at 21:06 +0100, John Millikin wrote: According to http://www.haskell.org/haskellwiki/Literate_programming, the following should compile properly because the second block of code will be ignored by GHC: \begin{code} main = putStrLn Hello world! \end{code} \begin{code}% main = -- TODO \end{code}% It looks to me like the advice on that wiki page is incorrect. The Haskell98 report states: An alternative style of literate programming is particularly suitable for use with the LaTeX text processing system. In this convention, only those parts of the literate program that are entirely enclosed between \begin{code}...\end{code} delimiters are treated as program text; all other lines are comment. More precisely: * Program code begins on the first line following a line that begins \begin{code}. * Program code ends just before a subsequent line that begins \end{code} (ignoring string literals, of course). The key phrases is a line that begins \begin{code}. In other words, a line \begin{code}% does indeed begin a code block. However, Hackage's automatic build system seems to pre-process the literate source in such a way that the ignored block is included in the .hs source, resulting in a compilation error: Right. Having checked the H98 report I think this is the correct behaviour. Although Hackage fails to build the package, it works fine on my local system when I run cabal configure cabal build cabal haddock. Is this a bug in the Hackage auto-build mechanism, or have I done something wrong when uploading the package? It looks like ghc gets this wrong and ignores \begin{code}%. I have filed this as http://hackage.haskell.org/trac/ghc/ticket/3549 Your local Cabal version is older than the one Hackage is using and that older version lets haddock (ie ghc) do the pre-processing where as in the current version Cabal does the unlitting before running haddock. That explains the difference you observe. The solution is not to use \begin{code}% and assume it will not be recognised as the start of a code block. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
On Mon, 2009-09-28 at 23:59 +0900, Yusaku Hashimoto wrote: After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. This requires thought and practise. The properties are a partial formal description of what your program does. You have to decide what your program is supposed to do. There is no magic here. Sometimes you find that you adjust your properties to fit the program and sometimes adjust the program to fit the properties. To gain experience in thinking about properties of programs you probably want to look at books and articles and try examples. This is the kind of thing they teach in CS degrees. It is a matter of training yourself. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
On Mon, 2009-09-28 at 14:16 +0100, Titto Assini wrote: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? I would use the text package because in my opinion it has a better API. It is the hope of several of us that the text package will become the standard Unicode counterpart to ByteString and be included in the platform. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
Fantastic. If I understand correctly it inductively derives equations that hold for a set of examples. I am looking forward to see it in Haskell, who is working on the port? titto 2009/9/28 Emil Axelsson e...@chalmers.se: Not sure this is what you want, but I thought I'd mention Formal Specifications for Free: http://www.erlang.org/euc/08/1005Hughes2.pdf (I wasn't able to find a better link. That talk is for Erlang, but people are working on this for Haskell QuickCheck.) / Emil Yusaku Hashimoto skrev: After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Cheers -nwn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
Ok, my last post on this for real this time. On 2009-09-28 08:13 -0600 (Mon), John A. De Goes wrote: Let me ask you this question: how long would it take you to get an HTML/CSS, W3 compliant browser in Haskell? A long time. On the other hand, by grabbing a copy of Mozilla, I'll have one far faster than you'll have yours in Java, mine will work a lot better, run more quickly, and work better with most sites. While I advocate using Haskell, I don't advocate being silly. (Incidently, I have direct experience with an almost exactly parallel situation. I replaced a system that was thousands of lines of difficult-to-maintain Java code with a few hundred lines of Haskell that feed Microsoft Excel. The user is very pleased that he can now can do far more extensive tweaking of the UI himself, including major features he never had at all before, such as real-time graphing of the data.) Or how about a peer-to-peer networking system with seamless scaling and automatic failover? Can you give me an example of a real-life system using this you've set up in a few minutes? My experience building systems with similar things (the very mature and proven MogileFS suite of tools) has been that the libraries were nice, but did not solve the majority, or even a large minority, of the problem. Libraries are _everything_. In many cases, they can increase your effective budget by 10x or even 100x. Or the other way around, as I've seen by ripping out thousands of lines of Hibernate code, and all of the work done to adapt a system to that model, and replace it with a few hundred lines of SQL and JDBC calls. That library has probably wasted more man-years than anything else I've seen in the Java world. cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
2009/09/28 John A. De Goes j...@n-brain.net: Libraries are _everything_... Not exactly. Python would never have gotten a foothold over Perl, nor Java over C, if cleaner language semantics weren't enough for some shops or certain applications. -- Jason Dusek ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
I think they made a mistake choosing a syntax so close to Haskell: 1. It's close enough to Haskell to attract Haskellers; 2. It's far enough away from Haskell to push Haskellers away; 3. It's not the language one would design if one were prioritizing easy interop with Java in a modern lazy, functional language. If CAL were 100% Haskell 98 + extensions, it would be a success (Haskell + all Java libraries, trivial cross-platform library development, Haskell on Android AppEngine, etc.). If it were nothing like Haskell, but had the features of Haskell plus strong, seamless, and easy Java interop, then it would be a success. Having neither, I'm not surprised it has no community and development has ceased. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 28, 2009, at 9:59 AM, Peter Verswyvelen wrote: That's a really shame. Any idea why? On Mon, Sep 28, 2009 at 3:02 PM, John A. De Goes j...@n-brain.net wrote: CAL is interesting, but unfortunately dead, and has no community. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 3:38 PM, Peter Verswyvelen wrote: That's not really true. Just use CAL from the Open Quark framework... It's almost Haskell 98, with some extras, and compiles to fast JVM code. http://openquark.org/Open_Quark/Welcome.html They even seem to do all kinds of advanced optimizations - like converting tail calls to loops - to get good Java performance. And they have a better record system, a graphical environment to learn it, etc. So I think CAL should be in the list, and since it's basically Haskell... On Sun, Sep 27, 2009 at 6:36 PM, John A. De Goes j...@n-brain.net wrote: I'm not sure what the point of your series is. No one who is using Java now commercially can move to Haskell because Haskell doesn't run on the JVM. It makes sense to discuss Clojure, Groovy, JRuby, Scala, Fan, etc., as next Java's, because they all run on the JVM and have seamless interop with Java. Haskell is not in this category. It's stuck in a different world, wholly inaccessible to the masses. Regards, John A. De Goes N-Brain, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Sep 27, 2009, at 10:16 AM, Curt Sampson wrote: No, it's not quite what it sounds like. :-) Stuart Halloway recently posted a series of blog entries entitled Java.next[1], discussing the benefits of four other languages that compile to JVM bytecode and interoperate with Java: Clojure, Groovy, JRuby, and Scala. I thought I'd put my oar in and write a parallel series comparing Haskell to these. I've finished a draft of the first posting, started on the third, and made a couple of notes on the second and fourth, and I thought I'd post the drafts[2] and solicit comments here. If you have time to read and comment, I'd greatly appreciate the help; feel free either to e-mail me privately or post here. Also feel free to forward this to anybody else you feel might be interested in commenting. I'll probably be posting these about one per week, starting some time next week. [1]: http://blog.thinkrelevance.com/2008/9/24/java-next-overview [2]: http://www.starling-software.com/en/blog/drafts/2009/09/27.succ-java-summary.html cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
On Mon, 2009-09-28 at 18:32 +0200, Johan Tibell wrote: On Mon, Sep 28, 2009 at 6:15 PM, Don Stewart d...@galois.com wrote: tittoassini: 2009/9/28 Don Stewart d...@galois.com: titto: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Also, I don't think that a Unicode type should mention what encoding it uses as it's an implementation detail. I would put it more strongly. The encoding should not be in the API because it makes it harder to compose functionality. While there may be some circumstances where for performance reasons you may want precise control over the internal encoding, that is not appropriate to use in component interfaces. I know we've made this worse recently, but a proliferation of different string types makes it harder to reuse code. An exposed encoding parameter makes that even worse. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hackage bug? Autobuild failure on literate source with ignored code blocks.
On Sep 28, 2009, at 12:21 , Duncan Coutts wrote: On Sun, 2009-09-27 at 21:06 +0100, John Millikin wrote: According to http://www.haskell.org/haskellwiki/ Literate_programming, the following should compile properly because the second block of code will be ignored by GHC: \begin{code} main = putStrLn Hello world! \end{code} \begin{code}% main = -- TODO \end{code}% It looks to me like the advice on that wiki page is incorrect. The Haskell98 report states: An alternative style of literate programming is particularly suitable for use with the LaTeX text processing system. In this convention, only those parts of the literate program that are entirely enclosed between \begin{code}...\end{code} delimiters are treated as program text; all other lines are comment. More precisely: * Program code begins on the first line following a line that begins \begin{code}. * Program code ends just before a subsequent line that begins \end{code} (ignoring string literals, of course). The key phrases is a line that begins \begin{code}. In other words, a line \begin{code}% does indeed begin a code block. Isn't the better solution to this something like \let\uncode\code \let\enduncode\endcode then use \begin{uncode} .. \end{uncode} ? (depends on how the code environment is defined) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] river crossing puzzle
Hi, Does anyone know where there are any Haskell implementations of the the River Crossing puzzle (AKA Farmer/Fox/Goose/Grain). There are several variations but the general ideas are explained at: http://en.wikipedia.org/wiki/River_crossing_puzzle http://en.wikipedia.org/wiki/Fox,_goose_and_bag_of_beans_puzzle I have found one at: http://www.shido.info/hs/haskell9.html Thanks, Pat ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
Pasqualino Titto Assini skrev: Fantastic. If I understand correctly it inductively derives equations that hold for a set of examples. AFAIU, it enumerates a set of terms and uses random testing to approximate an equivalence relation for these. The real trick, apparently, is in filtering out the interesting equations. I am looking forward to see it in Haskell, who is working on the port? John Hughes, Koen Claessen and Nick Smallbone. (At least.) / Emil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hackage bug? Autobuild failure on literate source with ignored code blocks.
In that case, I'll update my code and the wiki to use an alternative code style. On Mon, Sep 28, 2009 at 09:21, Duncan Coutts duncan.cou...@googlemail.com wrote: Your local Cabal version is older than the one Hackage is using and that older version lets haddock (ie ghc) do the pre-processing where as in the current version Cabal does the unlitting before running haddock. That explains the difference you observe. Since Hackage is using an unstable development build of Cabal, I'd like to force it to use a released version to prevent such an issue from occurring again. I've added the following line to my .cabal file: cabal-version: = 1.6 1.7 However, when testing with Cabal 1.7.3 (which is the version used by Hackage), I am warned that: - Warning: dbus-core.cabal: This package requires Cabal version: =1.6 1.7 Distribution quality errors: This package requires Cabal version: =1.6 1.7 Note: the public hackage server would reject this package. - Does this mean that it's impossible to require an earlier version of Cabal in Hackage-published packages? If so, the use of a development version of Cabal in the auto-build system seems unwise. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: QuickCheck Questions
Yusaku Hashimoto wrote: So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Dijkstra would have said a good program (or program fragment, such as a library or even a single function) should /start out/ with properties, ideally a set of properties which completely specifies the program's output/behaviour. The implementation should then be structured in a way that makes it possible to prove (with reasonable effort) that the properties hold (and runnign QC on these properties then merely tests whether your proof was erroneous). Thus your problem is solved by construction. However, in practice we most often start out with only a vague idea of what our program should do. After hacking away for a time, however, we usually arrive at a level of granularity (individual small functions) where we have a more or less precise idea what we want it to achieve. It is then a matter of making this specification as precise as possible. If it turns out that a precise spec is unwieldy (too complex) then this is a hint that maybe it is not a good abstraction. Try to generalize or otherwise simplify the spec (refactoring the program) until you arrive at something manageable. It should then be possible to formalize this specification and convert it into a QC property. I think that this process is not something that can be automated (in general). Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] combinatorial search with running bound
On Sat, 26 Sep 2009, Michael Mossey wrote: I have a combinatorial search problem that requires a running lower bound to be tracked in order to prune the search. I have enough Haskell experience to know how to do a combinatorial search, for example with list compresions or the list monad, but I don't know how to keep a running lower bound. Sometimes the omega monad can help by searching the space in a diagonal manner: http://hackage.haskell.org/package/control-monad-omega ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: QuickCheck Questions
Ben Franksen wrote: If it turns out that a precise spec is unwieldy (too complex) then this is a hint that maybe it is not a good abstraction. Or your specification language is insufficient to describe it... (I don't know about anybody else, but I find that when I use QC, about 75% of the bugs reported are bugs in the spec, and only 25% are bugs in the thing I'm actually trying to test...) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Writing tool question (may be out of scope here)
Hi, Excuse me if that is out of subject here, but does anyone know which tool/writing framework was used to write the Real world Haskell book ? I'm wondering, in particular, about the capability to write/edit/publish it online while allowing people to leave comments, then have a paperback/PDF version. Thanks in advance, -- Saul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] 16 bit floating point data in Haskell?
On Sun, 27 Sep 2009, Olex P wrote: Hi guys, Do we have anything like half precision floats in Haskell? Maybe in some non standard libraries? Or I have to use FFI + OpenEXR library to achieve this? If you only want to save storage, you may define newtype Float16 = Float16 Int16 and write Num, Fractional and Floating instances that convert operands to Float, perform operations on Float and put the results back to Int16. By some fusion you may save conversions, but you would also get different results due to higher precision. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] GADT pattern match in non-rigid context
Dear all, The following is a (I'm afraid too large!) fragment of a program implementing a GADT-based generic zipper: ** data Zipper path where Zipper :: hole - Context (Up (left, hole, right) up) - Zipper (Up (left, hole, right) up) data Context path where ContTop :: Context (Up (Top, a, Top) Top) Cont:: Left l (h - r) - Right r h_parent - Context (Up (l_parent, h_parent, r_parent) path) - Context (Up (l, h, r) (Up (l_parent, h_parent, r_parent) path)) data Up a b data Top data Left contains expects where LeftUnit :: a - Left Top a LeftCons :: Left c (b - a) - b - Left (c - b) a data Right provides final where RightNull :: Right final final RightCons :: b - Right a final - Right (b - a) final data Erase c a = forall b. (Typeable b) = Erase (c b a) ff :: (Typeable l, Data h, Typeable r, Typeable up) = Zipper (Up (l, h, r) up) - Erase Left h ff (Zipper h c) = (gfoldl erased_left_cons erased_left_unit h) gg :: (Typeable l_down, Typeable h_down, Data h) = Erase Left h - Maybe (Left (l_down - h_down) h) gg (Erase l) = cast l move_down :: (Typeable l_down, Typeable h_down, Typeable l, Data h, Typeable r, Typeable up) = Zipper (Up (l, h, r) up) - Maybe (Zipper (Up (l_down, h_down, h) (Up (l, h, r) up))) move_down z@(Zipper h c) = case gg (ff z) of # Just (LeftCons l' h_down) - Just (Zipper h_down (Cont l' RightNull c)) Nothing - Nothing instance Typeable Top where typeOf _ = mkTyConApp (mkTyCon Top) [] instance Typeable2 Left where typeOf2 _ = mkTyConApp (mkTyCon Left) [] instance Typeable2 Up where typeOf2 _ = mkTyConApp (mkTyCon Up) [] erased_left_cons :: (Typeable b) = Erase Left (b - a) - b - Erase Left a erased_left_cons (Erase c) b = Erase (LeftCons c b) erased_left_unit :: a - Erase Left a erased_left_unit a = Erase (LeftUnit a) ** Compiling it with GHC 6.10.4 yelds the error: *** GADT pattern match in non-rigid context for `LeftCons' Solution: add a type signature In the pattern: LeftCons l' h_down[marked with # in the code] *** The suggestion is quite clear :D (in fact, I think this compiler suggestion is the result of previous interactions in this mailing list) The thing is that, in order to add a type signature to the suggested pattern, I believe I have to use the type variables in the signature of function 'move_down' (which I don't think is possible); Can anyone help me with this? I believe this code has compiled before, on previous GHC versions... Thank you very much, João -- João Paulo Fernandes Universidade do Minho www.di.uminho.pt/~jpaulo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GADT pattern match in non-rigid context
On Sep 28, 2009, at 17:56 , João Paulo wrote: GADT pattern match in non-rigid context for `LeftCons' Solution: add a type signature In the pattern: LeftCons l' h_down[marked with # in the code] The suggestion is quite clear :D (in fact, I think this compiler suggestion is the result of previous interactions in this mailing list) The thing is that, in order to add a type signature to the suggested pattern, I believe I have to use the type variables in the signature of function 'move_down' (which I don't think is possible); You want the ScopedTypeVariables extension. Read the documentation before using; you need to explicitly forall the type variables you want to use later. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
On Mon, Sep 28, 2009 at 9:15 AM, Don Stewart d...@galois.com wrote: tittoassini: 2009/9/28 Don Stewart d...@galois.com: titto: Hi, I am looking for an unicode strings library, I found on hackage: http://hackage.haskell.org/package/compact-string http://hackage.haskell.org/package/text They both look solid and functionally complete so ... I don't know which one to use :-) As I am sure I am not the first one facing this choice, may I ask which one you preferred and why? Data.Text Thanks , but .. why? Sorry, was on the way out the door. Data.Text has growing use, is well designed, and builds on the pedigree of bytestring and the vector* series of fusion libraries. I trust that code. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe I just have a question out of curiosity - why was the decision made to have Data.Text, uvector, and ByteString all separate data structures, rather than defining the string types in terms of uvector? Alex ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
On Mon, Sep 28, 2009 at 3:00 PM, Alexander Dunlap alexander.dun...@gmail.com wrote: I just have a question out of curiosity - why was the decision made to have Data.Text, uvector, and ByteString all separate data structures, rather than defining the string types in terms of uvector? bytestring predates the other two libraries by several years. The underlying stream type for uvector and text are almost the same, so they could in principle be merged. There's a fair amount of duplication there, but uvector is in some ways more complicated and in others much less thorough than text. Merging them would be a lot of work! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: QuickCheck Questions
On Mon, Sep 28, 2009 at 3:28 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Ben Franksen wrote: If it turns out that a precise spec is unwieldy (too complex) then this is a hint that maybe it is not a good abstraction. Or your specification language is insufficient to describe it... (I don't know about anybody else, but I find that when I use QC, about 75% of the bugs reported are bugs in the spec, and only 25% are bugs in the thing I'm actually trying to test...) Maybe that means that you don't apply the same level of care to testing as you do to coding your main program. Or perhaps that is the quality of many bugs: the code does exactly what I intended, but what I intended was wrong. Luke ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries
Hi Bryan and others, On Mon, Sep 28, 2009 at 5:29 PM, Bryan O'Sullivan b...@serpentine.com wrote: bytestring predates the other two libraries by several years. The underlying stream type for uvector and text are almost the same, so they could in principle be merged. There's a fair amount of duplication there, but uvector is in some ways more complicated and in others much less thorough than text. Merging them would be a lot of work! If I may free-ride on this thread: how should one go about deriving a Data.Binary instance for text? It looks like doing it efficiently would require using some parts of the internal module that are not exposed, am I correct? I've been using encodeUtf8, but that doesn't feel right. I don't know what to do, hopefully I'm missing something simple. I agree with Duncan, the text API is beautifully designed. Thanks! Paulo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] river crossing puzzle
pat browne wrote: Hi, Does anyone know where there are any Haskell implementations of the the River Crossing puzzle (AKA Farmer/Fox/Goose/Grain). I wrote some code to generate a map of some version of the game: https://code.goto10.org/svn/maximus/2009/boatman/BoatMan.hs ghc -O2 --make BoatMan.hs ./BoatMan | neato -Tpng | display Claude -- http://claudiusmaximus.goto10.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Doing people's homework?
I'm not really hip to the culture here so this is just an observation, but some of the recent questions posted to this list (and beginn...@haskell.org) look a lot like someone's homework. Is anyone here concerned about avoiding giving the full answer, or maybe it's really none of our business (we aren't responsible for anyone's learning process)? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
On 29/09/2009, at 1:59 AM, Peter Verswyvelen wrote: That's a really shame. Any idea why? On Mon, Sep 28, 2009 at 3:02 PM, John A. De Goes j...@n-brain.net wrote: CAL is interesting, but unfortunately dead, and has no community. I think Haskell users would miss too many of the post 98 extensions -- overlapping instances, multi parameter type classes and many other things. I've had a lot of enjoyment using CAL for hobby projects and learning about fp, while still being able leverage the Java ecosystem I am so familiar with (I'm in the 'libraries matter' camp, although I agree with Curt on the uncertain benefits of Hibernate). I believe that it's high enough quality to use in production as part of a Java based product, but, so far, I just don't have enough free time to do anything substantial. I hope one day to use CAL to teach myself a bit more about types without getting lost in the (assumed) complexity of GHC. For instance I'd like to replace the CAL type system with HMF. Note that while it is 'dead', it isn't broken or bit-rotted -- everything still works, including the Eclipse plugin. Tom ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Doing people's homework?
I think the consensus is Help, not do when it comes to homework (esp. on -beginners). At least, thats what I try to do. I've always got the sense that that is what the community expects. On Sep 28, 2009, at 7:40 PM, Michael P Mossey wrote: I'm not really hip to the culture here so this is just an observation, but some of the recent questions posted to this list (and beginn...@haskell.org) look a lot like someone's homework. Is anyone here concerned about avoiding giving the full answer, or maybe it's really none of our business (we aren't responsible for anyone's learning process)? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Doing people's homework?
I think the consensus is Help, not do when it comes to homework (esp. on -beginners). At least, thats what I try to do. I've always got the sense that that is what the community expects. Yep, there's a whole policy on this. http://www.haskell.org/haskellwiki/Homework_help TomMD ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Doing people's homework?
Am Dienstag 29 September 2009 01:40:02 schrieb Michael P Mossey: I'm not really hip to the culture here so this is just an observation, but some of the recent questions posted to this list (and beginn...@haskell.org) look a lot like someone's homework. Is anyone here concerned about avoiding giving the full answer, or maybe it's really none of our business (we aren't responsible for anyone's learning process)? The (unofficial and not enforceable) policy is here: http://www.haskell.org/haskellwiki/Homework_help If you notice somebody wants you to do their homework, you don't. If the proper questions are asked, you help (guide into the right direction). If you don't realize soon enough that somebody wanted their homework done and you've given a complete answer, hopefully their instructors read the lists, too. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Doing people's homework?
I'm not really hip to the culture here so this is just an observation, but some of the recent questions posted to this list (and beginn...@haskell.org) look a lot like someone's homework. Well, if homework looks like homework, the teacher is guilty of cheating. Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Doing people's homework?
If you do a student's homework, you are cheating that student out of an education. He/She may realize that t late in the future. -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
I think a language needs the following to exist: - a community - good library - a package manager Thoughts? -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
I think one must distinguish what it means for a language to exist and be practical. Counter-example: Java fails catastrophically at all three and it most certainly exists; boy do I know it. Casey Hawthorne wrote: I think a language needs the following to exist: - a community - good library - a package manager Thoughts? -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
On Tue, 29 Sep 2009 12:25:30 +1000, you wrote: I think one must distinguish what it means for a language to exist and be practical. Counter-example: Java fails catastrophically at all three and it most certainly exists; boy do I know it. QOTM! Casey Hawthorne wrote: I think a language needs the following to exist: - a community - good library - a package manager Thoughts? -- -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. On Mon, Sep 28, 2009 at 9:25 PM, Tony Morris tonymor...@gmail.com wrote: I think one must distinguish what it means for a language to exist and be practical. Counter-example: Java fails catastrophically at all three and it most certainly exists; boy do I know it. Casey Hawthorne wrote: I think a language needs the following to exist: - a community - good library - a package manager Thoughts? -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
On Mon, 28 Sep 2009 21:50:14 -0500, you wrote: Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. Good thought! Is there a good way to add Haskell examples to the libraries? -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Debugging Haskell code
On Sun, Sep 27, 2009 at 3:50 PM, Paul Moore p.f.mo...@gmail.com wrote: The problem is that I have *no idea* how to begin debugging this. I've had great success debugging a large program by loading the Main module into ghci after setting GHC extensions, changing the search path, and setting break on errors. If you then place calls to the error function at the right location, and trace the execution, you'll be able to get a stack trace of the context in which the error function was called. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
On Mon, 28 Sep 2009 21:50:14 -0500, you wrote: Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. Good thought! Is there a good way to add Haskell examples to the libraries? A Haskell CookBook might be just the ticket, also. -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
A Cook Book is good but relies on people specifically working on it. I think most of the package authors submit their packages because they themselves need the modules in his real world. I think package authors adding examples in the Descriptions section is a good start when they submit their packages. You do want to facilitate people understanding and using your modules, right? Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock. Also, having a section for comments is helpful. This is the case especially when there are several similar packages coexisting, comments can help people choose which one to use. Thanks, Hong On Mon, Sep 28, 2009 at 9:55 PM, Casey Hawthorne cas...@istar.ca wrote: On Mon, 28 Sep 2009 21:50:14 -0500, you wrote: Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. Good thought! Is there a good way to add Haskell examples to the libraries? A Haskell CookBook might be just the ticket, also. -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
On Mon, Sep 28, 2009 at 11:11 PM, Hong Yang hyang...@gmail.com wrote: [...] Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock. Also, having a section for comments is helpful. This is the case especially when there are several similar packages coexisting, comments can help people choose which one to use. Thanks, Hong [...] +1 I'd love to see more examples in the Haddock documentation for packages. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
brad.larsen: On Mon, Sep 28, 2009 at 11:11 PM, Hong Yang hyang...@gmail.com wrote: [...] Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock. Also, having a section for comments is helpful. This is the case especially when there are several similar packages coexisting, comments can help people choose which one to use. Thanks, Hong [...] +1 I'd like to see people writing comparative reviews of libraries in each category, and publishing those reviews online. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: combinatorial search with running bound
Michael Mossey m...@alumni.caltech.edu wrote in article 3942.75.50.175.130.1253997756.squir...@mail.alumni.caltech.edu in gmane.comp.lang.haskell.cafe: The problem is to determine how closely the groups can be brought together without any boxes intersection. The basic algorithm is to consider each pair of boxes and ask if they have any vertical overlap---if so, figure out how closely they can be brought together without intersecting, otherwise ignore them. Then take the maximum of those numbers. Wouldn't you mean minimum instead of maximum then? I suspect that your code would be clearer without using a state monad. -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig Computer Science is no more about computers than astronomy is about telescopes. -Edsger Dijkstra ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Debugging Haskell code
On 2009-09-28 22:53 -0400 (Mon), John D. Ramsdell wrote: I've had great success debugging a large program by loading the Main module into ghci after setting GHC extensions, changing the search path, and setting break on errors. If you then place calls to the error function at the right location, and trace the execution, you'll be able to get a stack trace of the context in which the error function was called. Yes, I often use the interpreter to poke at and play with my code. Note that by using the -odir and so forth options, you can mix interpreted and compiled code, so that you need interpret only the particular modules you're trying to debug, and all the rest the application can run at full, compiled speed. cjs -- Curt Sampson c...@starling-software.com+81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: combinatorial search with running bound
Hi Chung-chieh, When you ask for a pair of boxes, How closely can they be brought together without intersection? that provides a lower bound on the question How closely can the groups be brought together? (I.e. for that pair of boxes, bring them any closer and they intersect, so it is a lower bound.) The maximum of all these lower bounds in the minimum needed separation. -Mike Chung-chieh Shan wrote: Michael Mossey m...@alumni.caltech.edu wrote in article 3942.75.50.175.130.1253997756.squir...@mail.alumni.caltech.edu in gmane.comp.lang.haskell.cafe: The problem is to determine how closely the groups can be brought together without any boxes intersection. The basic algorithm is to consider each pair of boxes and ask if they have any vertical overlap---if so, figure out how closely they can be brought together without intersecting, otherwise ignore them. Then take the maximum of those numbers. Wouldn't you mean minimum instead of maximum then? I suspect that your code would be clearer without using a state monad. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Comments requested: succ Java
Curt Sampson wrote: I've been hearing that having lots of libraries is an insurmountable advantage, and you're doomed if you give them up, since long before I took up Haskell. It's mostly myth promulgated by people driven by fear. I'm sure it's the case in some shops that they have lots of people who can glue libraries together but can't program, and they somehow manage to produce applications this way, but even that I suspect is not so frequent a situation as you'd think. The real insurmountable advantage is not in the quantity (nor quality) of the libraries, it is in the *particular* libraries. Shops which are only using libraries for basic data structures and for glue work are able (and not infrequently willing) to switch to another language provided it has a library ecosphere ---which Haskell with Cabal/Hackage most certainly does. The glue workers are not the ones most unwilling to switch. The real demographic that's unwilling to switch are those who are using a particular high-performance library. The reason they won't switch has nothing to do with the language, and everything to do with the countless man-years invested in that specific library. To pick some examples familiar to me: the Joshua SMT toolkit[0], the MALT parser[1], NLTK[2], GMTK[3], etc. Not all of these are Java, some are Python, some are Perl, and some are C++; but bridgework is annoying and most people stick to the original language. These libraries keep client developers near because they are not replaceable. Data structures, network stacks, XML parsing,... everyone has these. But the high-performance state-of-the-art libraries tend to be written once and tweaked ever after. The conversion of the Moses translator (Python) into the original version of the Joshua translator (Java) was a non-trivial undertaking and it earned a few publications along the way ---just for converting it to a different yet similar language! And, of course, a number of man-years and publications have been invested in it since then. [0] http://joshua.sourceforge.net/ [1] http://maltparser.org/ [2] http://www.nltk.org/ [3] http://ssli.ee.washington.edu/~bilmes/gmtk/ -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.
If there's an Example section, it might actually be a good idea to include it on the package's hackage page, too. From a usability point of view, CPAN is much more helpful than the relatively spartan hackage description - if you're looking for a particular set of functionality, being able to filter out misses quickly is really nice. mark On 29/09/2009, at 1:11 PM, Hong Yang wrote: A Cook Book is good but relies on people specifically working on it. I think most of the package authors submit their packages because they themselves need the modules in his real world. I think package authors adding examples in the Descriptions section is a good start when they submit their packages. You do want to facilitate people understanding and using your modules, right? Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock. Also, having a section for comments is helpful. This is the case especially when there are several similar packages coexisting, comments can help people choose which one to use. Thanks, Hong On Mon, Sep 28, 2009 at 9:55 PM, Casey Hawthorne cas...@istar.ca wrote: On Mon, 28 Sep 2009 21:50:14 -0500, you wrote: Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a lot of libraries, but most of them offer few examples of how to use the modules. In this regards, Perl is much much better. Good thought! Is there a good way to add Haskell examples to the libraries? A Haskell CookBook might be just the ticket, also. -- Regards, Casey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] How to decide if a number is an integer?
Hi, In other weak-type language, `round i == i` would work. But in haskell, what should I do? Thanks. -- 竹密岂妨流水过 山高哪阻野云飞 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe