[Haskell-beginners] Re: type def messes up

prad prad at towardsfreedom.com
Sat Jun 26 18:35:27 EDT 2010


On Sat, 26 Jun 2010 22:18:35 +0200
Daniel Fischer <daniel.is.fischer at web.de> wrote:

> It refers to the Haskell-1.3 report.
> There have been many changes in the language since then.
>
ok thx for the warning.
i'm starting to notice some issues.

also thx for the tips in your other post daniel.

here's a specific item i was referring to:

ndmPapers :: IO ()
ndmPapers = do
        tags <- fmap parseTags $ openURL
"http://community.haskell.org/~ndm/downloads/" let papers = map f $
sections (~== "<li class=paper>") tags putStr $ unlines papers
    where
        f :: [Tag] -> String
        f xs = fromTagText (xs !! 2)
http://community.haskell.org/~ndm/darcs/tagsoup/tagsoup.htm
at the bottom of the page: my papers (neil mitchell who wrote tagsoup
for haskell)

with the 
f :: [Tag] -> String
left in ghci croaks:

======
TagSoup.hs:66:14:
    `Tag' is not applied to enough type arguments
    Expected kind `*', but `Tag' has kind `* -> *'
    In the type signature for `f': f :: [Tag] -> String
    In the definition of `ndmPapers':
        ndmPapers = do { tags <- fmap parseTags
                               $ openURL
"http://community.haskell.org/~ndm/downloads/"; let papers = ...;
                           putStr $ unlines papers }
                  where
                      f :: [Tag] -> String
                      f xs = fromTagText (xs !! 2)
Failed, modules loaded: none.
======
(i'm guessing that Tag is some type defined in Text.HTML.TagSoup)

however, the program runs fine if i comment out the type def.

so i'm curious as to why this is so.

i can't do a :t on f getting a 'not in scope' error, i guess because it
is part of ndmPapers, but that seems strange to me.

-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's


More information about the Beginners mailing list