RE: functional dependency problem

2002-07-09 Thread Simon Peyton-Jones
| info :: (Collects e ce, Show e) = ce - String | info v = show ((one v) ::e) As the error message says, and as the Haskell report says, this means info v = show ((one v) :: (forall e.e)) which is not what you meant. Haskell does not have scoped type variables, so any type variables in

RE: unsafePerformIO around FFI calls

2002-07-09 Thread Simon Marlow
Hal Daume [EMAIL PROTECTED] writes: I'm curious exactly what is safe and what is unsafe to wrap unsafePerformIO around when it comes to FFI calls. Here's a simple test: Could you imagine an alternative implementation of the same API in pure Haskell? (Don't consider efficiency or

Re: unsafePerformIO around FFI calls

2002-07-09 Thread Alastair Reid
That's a nice succinct way to describe it. Another way, which boils down to the same thing but which is a little more concrete, is to ask: - Does the function's result depend only on the values of its arguments? I have two problems with this alternative test: 1) It is sometimes

ghc and -fno-implicit-prelude

2002-07-09 Thread MR K P SCHUPKE
Can I get ghc to use a local definition of `=` and return... currently I have: {-# OPTIONS -fglasgow-exts -fno-implicit-prelude #-} module Main(main) where import qualified Prelude (Monad(..)) import Prelude hiding (Monad(..)) ... Then a definition of Monad using a Premonad for return, however

RE: unsafePerformIO around FFI calls

2002-07-09 Thread Simon Marlow
That's a nice succinct way to describe it. Another way, which boils down to the same thing but which is a little more concrete, is to ask: - Does the function's result depend only on the values of its arguments? I have two problems with this alternative test: 1) It is

Re: functional dependency problem

2002-07-09 Thread Christian Maeder
Simon Peyton-Jones wrote: | info :: (Collects e ce, Show e) = ce - String | info v = show ((one v) ::e) As the error message says, and as the Haskell report says, this means info v = show ((one v) :: (forall e.e)) which is not what you meant. Ok, I did not know that I have to

functional dependency problem

2002-07-09 Thread Till Mossakowski
I wish to add to Christian's question: why is it not possible to annotate v with its full type: info :: (Collects e ce, Show e) = ce - String info (v::(Collects e ce, Show e) = ce) = show ((one v)::e) I then get the error message All of the type variables in the constraint `Collects e