Showing tuples

2000-05-08 Thread Mike Jones
Hi, I am having trouble with Show and tuples. I have a data structure, say: data MyData = ... And a value, say: value = (MyData..., MyData..., MyData) Then try to: show value I get a compiler message from ghc 4.05 that says: No instance for `Show (MyData, MyData, MyData)... What is the b

Converting float to double.

2000-05-08 Thread Ronald J. Legere
I have a very simple question. What is the best way to convert a float to a double? I use fromRational.toRational, and the notes in the prelude seem to imply that this is optimized into something sensible.. is this the way? Cheers! + Ron Legere

Re: basAlgPropos. Why sample argument

2000-05-08 Thread Marcin 'Qrczak' Kowalczyk
Sun, 7 May 2000 16:13:46 +0400 (MSD), S.D.Mechveliani <[EMAIL PROTECTED]> pisze: > Also what do you do with > class Foo a where weightOfType :: Int > ? In this case one solution is to have a sample argument, because Haskell does not provide more convenient way of parame

Re: Show class on ADT with function

2000-05-08 Thread Ian . Stark
George writes: > There is no problem with Showing functions with finite domains. > For example, try: > module ShowFun where > instance (Show a) => Show (Bool -> a) where >show f = show ((f True),(f False)) > instance (Show a) => (Show (Int -> a)) Why stop there? Eq and Read too, though the

Haskell Web Server: please pummell

2000-05-08 Thread Simon Marlow
Dear Haskell folks, There's a web server written in Haskell running on haskell.org: http://www.haskell.org:8080/ Please surf on over and press reload a few times. First one to bring it down gets a gold star. I'll be watching the logs :-) The source (not properly packaged, just source

RE: Performance, and algorithms

2000-05-08 Thread Simon Marlow
> * I find it difficult to understand how the code I write translates > into actual algorithms, memory management, etc. Haskell is such a > nice language that it hides all this detail from me :-). So, I'd be > grateful for a reference or two on this area. Manuel pointed out Simon's paper on the

RE: Type and class names

2000-05-08 Thread Simon Marlow
> Why are type constructors and classes in the same namespace? Because otherwise the syntax module M ( T ) where would be ambiguous. I suppose it could be resolved to mean "export the class and/or data type T". It was proposed for Haskell 98 that the syntax be changed to mo

Re: sample argument. Dongen's example

2000-05-08 Thread Marc van Dongen
S.D.Mechveliani ([EMAIL PROTECTED]) wrote: [I cc'd this to haskell as well] : this is exactly the Domain conversion proposal, described in : basAlgPropos. class Cast a b where cast :: a -> b -> a. : The first argument is the sample for domain. The second casts to : `a' after the given sample

Cast by sample

2000-05-08 Thread S.D.Mechveliani
Marc Van Dongen writes about the need of constant :: a -> b -> and explains that it is needed, for example, to convert constant to polynomial. I consider this as kind of support for the Domain conversion proposal in basAlgPropos, section 'dcon'. It suggests

CFP: Workshop on Program Generation

2000-05-08 Thread Walid Taha
[Reminder: Deadline in two weeks.] LAST CALL FOR PAPERS Semantics, Applications and Implementation of Program Generation (SAIG) ICFP Wor

[dongen@cs.ucc.ie: Re: sample argument. Dongen's example]

2000-05-08 Thread Marc van Dongen
Sorry about this. I thought I group replied when replied Sergey's e-mail. -- Marc van Dongen, CS Dept | phone: +353 21 4903578 University College Cork, NUIC | Fax:+353 21 4903113 College Road, Cork, Ireland | Email: [EMAIL PROTECTED] - Forwarded message from Marc van Dongen <[EM

Re: sample argument. Dongen's example

2000-05-08 Thread Marc van Dongen
S.D.Mechveliani ([EMAIL PROTECTED]) wrote: : I wrote to list, and you reply privately. Ooops. I thought I group replied. I'll forward to the list. : I think that it is good for the list to know that someone else : appreciates the need of dynamic parameters in domain ... Which is why I decided

correction to example with Alfred ...

2000-05-08 Thread S.D.Mechveliani
I wrote on Fergus's example with Alfred, Betty ... type T a = T ... instance Additive (T a) where (T x)+(T y) = T (x+y) ... It should be data T a ... instance Additive a

Re: basAlgPropos. Skipping class methods

2000-05-08 Thread Ketil Malde
Fergus Henderson <[EMAIL PROTECTED]> writes: Also one writes, for example, zero x instead of zero `asTypeOf` x. > `asTypeOf` is effectively a builtin language construct that just > happens to be implemented as a function in the s

sample argument. Dongen's example

2000-05-08 Thread S.D.Mechveliani
Concerning the sample argument approach, Marc van Dongen <[EMAIL PROTECTED]> writes on May 8 2000 > I am not sure if I understand this but I also used > zero :: a -> a > to create polynomials as opposed to a function > zero :: a > The application > zero p > created a zero polynomial with certa