[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
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
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
[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'
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)
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
> 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
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
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
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
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) --
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:
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.
>
>
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
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
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
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
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
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
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
> 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
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
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
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
> 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)
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
26 matches
Mail list logo