Re: idiom for producing comma-seperated lists?

2003-08-08 Thread D. Tweed
On Fri, 8 Aug 2003, Antony Courtney wrote: > I often need to format a list of strings using some character as a > *seperator* rather than a terminator for the items. Is there some > simple combinator or idiom from the Prelude or standard libraries that > could be used for this purpose? I thin

Re: Assembling lists start-to-end

2003-06-21 Thread D. Tweed
On Sat, 21 Jun 2003, Wolfgang Jeltsch wrote: > On Saturday, 2003-06-21, 14:38, CEST, Mark Carroll wrote: > > I am assembling a list from start to end. I can add elements to the end with > > "previous ++ [current]" or I can add them with "current : previous" and > > reverse it when I'm done. Or, ma

Re: Debugging haskell

2003-02-24 Thread D. Tweed
On Mon, 24 Feb 2003, Andrew Moran wrote: > > Dave Tweed wrote: > > > If you discard `compliation preventing, very very quick to solve' bugs > > (e.g., missing semi-colons in C++, silly typecheck errors in Haskell) I > > find that the ratio between source code bugs and algorithm bugs is maybe > >

Re: Debugging haskell

2003-02-24 Thread D. Tweed
On Mon, 24 Feb 2003, Malcolm Wallace wrote: > Joe English <[EMAIL PROTECTED]> writes: > > > Me either; in fact even 1/4 of the time debugging > > sounds quite high. > > > > When I first started using Haskell, most of my time > > went to fighting with the typechecker, but once the > > code checke

Re: AW: AW: Editor Tab Expansion

2002-12-10 Thread D. Tweed
I think I was a bit inflamatory in my previous post because I was fuming about something else in my life; I stand by the factual content of what I said but wish I'd phrased it much less confrontationally. On Mon, 9 Dec 2002, matt hellige wrote: [snip] > > You seem to be saying that layout should >

Re: AW: AW: Editor Tab Expansion

2002-12-07 Thread D. Tweed
On Fri, 6 Dec 2002, Ingo Wechsung wrote: > Beg your pardon, Marcin > > >But they are compatible because there is one most universally accepted > >interpretation of a tab (move to the next multiple of 8 columns). Any > >other interpretation hampers portability and should be avoided. > > No. It di

Re: Editor Tab Expansion

2002-12-06 Thread D. Tweed
> Wether spaces or tabs are better in source files is a matter of taste and > a language should not force me to use one or another. Well note that it doesn't only confuse compilers: if you post code for other people to read (whose display software has their personal own interpretation of what a t

Re: can a lazy language give fast code?Fair answer.

2002-07-31 Thread D. Tweed
On Wed, 31 Jul 2002, Scott J. wrote: > I don't think I have got a fair answer to my questions regarding these > (silly?) benchmarks. I cannot write the programs with the unboxed "things", > but I have both the Ocaml compiler and the latest Glasgow compiler installed > on my windows XP machine. So

Re: can a lazy language give fast code?

2002-07-31 Thread D. Tweed
On Wed, 31 Jul 2002, Andrew J Bromage wrote: > Let me clarify what I meant by that and see if you still disagree. > > Realistically, _most_ new software installations today (I deliberately > ignore legacy systems etc) are not overloaded, in that there are more > "computrons" available than are r

Re: can a lazy language give fast code?

2002-07-30 Thread D. Tweed
On Tue, 30 Jul 2002, Andrew J Bromage wrote: [snip] > In the end, though, benchmarks ignore one of the most important rules > of software performance: "throughput" (i.e. the amount of processing > that your system can do just prior to being overloaded) is almost never > the most important conside

Re: hashmap withdrawal and poor haskell style

2002-04-03 Thread D. Tweed
> It's correct Haskell. Have a look at > http://www.haskell.org/onlinereport/exps.html#sect3.14 Thanks; serves me right for being lazy and not having actually read a version of the report since the various elements of monad syntax were introduced... ___cheers,_dave___

Re: hashmap withdrawal and poor haskell style

2002-04-03 Thread D. Tweed
On Wed, 3 Apr 2002, Michal Wallace wrote: > module Main where > alphabet = "abcdefghijklmnopqrstuvwxyz" > count ch str = length [c | c <- str , c == ch] > hist str = [count letter str | letter <- alphabet] > oneline ch str = [ch] ++ " " ++ stars (count ch str) > stars x = if x

Re: finding ....

2002-03-19 Thread D. Tweed
[Moved to haskell-cafe] On Tue, 19 Mar 2002, David Sankel wrote: > > *everytime* about race conditions. (of course using > > this existFile before > > creating a temporary file is wrong, but existFile > > has *many* other > > applications) > > Could someone post an example of the creation of a >

Re: a more practical version of getLine???

2002-02-26 Thread D. Tweed
On Mon, 25 Feb 2002, Dean Herington wrote: > If you're using GHC, take a look at module Readline in the util package > (http://www.haskell.org/ghc/docs/latest/set/readline.html). I don't know > which other Haskell systems support this module. The annoying thing is the way that terminals general

Re: Re: syntax...(strings/interpolation/here docs)

2002-02-13 Thread D. Tweed
On Wed, 13 Feb 2002, David Feuer wrote: > > It would be a *signifigant* boon to those > > of us trying to get haskell into organizations > > by using it as "maintainable perl/sh", and > > Haskell is not a "maintainable perl/sh". It is not a good > language for simple shell scripts, and is not

Re: character syntax

2002-02-07 Thread D. Tweed
On 7 Feb 2002, Ian Zimmerman wrote: > > itz> All this taken together, I mean, _really_, is the lexical > itz> structure of Haskell a botch, or what? > > Jon> No. Innovative. All the problems described in this thread reflect > Jon> unwarranted assumptions inherited in emacs. It's plainly possibl

Re: functions not in type classes

2002-01-18 Thread D. Tweed
On Fri, 18 Jan 2002, Cagdas Ozgenc wrote: > > the goal of type class is to allow overloading of function, so for example > > id x = x is not subject to overloading => no use to put it in a type > class. > > Because it doesn't do anything? I believe that (assuming of course that you aren't a

Re: functions not in type classes

2002-01-18 Thread D. Tweed
On Fri, 18 Jan 2002, Cagdas Ozgenc wrote: > Why does Haskell let you write functions that are not a part of type class? [snip] Responding to the more philosophical bit rather than the concrete type stuff snipped, I'm not a supporter of the belief that `absolutely everything in all programs ever

Re: efficiency

2002-01-16 Thread D. Tweed
No-one appears to have responded to this with a definitive answer... On Tue, 15 Jan 2002, Feuer wrote: > I know what you mean. However, if you look at it, > data Empty1 a = E1 > is a datatype with one constructor, and that constructor takes no arguments. > So this is in fact a "phantom" unit ty

Re: Precision of `Double's in Hugs

2002-01-13 Thread D. Tweed
On Sun, 13 Jan 2002, Liyang Hu wrote: > > From a bit of browsing the code, it appears that setting > > USE_DOUBLE_PRECISION will increase the precision of both Float > > and Double types. Note that I'd recommend getting some clarification about this from either the current hugs team or Mark Jone

Re: Having contraints like 'Fractional Int => IO ()'

2001-11-13 Thread D. Tweed
On Tue, 13 Nov 2001, Jesper Louis Andersen wrote: > This problem has had my attention for a while now. I hope someone would > like to help me out on the problem. > > I have a simple average function defined as: > > mean:: (Fractional a) => [a] -> a > mean l = (sum l)/ fromI

Re: = vs ->

2001-10-12 Thread D. Tweed
On Fri, 12 Oct 2001, Fergus Henderson wrote: [Dave Tweed wrote] > > sense. I'm not sure why anymore but Haskell changed the `if clause after > > the value' to `pattern guard | before =', so I agree it now looks as if > > it's stating that the pattern guard is equal to the rhs. > > I've heard th

Re: = vs ->

2001-10-10 Thread D. Tweed
On Wed, 10 Oct 2001, Mark Carroll wrote: > On 10 Oct 2001, Ketil Malde wrote: > (snip) > > function definitions. Perhaps one could have had a syntax like > > > > z a = > > | a == 1 -> 1 > > | a == 2 -> 3 > > > > instead, as it'd make it more consisten with the case,

Re: = vs ->

2001-10-09 Thread D. Tweed
On Wed, 10 Oct 2001, D. Tweed wrote: > degenerate equality you get from defining the lhs in terms of the rhs. The > -> is used whenever you've got something on the right that `leads to' to ^left > som

Re: = vs ->

2001-10-09 Thread D. Tweed
On 10 Oct 2001, Ketil Malde wrote: > Mark Carroll <[EMAIL PROTECTED]> writes: > > > On Tue, 9 Oct 2001, Ashley Yakeley wrote: > > >> At 2001-10-09 11:55, Mark Carroll wrote: > > >>> What is the rationale for when Haskell demands a "=" and when it > >>> demands a "->"? > > Okay, I can't give y

Re: newbie conceptual question [from haskell list]

2001-07-27 Thread D. Tweed
To correct the incoimprehensible sentence... On Fri, 27 Jul 2001, D. Tweed wrote: > actually happens to be implementation defined. But I don't consider that > when I screw up by allocating memory outside array bounds to be a bug due ^

Re: newbie conceptual question [from haskell list]

2001-07-27 Thread D. Tweed
Important confession since Fergus is in the discussion: I've not actually read any of the C or C++ standards; I've got an impression of what they say from various textbooks and the gcc mailing lists. On Fri, 27 Jul 2001, Fergus Henderson wrote: > But there are so *many* such "stupidities". > >

RE: newbie conceptual question [from haskell list]

2001-07-26 Thread D. Tweed
Aha, we head towards convergence :-) On Thu, 26 Jul 2001, Frank Atanassow wrote: > > I've never written a Haskell program using functional dependencies, or > > existential classes, ... > > I find them indispensible, and I know for a fact that I am not the only one > around our office who feels

RE: newbie conceptual question [from haskell list]

2001-07-26 Thread D. Tweed
On Thu, 26 Jul 2001, Frank Atanassow wrote: > My reaction to that is: you are not programming in C. If you restrict > yourself to nice subsets of a programming language, then obviously your > programs will satisfy better properties. That's certainly a resaonable position to take. All I'm saying

RE: newbie conceptual question [from haskell list]

2001-07-26 Thread D. Tweed
On Thu, 26 Jul 2001, Frank Atanassow wrote: > also safety, and "theorems for free". Then there are other properties which > are obvious (to a programmer) in a Haskell program which get buried in the > equivalent C(++) program, e.g., that every member of a data structure is > traversed in a fold ("

RE: newbie conceptual question [from haskell list]

2001-07-26 Thread D. Tweed
On Thu, 26 Jul 2001, Frank Atanassow wrote: > > Again, as a C++ programmer I have some grasp of what program > > rearrangements are valid (E.g.,I can't move an assignment involving an > > expression in another variable, say v, from before an assignment to v to > > after an assignment to v), and I

RE: newbie conceptual question [from haskell list]

2001-07-25 Thread D. Tweed
I'd like to respectfully disagree with some of this :-) On Wed, 25 Jul 2001, Frank Atanassow wrote: > These things are nice, but the more I learn about functional languages, the > more I feel that they are only icing on the cake. The most important thing > about functional languages is that we k

Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread D. Tweed
On Fri, 1 Jun 2001, Fergus Henderson wrote: > Sorry for the off-topic post, but I figured someone here would know... > can anyone please tell me how to do the double-square-bracket symbols > that are often used in denotational semantics in LaTex? It's like > "[[" but a single symbol without the

Re: Templates in FPL?

2001-05-23 Thread D. Tweed
On Thu, 24 May 2001, Fergus Henderson wrote: > > > I'm not sure what you mean by type-checked here. Templates are not > > > type-checked at definition time, but are type-checked when they are > > > used; the same is true of ordinary macros. > > > > I was thinking in terms of (to take a really s

Re: Templates in FPL?

2001-05-23 Thread D. Tweed
On 22 May 2001, Carl R. Witty wrote: > "D. Tweed" <[EMAIL PROTECTED]> writes: > > > In my experience the C++ idiom `you only pay for what you use' (==> > > templates are essentially type-checked macros) and the fact most compilers > > are evolved

Re: Inferring from context declarations

2001-02-22 Thread D. Tweed
On Wed, 21 Feb 2001, George Russell wrote: > Hmm, this throwaway comment is getting interesting. But please cc any replies to > me as I don't normally subscribe to haskell-cafe . . . To be honest, I suspect I was talking complete & unadulterated rubbish. (Not that that's unusual.) ___cheers,_da

Re: Inferring from context declarations

2001-02-21 Thread D. Tweed
George Russell wrote: > > (3) Simon Peyton Jones' comments about dictionary passing are a red herring, > since they assume a particular form of compiler. Various (MLj, MLton) > ML compilers already inline out all polymorphism. Some C++ compilers/linkers > do it in a rather crude way

Re: Specifications of 'any', 'all', 'findIndices'

2001-01-23 Thread D. Tweed
On Tue, 23 Jan 2001, Mark Tullsen wrote: > Johannes Waldmann wrote: > > ... > > I'd rather write clear code, than worry about efficiency too early. > > Who said this, "premature optimization is the root of all evil". > > I've always attributed this to Donald Knuth: > > Premature optimization

Re: Will Haskell be commercialized in the future?

2000-11-27 Thread D. Tweed
On Mon, 27 Nov 2000, Frank Atanassow wrote: > > Java. Do you think that Haskell would be better without `unsafePerformIO'? > > Without remarking on C#, I just wanted to point out that unsafePerformIO is > not part of the Haskell language... Umm, I hope that everyone in the implementors camps f

Re: Will Haskell be commercialized in the future?

2000-11-24 Thread D. Tweed
On Fri, 24 Nov 2000, Jason Stokes wrote: > I very much doubt that a "pure" Haskell (ie, a pure functional language) > is a marketable proposition, but certainly "impure" functional languages > or languages with heavy functional aspects (ML, Lisp, Erlang etc.) which > retain imperative elements ha

Re: Literate Programming

2000-09-28 Thread D. Tweed
On Wed, 27 Sep 2000, Frank Atanassow wrote: > Personally, I think literate programming is all about syntax, so I would avoid > trying to make the tool do any sort of semantic analysis. Mmm, my personal view of literate programming is that it is a technique for making learning about and comprehen

Re: Literate Programming

2000-09-27 Thread D. Tweed
On Wed, 27 Sep 2000, D. Tweed wrote: > On Wed, 27 Sep 2000, Frank Atanassow wrote: > > I see the problem for a language like C++, which has true overloading, but not > > for Haskell. In Haskell it makes sense to identify type class methods with the > > same name, since

Re: Literate Programming

2000-09-27 Thread D. Tweed
On Wed, 27 Sep 2000, Frank Atanassow wrote: > D. Tweed writes: > > Unfortunately the last time I looked at CWEB it still had the same idea > > about identifiers as WEB itself, namely that if they match textually > > they are the same, which makes the automatic indexes

Re: Literate Programming

2000-09-27 Thread D. Tweed
On Wed, 27 Sep 2000, Antti-Juhani Kaijanaho wrote: > On 2927T115028+0100, Jerzy Karczmarczuk wrote: > It's useful only for writing Pascal, so yes, it's essentially dead. > TeX seems to be (one of?) the only thing(s) still using it. > > However, it's descendant, CWEB by Knuth and Levy (iirc),