Haskore on /.

2000-03-31 Thread Manuel M. T. Chakravarty
[Regard this as a continuation of the Haskell in tech news thread...] Paul Hudak's Haskore system made it into part three of the ``Making Music with Linux'' series on /. http://slashdot.org/article.pl?sid=00/03/31/2217202&mode=thread It is described as a ``super-techy way of handling notation

Re: deBruijn sequence NESL code

2000-03-31 Thread Scott Turner
At 18:20 2000-03-31 -0500, Wayne Young wrote: >I appreciate any insight anyone has to offer on this code. I tinkered a bit, and have a modicum of information to show for it. Here's a translation to Haskell, with what seems to be the right implementation of xor_iscan. I don't know what sequenc

deBruijn sequence NESL code

2000-03-31 Thread Wayne Young
I appreciate any insight anyone has to offer on this code. I obviously don't care about losing NESL's parallel computing power. I am more interested in a relatively efficient and readable function (or functions) as the C code I currently have is garbage to read and I don't have the time to spare

RE: improving error messages

2000-03-31 Thread Sigbjorn Finne
[EMAIL PROTECTED] writes: > ... > > Although you can't show the value (because there isn't one), you can > at least show the type of the expression: > > class ShowType a where > showType :: a -> String Or you can do what hbc has done for donkey's years and include 'showType'

Re: error messages

2000-03-31 Thread Fergus Henderson
On 31-Mar-2000, S.D.Mechveliani <[EMAIL PROTECTED]> wrote: > > Now, what should Prelude.take > think of Prelude.take (-1) (x:y:z:xs), > > how could it decide to display x ? > The compiler does not know whether show x > would lead to the infinite printing. > > Example: take (-1)

error messages

2000-03-31 Thread S.D.Mechveliani
To my suggestions on the error messages Marc van Dongen <[EMAIL PROTECTED]> writes > Printing the argument of a function as part of an error > message may lead to infinite error messages. > [..] > A call to error terminates execution of the program > and returns an appropriate error indication

Re: improving error messages

2000-03-31 Thread Malcolm Wallace
> instance ShowType a => ShowType [a] >where >showsType xs = ('[':) . showsType x . (']':) where ~(x:_) = xs > > Looks like ~(x:_) gives access to a constant instance operation > on the type of an element of xs even when xs is empty. > > Looks like it works. But I do not understan

Re: ServiceShow class for messages

2000-03-31 Thread Fergus Henderson
On 31-Mar-2000, Marc van Dongen <[EMAIL PROTECTED]> wrote: > S.D.Mechveliani ([EMAIL PROTECTED]) wrote: > > [ error messages printing their aguments ] > > Printing the argument of a function as part of an error > message may lead to infinite error messages. Well, of course if the argument is la

Re: ServiceShow for error messages

2000-03-31 Thread Marcin 'Qrczak' Kowalczyk
Fri, 31 Mar 2000 12:37:13 +0100, Keith Wansbrough <[EMAIL PROTECTED]> pisze: > [it's no accident that class constraints `C a =>' are written the way > they are... they are really extra arguments `CDict a ->'.] Why are they written uncurried? It's easier to split a curried long context among se

Re: ServiceShow for error messages

2000-03-31 Thread Fergus Henderson
On 31-Mar-2000, Keith Wansbrough <[EMAIL PROTECTED]> wrote: > Sergey writes: > > [sketch of how to implement better error messages] > The problem with this is that there is a performance penalty to be > paid for overloading a function in this way. ... > Perhaps this could be turned on with a debu

Re: improving error messages

2000-03-31 Thread Keith Wansbrough
Malcom and Sergey write: > instance ShowType a => ShowType [a] > where > showsType xs = ('[':) . showsType x . (']':) where ~(x:_) = xs Perhaps where [x] = [error "not used"] `asTypeOf` xs gives the idea better. --KW 8-) -- : Keith Wansbrough, MSc, BSc(Hons) (Auckland) --

RE: improving error messages

2000-03-31 Thread Simon Peyton-Jones
The stack trace in a lazy language is usually unhelpful, since it describes the consumer of (hd []) not its producer. That's why the cost-centre stack idea is likely to help. Simon | -Original Message- | From: Fergus Henderson [mailto:[EMAIL PROTECTED]] | Sent: 01 April 2000 16:53 | To:

Re: improving error messages

2000-03-31 Thread Fergus Henderson
On 30-Mar-2000, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > | What do you think of improving the error messages like > | Prelude.take: negative argument > | (for say, take (-1) [(0,'b'),(1,'a')] ) > > That would be splendid. But I don't see how to do it. > >

Re: ServiceShow class for messages

2000-03-31 Thread Marc van Dongen
S.D.Mechveliani ([EMAIL PROTECTED]) wrote: [ error messages printing their aguments ] Printing the argument of a function as part of an error message may lead to infinite error messages. It may even lead to several calls to error which all have to be shown. I don't think a compiler will ever be

improving error messages

2000-03-31 Thread S.D.Mechveliani
Malcolm Wallace <[EMAIL PROTECTED]> writes >> And for (head []) there's really no useful info to hand. So I'm stumped. > Although you can't show the value (because there isn't one), you can > at least show the type of the expression: Printing the type is very desirable in this situation. But

Re: improving error messages

2000-03-31 Thread Jan Skibinski
On Fri, 31 Mar 2000, S.J.Thompson wrote: > To help students I have compiled a list of messages and examples of code that > provoke them. In many cases a little effort would, I guess, lead to vastly > more informative error messages. I'd be interested to hear what you (and the > Hugs gro

ServiceShow class for messages

2000-03-31 Thread S.D.Mechveliani
Keith Wansbrough <[EMAIL PROTECTED]> writes > Sergey writes: >> Maybe, there exists another possibility to print the values in the >> error message like for >>take (-1) xs, y % 0 >> >> The implementors declare the "internal" >> class Servic

Re: .gz files

2000-03-31 Thread Jan Brosius
Thanks for this workaround, it worked. This might be a tip to be put on the mailing list, since other people using Windows NT and Winzip might have the same problem. Friendly Jan Brosius - Original Message - From: Simon Peyton-Jones <[EMAIL PROTECTED]> To: 'Jan Brosius' <[EMAIL PROTECTED

Random usage

2000-03-31 Thread Ketil Malde
Hi any good intro to using the Random stuff, or a simple code sample? -kzm -- If I haven't seen further, it is by standing in the footprints of giants

Re: deBruijn sequences

2000-03-31 Thread Wayne Young
From: Jan de Wit <[EMAIL PROTECTED]> >Pray tell, what *are* base-2 deBruijn sequences? I know what deBruijn >terms are, and have some code for them, but as for sequences... >I think you are going to get a lot of replies like this one ;-) The following three are examples of binary de Bruijn seque

RE: ServiceShow for error messages

2000-03-31 Thread Simon Marlow
> The problem with this is that there is a performance penalty to be > paid for overloading a function in this way. `take' is implemented as > a function of two arguments, as you would expect. It is given a > number and a list; it has no idea what type the list has, nor does it > need to: it jus

Re: ServiceShow for error messages

2000-03-31 Thread Keith Wansbrough
Sergey writes: > Maybe, there exists another possibility to print the values in the > error message like for >take (-1) xs, y % 0 > > The implementors declare the "internal" > class ServiceShow where serviceShows :: ... > invisible for the us

ServiceShow for error messages

2000-03-31 Thread S.D.Mechveliani
Maybe, there exists another possibility to print the values in the error message like for take (-1) xs, y % 0 The implementors declare the "internal" class ServiceShow where serviceShows :: ... invisible for the user, make *everything* to be t

improving to improving error messages

2000-03-31 Thread S.D.Mechveliani
To my suggestion on the error messages Ketil Malde <[EMAIL PROTECTED]> writes > [..] > e.g instead of Hugs' Prelude head: > >head :: [a] -> a >head (x:_)= x > > we can use: > >head :: [a] -> a >head [] = error "Error: tak

RE: improving error messages

2000-03-31 Thread Malcolm Wallace
> take :: Int -> [a] -> [a] >If you want to define your own take > mytake :: Show a => Int -> [a] -> [a] >that's fine, but it's a different function. > >And for (head []) there's really no useful info to hand. So I'm stumped. Although you can't show the value (because there isn't one)

Re: improving error messages

2000-03-31 Thread S.J.Thompson
Sergey, I could not agree more. I sent the following message to the Hugs implementors a few months ago. I have taught Hugs for a couple of years and enjoy using it. Students like to have a system they can take home and install for free, and the system seems pretty robust. One problem s