Re: [Haskell-cafe] Building production stable software in Haskell

2007-09-17 Thread Steve Downey
Competing packages for XML or DBM is really awful, unless they happen to be interface compatible. And there is a good way of switching imps at assembly time, such that lib code that consumes xml doesn't depend on which xml imp I have. Of course, I realize that a good interface for those is still

Re: [Haskell-cafe] Reversing a string of words: C# v Perl V Ruby v Haskell

2006-12-11 Thread Steve Downey
the typical good solution to this problem in c or c++ is to use a string reverse function on the entire buffer, then re-reverse each word. this leaves multiple spaces correctly embedded in the larger string. that approach, of course, won't work in haskell, since it relies on updates. but if the

Re: [Haskell-cafe] Reversing a string of words: C# v Perl V Ruby v Haskell

2006-12-13 Thread Steve Downey
ok, i'll bite. why should i prefer join rather than concat in the list monad. and, moreover, why is this a lambdabot trick? i suspect that the answer actually has a deep connection to the 'dummies' thread next door. while any program that produces the right result is correct, there are some

Re: [Haskell-cafe] Aim Of Haskell

2006-12-13 Thread Steve Downey
well, if Sun hadn't have released a version of smalltalk with a funny c like syntax, you might have seen some interesting developments in the mid 90's On 12/13/06, Claus Reinke [EMAIL PROTECTED] wrote: The reason why Haskell is academic-centric is that it was originally conceived by

[Haskell-cafe] what are the points in pointsfree?

2006-12-14 Thread Steve Downey
i'm not naive enough to think they are the composition function, and i've gathered it has something to do with free terms, but beyond that i'm not sure. unless it also has something to do with fix points? ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: what are the points in pointsfree?

2006-12-14 Thread Steve Downey
the wiki wasn't half as clear. other tham covering the first half, that it doesn't mean the '.' function. so pointsfree is a step beyond leaving the domain unspecified. my reading knowledge of haskell at this point far exceeds my ability to write haskell. but so far, it has seemed to me that

Re: [Haskell-cafe] Aim Of Haskell

2006-12-15 Thread Steve Downey
The front end for the comeau compiler is from Edison Design Group, and that's the one that is used by many other compilers. And the EDG compiler is regarded as being the most conformant. Besides MS and the FSF (visual c++ and gcc), both Sun and IBM have c++ compiler toolchains not based on EDG.

Re: [Haskell-cafe] Aim Of Haskell

2006-12-15 Thread Steve Downey
The core of the 'Blub Paradox'. There is almost no upside for a manager to approve an 'unusual' language for a project. Most technology changes are driven by engineers, and most engineers are by nature risk averse, even though they also tend to be neophiles. So, on a given project, they'll try

[Haskell-cafe] Re: what are the points in pointsfree?

2006-12-15 Thread Steve Downey
No fair. Although I've a B.S. in Mathematics, I spent most of my time in complex analytic dynamical systems, rather than hanging with the algebraists. Except for a bit where I did some graph theory. Rather ironic. On 12/15/06, Scott Brickner [EMAIL PROTECTED] wrote: Donald Bruce Stewart

[Haskell-cafe] Re: [Haskel-cafe] Re: what are the points in pointsfree?

2006-12-16 Thread Steve Downey
that was about 15 years ago, and I haven't really kept up. Too much time keeping up with software. On 12/16/06, Jacques Carette [EMAIL PROTECTED] wrote: Steve Downey wrote: No fair. Although I've a B.S. in Mathematics, I spent most of my time in complex analytic dynamical systems, rather than hanging

[Haskell-cafe] partial functions / failure, Maybe and MonadError and good style

2006-12-22 Thread Steve Downey
Although terse, the subject really says it all. If i've a partial function, like a parser, what is considered good style for a library. The tradeoffs that I can see are that Maybe is a binary operation, while Error can communicate more information in the type of the error case. Is there some way

[Haskell-cafe] Re: partial functions / failure, Maybe and MonadError and good style

2006-12-22 Thread Steve Downey
. On 12/22/06, Stefan O'Rear [EMAIL PROTECTED] wrote: On Fri, Dec 22, 2006 at 08:05:08PM -0500, Steve Downey wrote: Although terse, the subject really says it all. If i've a partial function, like a parser, what is considered good style for a library. The tradeoffs that I can see are that Maybe

[Haskell-cafe] Re: partial functions / failure, Maybe and MonadError and good style

2006-12-22 Thread Steve Downey
really pass through information from the underlying parser... Really RSN. When me, my laptop, and my wireless connection all meet at the same time. On 12/22/06, Ross Paterson [EMAIL PROTECTED] wrote: On Fri, Dec 22, 2006 at 08:37:05PM -0500, Steve Downey wrote: On 12/22/06, Stefan O'Rear [EMAIL

[Haskell-cafe] Re: partial functions / failure, Maybe and MonadError and good style

2006-12-22 Thread Steve Downey
some day. :) On Fri, Dec 22, 2006 at 08:37:05PM -0500, Steve Downey wrote: OK, but is msg always a string? Admidtedly, in the concrete case I have at hand (follow up posting RSN), that would be fine. I think I've also been looking at the map lookup case, where not only is lookup failure

Re: [Haskell-cafe] State monad strictness - how?

2007-01-10 Thread Steve Downey
haskell is the standard lazy functional language, so strictness ought to be called out. e.g. StateStrict rather than StateLazy. The traction that haskell is starting to get (and why I'm spending time learning it and following haskell-cafe) is not because its semantics are unsurprising to newbies.

Re: [Haskell-cafe] Article review: Category Theory

2007-01-19 Thread Steve Downey
One nit and one massive praise. nit first. in 'the monad laws and their importance' you say given a monad M and then outline the laws a functor must satisfy to be a monad. I would find it clearer to say 'a functor M', and then emphasise the iff relationship between the laws and the functor M.

[Haskell-cafe] small step evaluation as an unfold?

2007-01-23 Thread Steve Downey
(overall context - working through TaPL on my own, reimplemnting typecheckers in haskell) the type checkers all follow the same pattern, in ocaml they throw an exception when the small step fails, which may mean taking another branch in the eval, but that that sub expression has hit bottom. it

[Haskell-cafe] Re: small step evaluation as an unfold?

2007-01-24 Thread Steve Downey
good, it felt like something that might have occurred to someone before. On 1/23/07, Nicolas Frisby [EMAIL PROTECTED] wrote: Jeremy Gibbons thought of it; that's good company ;) http://portal.acm.org/citation.cfm?id=289457 On 1/23/07, Steve Downey [EMAIL PROTECTED] wrote: (overall context

[Haskell-cafe] Re: small step evaluation as an unfold?

2007-01-24 Thread Steve Downey
it. On 1/23/07, John Meacham [EMAIL PROTECTED] wrote: On Tue, Jan 23, 2007 at 10:25:27PM -0500, Steve Downey wrote: (overall context - working through TaPL on my own, reimplemnting typecheckers in haskell) the type checkers all follow the same pattern, in ocaml they throw an exception when

Re: [Haskell-cafe] OOP parametric polymorphism

2007-01-28 Thread Steve Downey
Well, it depends what you mean by OO. In a proper OO system, equality means not just are these two things in the same state, but do they refer to a single object. Invoking behavior on one will affect the other, and the equality relation will still hold. There are three properties that entities

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-29 Thread Steve Downey
The primary goal of writing source code isn't to communicate to a computer, but to communicate to a human being. That implies that the communication should be at a high enough level of abstraction to be easily understood by people, while not losing the precision necessary for a computer. OO, at

Re: [Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages

2007-02-01 Thread Steve Downey
The 70's and early 80's were very different in terms of information propagation. I really miss some the journals available back then, because the editors really did their jobs, both in selecting and helping to convey, information. OO did get oversold. The same way that putting it on the internet

[Haskell-cafe] currying vs partial application

2007-02-07 Thread Steve Downey
I think I finally have it. Partial application is taking a function of N parameters, binding a value to one of them, and turning it into a function of N-1 parameters. Currying is where ask is that a function that takes two ints and returns an int, or is that a function that takes one int and

[Haskell-cafe] OO Design in Haskell Example (Draft)

2007-02-25 Thread Steve Downey
In the last OO design in Haskell thread (and probably in every one preceeding it), it was suggested that having some examples might be a good idea. Since most people with existing designs will have some familiarity with Design Patterns, and those are typical building blocks for OO designs, it

[Haskell-cafe] Re: OO Design in Haskell Example (Draft)

2007-02-26 Thread Steve Downey
solution. but my experience is limited. On 2/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Tim Docker wrote: Steve Downey wrote: So, I've been working on a Composite example. I've used existential types to have a generic proxy to the base type, rather than a simple algebraic type

Re: [Haskell-cafe] Hi can u explain me how drop works in Haskell

2007-02-26 Thread Steve Downey
in addition, a good example of how to apply quickcheck would be really awesome. without using the standard drop g On 2/26/07, Thomas Hartman [EMAIL PROTECTED] wrote: Here's my, probably very obvious, contribution. What I'd like feedback on is 1) code seem ok? (hope so!) 2) What do you think

Re: [Haskell-cafe] Hi can u explain me how drop works in Haskell

2007-02-26 Thread Steve Downey
ok maybe i should have read ahead. but still, i can see how to apply hunit, but not quickcheck. but quickcheck seems more powerful. On 2/26/07, Steve Downey [EMAIL PROTECTED] wrote: in addition, a good example of how to apply quickcheck would be really awesome. without using the standard drop g

[Haskell-cafe] Re: OO Design in Haskell Example (Draft)

2007-02-26 Thread Steve Downey
is, there isn't really a best answer, but here are two or three reasonably good ways that won't cause too much trouble, and here's the kind of trouble they are likely to cause. On 2/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Steve Downey wrote: In the last OO design in Haskell thread (and probably

Re: [Haskell-cafe] Re: OO Design in Haskell Example (Draft)

2007-03-01 Thread Steve Downey
and dispatches to the contained elements composite :: [Component] - Component composite cs = Component draw1 add1 where draw1 = compositeDraw cs add1 c = composite $ c:cs On 2/27/07, Tim Docker [EMAIL PROTECTED] wrote: Steve Downey wrote: interesting. it leads

[Haskell-cafe] Eval of a syntax tree for reduction

2006-03-27 Thread Steve Downey
I'm working through Pierce's Types and Programming Languages on my own. I'm attempting to write the typecheckers in Haskell, instead of ML. However, when it comes to his eval function, I'm a little stuck. The original is let rec eval t = try let t' = eval1 t in eval t' with NoRuleApplies - tWhere

Re: [Haskell-cafe] Maybe and partial functions

2007-03-13 Thread Steve Downey
This isn't just a question about Haskell. It applies to any language with an exception mechanism, including C++ and Java. Even C (segv is an exception mechanism...) The question is really how to communicate failure to the caller, in a way the caller can not ignore, without unduely inconvienencing

Re: [Haskell-cafe] Haskell Weekly News: March 12, 2007

2007-03-13 Thread Steve Downey
One of my editors at somepoint, told me that he had asked his lawyers about this (i.e. don't think this is anything like real legal advice), and the answer was 'If you publish an article and advise someone that the way to do something is X, no judge will be happy if you sue them for taking your

[Haskell-cafe] N and R are categories, no?

2007-03-14 Thread Steve Downey
EOk, i'm trying to write down, not another monad tutorial, because I don't know that much yet, but an explication of my current understanding of monads. But before I write down something that is just flat worng, I thought I'd get a cross check. (and I can't get to #haskell) Monads are Functors.

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Steve Downey
It's not just type variables. Type classes looked innocent, but smuggled an entire turing complete generic meta computation system into the language. Just thank SIMON that the error messages aren't as bad as C++ and templates. This does imply that mOleg have some equivalence relation to

Re: [Haskell-cafe] Re: small boys performance

2007-03-14 Thread Steve Downey
Many years ago, I got a B- in abstract algebra, and an A+ in differential geometry. Now I know why I worry about the blue glow of an unplanned criticality excursion occuring in my brain. On 3/14/07, Dan Piponi [EMAIL PROTECTED] wrote: On 3/14/07, Andrzej Jaworski [EMAIL PROTECTED] wrote: I

[Haskell-cafe] Re: N and R are categories, no?

2007-03-19 Thread Steve Downey
of the non-sugar properties of Monad? On 3/15/07, Ulf Norell [EMAIL PROTECTED] wrote: On 3/15/07, Steve Downey [EMAIL PROTECTED] wrote: EOk, i'm trying to write down, not another monad tutorial, because I don't know that much yet, but an explication of my current understanding of monads

[Haskell-cafe] Re: N and R are categories, no?

2007-03-19 Thread Steve Downey
category of functional types and partial functions--N and R are could be good categories for such learning. Have fun! On 3/15/07, Ulf Norell [EMAIL PROTECTED] wrote: On 3/15/07, Steve Downey [EMAIL PROTECTED] wrote: EOk, i'm trying to write down, not another monad tutorial, because I don't know

[Haskell-cafe] Re: N and R are categories, no?

2007-03-19 Thread Steve Downey
Picky is good, because it helps me realize things like I haven't been paying enough attention to unit and join. Other than realizing that they make the box diagram and triangle diagram commute. -smd On 3/15/07, Dominic Steinitz [EMAIL PROTECTED] wrote: I haven't formally checked it, but I

Re: [Haskell-cafe] Re: k-minima in Haskell

2007-04-12 Thread Steve Downey
Does the answer change if the data source isn't a list, already in memory, but a stream? That is, will the sort end up pulling the entire stream into memory, when we only need k elements from the entire stream. Interestingly, this is almost exactly the same as one of my standard interview

Re: [Haskell-cafe] Re: How Albus Dumbledore would sell Haskell

2007-04-21 Thread Steve Downey
I think you are right. If you used something like a theorem prover as an example, you accidentally send the messsage that Haskell is very useful for esoteric stuff that only academics are interested in. Now, that doesn't mean that the example has to solve a real problem, but it does need to be

Re: [Haskell-cafe] What puts False before True?

2007-06-05 Thread Steve Downey
Well, traditionally, a boolean algebra is a ring, which means it has two operations corresponding to plus and times, and a zero such that a plus zero is a, and a one such that a times one is a. Also by longstanding tradition, zero is less than one. Now, in most programming languages, a boolean