[Haskell-cafe] Re: QuickCheck Fun with Phantom Types

2006-05-22 Thread Dominic Steinitz
Since Don was kind enough to include my question in HWN (http://www.cse.unsw.edu.au/~dons/code/hwn/archives/20060522.html) and I have now come up with a solution, I have created a wiki page (http://haskell.org/haskellwiki/QuickCheck_/_GADT) with it in. Dominic

[Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Scherrer, Chad
Thanks to all who responded about the benefits of using Cabal. After trying out Bulat's Streams library, I thought I would download ByteString (aka FPS) to compare the wc demos. To compile something using Streams, I need to use a -i flag (thanks Bulat). When I followed the README that comes with

Re: [Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Henning Thielemann
On Mon, 22 May 2006, Scherrer, Chad wrote: % ./Setup.hs install Installing: /f/g/lib/fps-0.7 /f/g/bin fps-0.7... *** Exception: /f: createDirectory: permission denied (Permission denied) I don't have root on this machine, and it's not obvious (to me) how to specify that everything should be

Re: [Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Lemmih
On 5/22/06, Henning Thielemann [EMAIL PROTECTED] wrote: On Mon, 22 May 2006, Scherrer, Chad wrote: % ./Setup.hs install Installing: /f/g/lib/fps-0.7 /f/g/bin fps-0.7... *** Exception: /f: createDirectory: permission denied (Permission denied) I don't have root on this machine, and it's

RE: [Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Scherrer, Chad
-Original Message- From: Henning Thielemann [mailto:[EMAIL PROTECTED] Install locally after configuring this way: ./Setup.lhs configure --user --prefix=$HOME/yourlocalhaskelllibsdir That seemed to do fine until it came to registering the package, which I don't permission for.

Re: [Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Lemmih
On 5/22/06, Scherrer, Chad [EMAIL PROTECTED] wrote: -Original Message- From: Henning Thielemann [mailto:[EMAIL PROTECTED] Install locally after configuring this way: ./Setup.lhs configure --user --prefix=$HOME/yourlocalhaskelllibsdir That seemed to do fine until it came to

RE: [Haskell-cafe] Trouble with Cabal

2006-05-22 Thread Scherrer, Chad
Ok, it works now. Thanks for the help! Chad Scherrer Computational Mathematics Group Pacific Northwest National Laboratory Time flies like an arrow; fruit flies like a banana. -- Groucho Marx -Original Message- From: Lemmih [mailto:[EMAIL PROTECTED] Sent: Monday, May 22, 2006 10:41

[Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Brian Hulley
Hi - I've got the following function which doesn't compile: createMonoMultiFont :: (MonadException m, Enum i, Bounded i) = [(i, Font, Colour)] - m (MonoMultiFont i) createMonoMultiFont elements = liftIO . block $ do mmfRaw - duma_MonoMultiFont_create (fromEnum

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Brian Hulley
Brian Hulley wrote: Hi - I've got the following function which doesn't compile: createMonoMultiFont :: (MonadException m, Enum i, Bounded i) = [(i, Font, Colour)] - m (MonoMultiFont i) createMonoMultiFont elements = liftIO . block $ do mmfRaw -

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Chris Kuklewicz
See 7.4.10.3 Declaration type signatures in the manual: http://haskell.org/ghc/docs/6.4.2/html/users_guide/type-extensions.html#decl-type-sigs At the moment, the i in the type declaration and in the body are not the same i. To get the i from the type declaration for createMonoMultiFont into the

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Cale Gibbard
Hello, There's a prelude function called asTypeOf which might help here: asTypeOf :: a - a - a asTypeOf = const You can use maxBound `asTypeOf` (fst3 . head $ elements) Another option is GHC's scoped type variables, which you use by adding a type signature to your pattern. See:

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Brian Hulley
Chris Kuklewicz wrote: See 7.4.10.3 Declaration type signatures in the manual: http://haskell.org/ghc/docs/6.4.2/html/users_guide/type-extensions.html#decl-type-sigs At the moment, the i in the type declaration and in the body are not the same i. To get the i from the type declaration for

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-22 Thread Brian Hulley
Cale Gibbard wrote: Hello, There's a prelude function called asTypeOf which might help here: asTypeOf :: a - a - a asTypeOf = const You can use maxBound `asTypeOf` (fst3 . head $ elements) Another option is GHC's scoped type variables, which you use by adding a type signature to your pattern.