Closed ddssff closed 8 years ago
Thank you for your interest. getTopDeclSymbols
returns all symbols bound by the given declaration. A type signature does not bind any symbols. The names in top level type signatures reference symbols bound by other top level declarations. For example:
module MyConstant where
five :: Int
five = 5
The second declaration binds Value (ModuleName "MyConstant") (Ident "five")
. Better documentation is sorely needed. If you have a specific use case I am glad to help.
I am using it to make a predicate that selects declarations by symbol name so I could move them to another module. If the definition moves the signature needs to move with it. I just put a wrapper around getTopDeclSymbols to explicitly check the TypeSig case.
Is there a reason no symbols are returned by getTopDeclSymbols for a type signature?