so:

not quite (though I believe that would be close to Simon M's idea).

in my modification, both map and length would move completely
into the export section, length# would stay in the local section.
both sections would just be module <body>s., containing full
definitions, declarations, imports. to export anything, move it
to the export section, to hide anything, move it to the local section (and in case that wasn't clear, these would be two sections of the same module <body>, only distinguished by
whether or not their contents are exported).

cheers,
claus

-- |iterate function over list
map :: (a->b) -> [a] -> [b]

-- |find length of list
length :: [a] -> Int

private:

map f (x:xs) = f x : map f xs
map f []     = []

length xs = length# xs 0#

length# (x:xs) n# = length# xs (n# +# 1)
length# []     n# = n#


and in order to see map's type or comment when i implement it, i
should see to other part of file. i personally prefer to have
public/private modifiers on each function and gather interface
documentation by tools like haddock


--
Best regards,
Bulat                            mailto:[EMAIL PROTECTED]

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to