[Haskell-cafe] confusion with fgl and ghc6
Luke Palmer
lrpalmer at gmail.com
Sun Jul 13 14:20:48 EDT 2008
On Sun, Jul 13, 2008 at 8:07 PM, David Bremner <bremner at unb.ca> wrote:
>
> I don't know whether this is a bug in fgl, in ghc, or I'm just confused.
> Any ideas? This is on debian/sid.
>
>
> GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
> Loading package base ... linking ... done.
> Prelude> import Data.Graph.Inductive.Example
> Prelude Data.Graph.Inductive.Example> star 6
The type of star is polymorphic:
> :t star
star :: (Graph gr) => Int -> gr () ()
Haskell does not know what type to pick for gr; there is no context
from which it can infer this information. So you need to specify
explicitly:
> star 6 :: Gr () ()
-- works
Luke
More information about the Haskell-Cafe
mailing list