Re: [Haskell-cafe] cabal --user question

2005-07-11 Thread Frederik Eaton
Hi Isaac, Is there a way to specify a particular package.conf for use when installing and registering packages with Cabal? I'm trying to Cabal-ize WASH which has a number of packages which depend on each other. The problem is that in order to build the next package, the previous one has to be

[Haskell-cafe] Re: cabal --user question

2005-07-11 Thread Peter Simons
Isaac Jones writes: ./setup configure --user #if it depends on user-local packages ./setup build ./setup install --user Perhaps install --user should be the default if you configure --user. Yes, I think that would be more intuitive. It would also be nice to be able to configure Cabal

[Haskell-cafe] Interaction in Haskell

2005-07-11 Thread Dinh Tien Tuan Anh
Hi, im using Hugs 98 and learing how to use interactive Haskell. As read in the book: capitalise :: [Char] - [Char] capitalise = takeWhile(/='.') . map toUpper interact capitalise its said the program is FULLY INTERACTIVE, i.e: as soon as 'h' typed on the keyboard, an 'H'

Re: [Haskell-cafe] Interaction in Haskell

2005-07-11 Thread Henning Thielemann
On Mon, 11 Jul 2005, Dinh Tien Tuan Anh wrote: Hi, im using Hugs 98 and learing how to use interactive Haskell. As read in the book: capitalise :: [Char] - [Char] capitalise = takeWhile(/='.') . map toUpper interact capitalise its said the program is FULLY

Re: [Haskell-cafe] Interaction in Haskell

2005-07-11 Thread Dinh Tien Tuan Anh
You're right, i've been using shell in Emacs to run Hugs, but when back to normal terminal, it works. Just for curiousity, why does it happen ? Thank you very much Cheers Yes, it is certainly not Hugs which prevents from realtime interaction but it is the terminal you are using. If the

[Haskell-cafe] Can't explain this error

2005-07-11 Thread Dinh Tien Tuan Anh
could anyone tell me what i did wrong with this please sumHam :: Integer - Float sumHam n = sum [1/x | x-[1..n]] Error: type error in explicitly typed binding Term: sumHam Type: Integer - Integer Does not match : Integer - Float it only

Re: [Haskell-cafe] Can't explain this error

2005-07-11 Thread Andy Georges
On 11 Jul 2005, at 17:37, Dinh Tien Tuan Anh wrote: sumHam :: Integer - Float sumHam n = sum [1/x | x-[1..n]] Try this: sumHam :: Integer - Float sumHam n = sum [1.0/(fromIntegral x) | x-[-1..n]] -- Andy ___

Re: [Haskell-cafe] Can't explain this error

2005-07-11 Thread Dinh Tien Tuan Anh
Thanks for your reply, i just simply removed the first line and it works, but i dont understand why 1/x is not Float. Try this: sumHam :: Integer - Float sumHam n = sum [1.0/(fromIntegral x) | x-[-1..n]] -- Andy _ Use MSN

Re: [Haskell-cafe] Can't explain this error

2005-07-11 Thread robert dockins
You are trying to divide by an Integer and get a Float. Haskell doesn't do automatic numeric conversion, so you have to do the casts manually. Prelude let sumHam n = sum [ 1 / (fromIntegral x) | x - [1..n] ] Prelude sumHam 5 2.283 Dinh Tien Tuan Anh wrote: could anyone tell me

Re: [Haskell-cafe] Can't explain this error

2005-07-11 Thread robert dockins
Thanks for your reply, i just simply removed the first line and it works, but i dont understand why 1/x is not Float. It depends on the type of 'x'. If 'x' is a Float, (1/x) will be a Float. If 'x' is a Double, (1/x) will be a Double. If 'x' is an Integer (1/x) will not typecheck

Re: [Haskell-cafe] Interaction in Haskell

2005-07-11 Thread Glynn Clements
Dinh Tien Tuan Anh wrote: Yes, it is certainly not Hugs which prevents from realtime interaction but it is the terminal you are using. If the terminal lets you delete the characters on the current line it has to keep them until you complete it with ENTER. Piping from and to other

RE: [Haskell-cafe] Overlapping Instances with Functional Dependencies

2005-07-11 Thread oleg
Daniel Brown wrote: class Baz a b | a - b instance Baz (a - b) (a - [b]) instance Baz a a ...but Baz fails with this error... When confronted with overlapping instances, the compiler chooses the most specific one (if it is unique), e.g. `Baz (a - b) (a - [b])` is more specific

RE: [Haskell-cafe] Overlapping Instances with Functional Dependencies

2005-07-11 Thread Martin Sulzmann
This is still an ad-hoc solution, cause you lose the `most-specific' instance property. You really have to impose a `fixed' ordering in which instance-improvement rules fire. Recap: The combination of overlapping instances and type improvement leads to a `non-confluent' system, i.e. there're