Re: Kind error in GHC-7.4.1, works in GHC-7.2.2

2012-02-12 Thread Roel van Dijk
Thank you for the explanation. I now understand the problem. I have
rewritten the code using some parenthesis.

Thanks,
Roel

2012/2/10 Simon Peyton-Jones :
> It should not have worked before.  Consider
>
>        I#  $   3#
>
> ($) is a polymorphic function and takes two *pointer* arguments.  If we 
> actually called it with I# and 3# as arguments we might seg-fault when we 
> call the GC when allocating the box.
>
> Polymorphic type variables (in this case in the type of ($)) can only be 
> instantiated with boxed types.
>
> Simon

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Kind error in GHC-7.4.1, works in GHC-7.2.2

2012-02-10 Thread Simon Peyton-Jones
It should not have worked before.  Consider

I#  $   3#

($) is a polymorphic function and takes two *pointer* arguments.  If we 
actually called it with I# and 3# as arguments we might seg-fault when we call 
the GC when allocating the box.  

Polymorphic type variables (in this case in the type of ($)) can only be 
instantiated with boxed types.

Simon

| -Original Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-
| users-boun...@haskell.org] On Behalf Of Roel van Dijk
| Sent: 09 February 2012 19:57
| To: glasgow-haskell-users@haskell.org
| Subject: Kind error in GHC-7.4.1, works in GHC-7.2.2
| 
| Hello,
| 
| I have some code that compiled fine in GHC-7.2.2 but fails in
| GHC-7.4.1 with a kind error.
| 
| 
| {-# LANGUAGE MagicHash, NoImplicitPrelude, PackageImports #-}
| import "base" Data.Function ( ($) )
| import "base" GHC.Exts ( Int(I#) )
| import "base" Prelude ( Integral, fromIntegral, toInteger )
| import "integer-gmp" GHC.Integer.Logarithms ( integerLogBase# )
| 
| intLog :: (Integral a) => a -> a
| intLog x = fromIntegral $ I# $ integerLogBase# 10 (toInteger x)
| 
| 
| This results in the following error:
| 
| Couldn't match kind `#' against `*'
| In the second argument of `($)', namely
|   `I# $ integerLogBase# 10 (toInteger x)'
| In the expression:
|   fromIntegral $ I# $ integerLogBase# 10 (toInteger x)
| In an equation for `intLog':
| intLog x = fromIntegral $ I# $ integerLogBase# 10 (toInteger x)
| 
| 
| Simply eliminating some $'s using parenthesis solves the problem:
| 
| intLog x = fromIntegral $ I# (integerLogBase# 10 (toInteger x))
| 
| Why do I get the above kind error? Could it be a bug in GHC?
| 
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Kind error in GHC-7.4.1, works in GHC-7.2.2

2012-02-09 Thread Roel van Dijk
Hello,

I have some code that compiled fine in GHC-7.2.2 but fails in
GHC-7.4.1 with a kind error.


{-# LANGUAGE MagicHash, NoImplicitPrelude, PackageImports #-}
import "base" Data.Function ( ($) )
import "base" GHC.Exts ( Int(I#) )
import "base" Prelude ( Integral, fromIntegral, toInteger )
import "integer-gmp" GHC.Integer.Logarithms ( integerLogBase# )

intLog :: (Integral a) => a -> a
intLog x = fromIntegral $ I# $ integerLogBase# 10 (toInteger x)


This results in the following error:

Couldn't match kind `#' against `*'
In the second argument of `($)', namely
  `I# $ integerLogBase# 10 (toInteger x)'
In the expression:
  fromIntegral $ I# $ integerLogBase# 10 (toInteger x)
In an equation for `intLog':
intLog x = fromIntegral $ I# $ integerLogBase# 10 (toInteger x)


Simply eliminating some $'s using parenthesis solves the problem:

intLog x = fromIntegral $ I# (integerLogBase# 10 (toInteger x))

Why do I get the above kind error? Could it be a bug in GHC?

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: Type error in GHC-7 but not in GHC-6.12.3

2010-11-01 Thread Simon Peyton-Jones
OK now I see.  

You are using impredicative polymorphism.  As I mentioned in my last message 
I've simplified the treatment of impredicativity to follow (more or less) QML: 
http://research.microsoft.com/en-us/um/people/crusso/qml/


In the call to useWhich

useWhich devs withDevice p f

you can see that 
withDevice ∷ Monad pr
   ⇒ Device
   → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
   → pr α

useWhich ∷ ∀ k desc e (m ∷ * → *) α
 . (GetDescriptor e desc)
 ⇒ [e]
 → (e → k → m α)
 → (desc → Bool)
 → k
 → m α

So it follows that you must instantiate 
k = (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
Arguably GHC should complain at this point unless you use 
-XImpredicativePolymorphism, but it doesn't.
   
Now, the arguemnnt 'f' in the call, is apparently compatible with this type 
*except* that f's type is instantiated.  What you want is a way to say "don't 
instantiate f here".  QML provides a way to do that, via a "rigid" type 
signature, but GHC currently does not.  (Pressure of time, plus impredicativity 
is a somewhat obscure feature.)

So I guess I should implement rigid type signatures.  As ever the problem is 
syntax.

To work around this, use a newtype to the forall in the last argument of 
useWhich.

Simon


| -Original Message-
| From: Bas van Dijk [mailto:v.dijk@gmail.com]
| Sent: 30 October 2010 00:58
| To: glasgow-haskell-users@haskell.org
| Cc: Simon Peyton-Jones
| Subject: Re: Type error in GHC-7 but not in GHC-6.12.3
| 
| On Fri, Oct 29, 2010 at 5:42 PM, Simon Peyton-Jones
|  wrote:
| > That looks odd.
| >
| > Can you isolate it for us?  The easiest thing is usually to start with the
| offending code:
| > withDeviceWhich ∷
| >  ∀ pr α
| >  . MonadCatchIO pr
| >  ⇒ USB.Ctx
| >  → (USB.DeviceDesc → Bool)
| >  → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
| >  → pr α
| > withDeviceWhich ctx p f = do
| >  devs ← liftIO $ USB.getDevices ctx
| >  useWhich devs withDevice p f
| >
| > Now add local definitions for each of the functions mentioned, with 
definition foo
| = undefined.
| >
| > useWhich ∷
| >  ∀ k desc e (m ∷ * → *) α
| >  . (GetDescriptor e desc, MonadIO m)
| >  ⇒ [e]
| >  → (e → k → m α)
| >  → (desc → Bool)
| >  → k
| >  → m α
| > useWhich = undefined.
| >
| > Now all you need is the types involved, and you can probably define them as
| >
| > data RegionT s pr a
| >
| > etc
| >
| > That should give a standalone test case.
| >
| > Thanks!
| >
| > SImon
| >
| 
| Ok, Here's the more isolated program which still gives the same error
| as the full usb-safe (on the latest ghc-HEAD (7.1.20101029)):
| 
| 
| USBSafeTest.hs:39:57:
| Couldn't match expected type `forall s.
|   RegionalDeviceHandle (RegionT s pr)
| -> RegionT s pr α'
| with actual type `RegionalDeviceHandle (RegionT s pr)
|   -> RegionT s pr α'
| In the fourth argument of `useWhich', namely `f'
| In the expression: useWhich devs withDevice p f
| In the expression:
|   do { devs <- return [Device];
|useWhich devs withDevice p f }
| 
| 
| {-# LANGUAGE UnicodeSyntax
|, KindSignatures
|, RankNTypes
|, MultiParamTypeClasses
|, FunctionalDependencies
|   #-}
| 
| import Data.List (find)
| 
| data Ctx = Ctx
| data Device = Device
| data DeviceDesc = DeviceDesc
| data RegionalDeviceHandle (r ∷ * → *) = RegionalDeviceHandle
| data RegionT s (pr ∷ * → *) α = RegionT
| 
| instance Monad pr ⇒ Monad (RegionT s pr) where
| return = undefined
| (>>=)  = undefined
| 
| runRegionT ∷ (∀ s. RegionT s pr α) → pr α
| runRegionT = undefined
| 
| openDevice ∷ Device → RegionT s pr (RegionalDeviceHandle (RegionT s pr))
| openDevice = undefined
| 
| withDevice ∷ Monad pr
|⇒ Device
|→ (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
|→ pr α
| withDevice dev f = runRegionT $ openDevice dev >>= f
| 
| withDeviceWhich ∷ ∀ pr α
| . Monad pr
| ⇒ Ctx
| → (DeviceDesc → Bool)
| → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
| → pr α
| withDeviceWhich ctx p f = do devs ← return [Device]
|  useWhich devs withDevice p f
| 
| useWhich ∷ ∀ k desc e (m ∷ * → *) α
|  . (GetDescriptor e desc)
|  ⇒ [e]
|  → (e → k → m α)
|  → (desc → Bool)
|  → k
|  → m α
| useWhich ds w p f = case find (p . getDesc) ds of
|   Nothing → error "not found"
|   Just d  → w d f

RE: Type error in GHC-7 but not in GHC-6.12.3

2010-11-01 Thread Simon Peyton-Jones
| foo :: (forall s. ST s a) -> a
| foo st = ($) runST st

This is a motivating example for type inference that can deal with 
impredicative types.  Consider the type of ($):
($) :: forall p q.  (p->q) -> p -> q
In the example we need to instantiate 'p' with (forall s. ST s a), and that's 
what impredicative polymorphism means: instantiating a type variable with a 
polymorphic type.

Sadly, I know of no system of reasonable complexity that can typecheck 'foo' 
unaided.  There are plenty of complicated systems, and I have been a co-author 
on papers on at least two, but they are all Too Jolly Complicated to live in 
GHC.  We did have an implementation of boxy types, but I took it out when 
implementing the new typechecker.  Nobody understood it.

However, people so often write
runST $ do ...
that in GHC 7 I implemented a special typing rule, just for infix uses of ($).  
Just think of
(f $ x) as a new syntactic form, with the obvious typing rule, and away you go.

It's very ad hoc, because it's absolutely specific to ($), and I'll take it out 
if you all hate it, but it's in GHC 7 for now.

Anyway, that's why you encountered the puzzling behaviour you describe below.

Simon

| -Original Message-
| From: Bas van Dijk [mailto:v.dijk@gmail.com]
| Sent: 30 October 2010 21:14
| To: glasgow-haskell-users@haskell.org
| Cc: Simon Peyton-Jones
| Subject: Re: Type error in GHC-7 but not in GHC-6.12.3
| 
| On Sat, Oct 30, 2010 at 1:57 AM, Bas van Dijk  wrote:
| > I could isolate it a bit more if you want.
| 
| And so I did. The following is another instance of the problem I'm
| having but set in a more familiar setting:
| 
| {-# LANGUAGE RankNTypes #-}
| 
| import Control.Monad.ST
| 
| foo :: (forall s. ST s a) -> a
| foo st = ($) runST st
| 
| Couldn't match expected type `forall s. ST s a'
| with actual type `ST s a'
| In the second argument of `($)', namely `st'
| 
| Note that: 'foo st = runST st' type checks as expected.
| 
| Surprisingly 'foo st = runST $ st' also type checks!
| 
| I find the latter surprising because according to the report[1]: e1 op
| e2 = (op) e1 e2. So either both should type check or both should fail.
| 
| I guess that a RULE somewhere eliminates the ($) before the
| type-checker kicks in. I do find that a little strange because I
| thought RULES where applied after type checking.
| 
| Regards,
| 
| Bas
| 
| [1] http://www.haskell.org/onlinereport/exps.html#operators

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Type error in GHC-7 but not in GHC-6.12.3

2010-10-31 Thread Bas van Dijk
(resending this to the list because this failed yesterday because of
the mailinglist downtime)

On Sat, Oct 30, 2010 at 1:57 AM, Bas van Dijk  wrote:
> I could isolate it a bit more if you want.

And so I did. The following is another instance of the problem I'm
having but set in a more familiar setting:

{-# LANGUAGE RankNTypes #-}

import Control.Monad.ST

foo :: (forall s. ST s a) -> a
foo st = ($) runST st

Couldn't match expected type `forall s. ST s a'
               with actual type `ST s a'
   In the second argument of `($)', namely `st'

Note that: 'foo st = runST st' type checks as expected.

Surprisingly 'foo st = runST $ st' also type checks!

I find the latter surprising because according to the report[1]: e1 op
e2 = (op) e1 e2. So either both should type check or both should fail.

I guess that a RULE somewhere eliminates the ($) before the
type-checker kicks in. I do find that a little strange because I
thought RULES where applied after type checking.

Regards,

Bas

[1] http://www.haskell.org/onlinereport/exps.html#operators
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Type error in GHC-7 but not in GHC-6.12.3

2010-10-29 Thread Bas van Dijk
On Fri, Oct 29, 2010 at 5:42 PM, Simon Peyton-Jones
 wrote:
> That looks odd.
>
> Can you isolate it for us?  The easiest thing is usually to start with the 
> offending code:
> withDeviceWhich ∷
>  ∀ pr α
>  . MonadCatchIO pr
>  ⇒ USB.Ctx
>  → (USB.DeviceDesc → Bool)
>  → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
>  → pr α
> withDeviceWhich ctx p f = do
>  devs ← liftIO $ USB.getDevices ctx
>  useWhich devs withDevice p f
>
> Now add local definitions for each of the functions mentioned, with 
> definition foo = undefined.
>
> useWhich ∷
>  ∀ k desc e (m ∷ * → *) α
>  . (GetDescriptor e desc, MonadIO m)
>  ⇒ [e]
>  → (e → k → m α)
>  → (desc → Bool)
>  → k
>  → m α
> useWhich = undefined.
>
> Now all you need is the types involved, and you can probably define them as
>
> data RegionT s pr a
>
> etc
>
> That should give a standalone test case.
>
> Thanks!
>
> SImon
>

Ok, Here's the more isolated program which still gives the same error
as the full usb-safe (on the latest ghc-HEAD (7.1.20101029)):


USBSafeTest.hs:39:57:
Couldn't match expected type `forall s.
  RegionalDeviceHandle (RegionT s pr)
-> RegionT s pr α'
with actual type `RegionalDeviceHandle (RegionT s pr)
  -> RegionT s pr α'
In the fourth argument of `useWhich', namely `f'
In the expression: useWhich devs withDevice p f
In the expression:
  do { devs <- return [Device];
   useWhich devs withDevice p f }


{-# LANGUAGE UnicodeSyntax
   , KindSignatures
   , RankNTypes
   , MultiParamTypeClasses
   , FunctionalDependencies
  #-}

import Data.List (find)

data Ctx = Ctx
data Device = Device
data DeviceDesc = DeviceDesc
data RegionalDeviceHandle (r ∷ * → *) = RegionalDeviceHandle
data RegionT s (pr ∷ * → *) α = RegionT

instance Monad pr ⇒ Monad (RegionT s pr) where
return = undefined
(>>=)  = undefined

runRegionT ∷ (∀ s. RegionT s pr α) → pr α
runRegionT = undefined

openDevice ∷ Device → RegionT s pr (RegionalDeviceHandle (RegionT s pr))
openDevice = undefined

withDevice ∷ Monad pr
   ⇒ Device
   → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
   → pr α
withDevice dev f = runRegionT $ openDevice dev >>= f

withDeviceWhich ∷ ∀ pr α
. Monad pr
⇒ Ctx
→ (DeviceDesc → Bool)
→ (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
→ pr α
withDeviceWhich ctx p f = do devs ← return [Device]
 useWhich devs withDevice p f

useWhich ∷ ∀ k desc e (m ∷ * → *) α
 . (GetDescriptor e desc)
 ⇒ [e]
 → (e → k → m α)
 → (desc → Bool)
 → k
 → m α
useWhich ds w p f = case find (p . getDesc) ds of
  Nothing → error "not found"
  Just d  → w d f

class GetDescriptor α desc | α → desc, desc → α where
getDesc ∷ α → desc

instance GetDescriptor Device DeviceDesc where
getDesc = undefined


I could isolate it a bit more if you want.

Thanks,

Bas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Type error in GHC-7 but not in GHC-6.12.3

2010-10-29 Thread Bas van Dijk
Hello,

I'm updating my usb-safe package for GHC-7:

darcs get http://code.haskell.org/~basvandijk/code/usb-safe

It depends on the HEAD version of regions:
darcs get http://code.haskell.org/~basvandijk/code/regions

I think I'm suffering from the new implied MonoLocalBinds extension
(I'm using GADTs) as described in:

http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7

However, I'm not sure this is the problem because I'm not using local
bindings and use explicit type signatures everywhere.

I try to make a small isolated example when I have time but for now
let's use the actual definitions:

The following function type-checked fine in GHC-6.12.3 but fails in
GHC-7.1.20101027:

withDeviceWhich ∷
  ∀ pr α
  . MonadCatchIO pr
  ⇒ USB.Ctx
  → (USB.DeviceDesc → Bool)
  → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
  → pr α
withDeviceWhich ctx p f = do
  devs ← liftIO $ USB.getDevices ctx
  useWhich devs withDevice p f

The error I get is:

Couldn't match expected type `forall s.
  RegionalDeviceHandle (RegionT s pr)
  -> RegionT s pr α'
with actual type `RegionalDeviceHandle (RegionT s pr)
  -> RegionT s pr α'
In the fourth argument of `useWhich', namely `f'

These are the types and definitions of the other functions involved:

useWhich ∷
  ∀ k desc e (m ∷ * → *) α
  . (GetDescriptor e desc, MonadIO m)
  ⇒ [e]
  → (e → k → m α)
  → (desc → Bool)
  → k
  → m α
useWhich ds w p f = case find (p ∘ getDesc) ds of
  Nothing → throw USB.NotFoundException
  Just d  → w d f

withDevice ∷
MonadCatchIO pr
  ⇒ USB.Device
  → (∀ s. RegionalDeviceHandle (RegionT s pr) → RegionT s pr α)
  → pr α
withDevice dev f = runRegionT $ openDevice dev >>= f

Note that when I inline the definition of useWhich it type-checks fine:

withDeviceWhich ctx p f = do
  devs ← liftIO $ USB.getDevices ctx
  case find (p ∘ getDesc) devs of
Nothing → throw USB.NotFoundException
Just d  → withDevice d f

Since I'm not using local bindings and use explicit type signatures
everywhere, I'm not sure MonoLocalBinds is the problem.

Note that other applications of useWhich which also use RankNTypes
type-check just fine in both GHC-6.12.3 and GHC-7.1.20101027:

---

setConfigWhich ∷
  ∀ pr cr α
  . (pr `AncestorRegion` cr, MonadCatchIO cr)
  ⇒ RegionalDeviceHandle pr
  → (USB.ConfigDesc → Bool)
  → (∀ sCfg. ConfigHandle sCfg → cr α)
  → cr α
setConfigWhich h = useWhich (getConfigs h) setConfig

getConfigs ∷ RegionalDeviceHandle r → [Config r]

setConfig ∷
  ∀ pr cr α
  . (pr `AncestorRegion` cr, MonadCatchIO cr)
  ⇒ Config pr
  → (∀ sCfg. ConfigHandle sCfg → cr α)
  → cr α

---

withInterfaceWhich ∷
  ∀ pr sCfg α
  . MonadCatchIO pr
  ⇒ ConfigHandle sCfg
  → (USB.Interface → Bool)
  → (∀ s. RegionalInterfaceHandle sCfg (RegionT s pr) → RegionT s pr α)
  → pr α
withInterfaceWhich h = useWhich (getInterfaces h) withInterface

getInterfaces ∷ ConfigHandle sCfg → [Interface sCfg]

withInterface ∷
  ∀ pr sCfg α
  . MonadCatchIO pr
  ⇒ Interface sCfg
  → (∀ s. RegionalInterfaceHandle sCfg (RegionT s pr) → RegionT s pr α)
  → pr α


---

setAlternateWhich ∷
  ∀ pr cr sCfg α
  . (pr `AncestorRegion` cr, MonadCatchIO cr)
  ⇒ RegionalInterfaceHandle sCfg pr
  → (USB.InterfaceDesc → Bool)
  → (∀ sAlt. AlternateHandle sAlt pr → cr α)
  → cr α
setAlternateWhich h = useWhich (getAlternates h) setAlternate

getAlternates ∷ RegionalInterfaceHandle sCfg r → [Alternate sCfg r]

setAlternate ∷
  ∀ pr cr sCfg α
  . (pr `AncestorRegion` cr, MonadCatchIO cr)
  ⇒ Alternate sCfg pr
  → (∀ sAlt. AlternateHandle sAlt pr → cr α)
  → cr α


---

I'm happy to provide more info when needed.

Regards,

Bas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Linking error in GHC 6.4.2 snapshot of 21 April (mingw).

2006-04-24 Thread Cyril Schmidt
This solves the problem, thanks!

Cyril

Simon Marlow wrote:
> Cyril Schmidt wrote:
>> When I downloaded and unpacked the latest GHC snapshot of the STABLE
>> branch for Windows (ghc-6.4.2.20060421-i386-unknown-mingw32.tar.gz),
>> I got the following error trying to start GHCi:
>>
>> Loading package base-1.0 ... linking ... :
>> c:/ghc/GHC-64~1.2/HSbase1.o: unknown symbol `_sqrtf'
>> : unable to load package `base-1.0'
>
> Sigbjorn's candidate installer doesn't have this problem:
>
>   http://www.haskell.org/ghc/dist/stable/dist/ghc-6-4-2-20060421.msi
>
> It's a bug in 6.4.2, sadly.
>
> Cheers,
>   Simon
>

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Linking error in GHC 6.4.2 snapshot of 21 April (mingw).

2006-04-24 Thread Simon Marlow

Cyril Schmidt wrote:

When I downloaded and unpacked the latest GHC snapshot of the STABLE
branch for Windows (ghc-6.4.2.20060421-i386-unknown-mingw32.tar.gz),
I got the following error trying to start GHCi:
___
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.4.2, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base-1.0 ... linking ... :
c:/ghc/GHC-64~1.2/HSbase1.o: unknown symbol `_sqrtf'
: unable to load package `base-1.0'
___

The complaint about _sqrtf also shows up when I try to
compile/link anything with ghc; so the problem is bigger
than just not being able to use GHCi.

The GHC is installed in c:\ghc\ghc-6.4.2, the PATH begins with
c:\ghc\ghc-6.4.2;c:\ghc\ghc-6.4.2\bin;c:\ghc\ghc-6.4.2\gcc-lib;
LIBRARY_PATH is set to c:\ghc\ghc-6.4.2\gcc-lib

I know for sure that the 6.4.2 snapshot of a couple of weeks ago
worked fine, so I wonder what might be wrong with the latest one.
I would appreciate any hints.


Sigbjorn's candidate installer doesn't have this problem:

 http://www.haskell.org/ghc/dist/stable/dist/ghc-6-4-2-20060421.msi

It's a bug in 6.4.2, sadly.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Linking error in GHC 6.4.2 snapshot of 21 April (mingw).

2006-04-24 Thread Cyril Schmidt
When I downloaded and unpacked the latest GHC snapshot of the STABLE
branch for Windows (ghc-6.4.2.20060421-i386-unknown-mingw32.tar.gz),
I got the following error trying to start GHCi:
___
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.4.2, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base-1.0 ... linking ... :
c:/ghc/GHC-64~1.2/HSbase1.o: unknown symbol `_sqrtf'
: unable to load package `base-1.0'
___

The complaint about _sqrtf also shows up when I try to
compile/link anything with ghc; so the problem is bigger
than just not being able to use GHCi.

The GHC is installed in c:\ghc\ghc-6.4.2, the PATH begins with
c:\ghc\ghc-6.4.2;c:\ghc\ghc-6.4.2\bin;c:\ghc\ghc-6.4.2\gcc-lib;
LIBRARY_PATH is set to c:\ghc\ghc-6.4.2\gcc-lib

I know for sure that the 6.4.2 snapshot of a couple of weeks ago
worked fine, so I wonder what might be wrong with the latest one.
I would appreciate any hints.

Cheers,

Cyril


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Error in GHC

2006-01-19 Thread Tays Soares
  Thanks Lemmih. I already fixed this error. The module declaration in my Main file was giving it a wrong name (not Main).Thank you.  Lemmih <[EMAIL PROTECTED]> escreveu:  On 1/18/06, Tays Soares  wrote:>  I'm trying to run the following sequence on ghc 6.4:>  > ghc -fglasgow-exts --make Main>> > ghc -o exec Main.o Exemplo1.o>> But I always get this error message after the second command:> /usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0xe): In function `main':> : undefined reference to `__stginit_ZCMain'> /usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0x28): In function `main':> : undefined reference to `ZCMain_main_closure'> collect2: ld returned 1 exit status>> Please
 , does
 anybody know what can I do to fix it?Does your main module contain a function called "main"? Does "ghc-fglasgow-exts --make Main -o exec" work?--Friendly,  LemmihTays Cristina do Amaral Pales Soares
		 
Yahoo! doce lar. Faça do Yahoo! sua homepage.___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Error in GHC

2006-01-18 Thread Lemmih
On 1/18/06, Tays Soares <[EMAIL PROTECTED]> wrote:
>  I'm trying to run the following sequence on ghc 6.4:
>  > ghc -fglasgow-exts --make Main
>
> > ghc -o exec Main.o Exemplo1.o
>
> But I always get this error message after the second command:
> /usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0xe): In function `main':
> : undefined reference to `__stginit_ZCMain'
> /usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0x28): In function `main':
> : undefined reference to `ZCMain_main_closure'
> collect2: ld returned 1 exit status
>
> Please, does anybody know what can I do to fix it?

Does your main module contain a function called "main"? Does "ghc
-fglasgow-exts --make Main -o exec" work?

--
Friendly,
  Lemmih
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Error in GHC

2006-01-18 Thread Tays Soares
 I'm trying to run the following sequence on ghc 6.4:  > ghc -fglasgow-exts --make Main> ghc -o exec Main.o Exemplo1.oBut I always get this error message after the second command:/usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0xe): In function `main':: undefined reference to `__stginit_ZCMain'/usr/lib/ghc-6.4/libHSrts.a(Main.o)(.text+0x28): In function `main':: undefined reference to `ZCMain_main_closure'collect2: ld returned 1 exit statusPlease, does anybody know what can I do to fix it?ThanksTays Cristina do Amaral Pales Soares
		 
Yahoo! doce lar. Faça do Yahoo! sua homepage.___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users