
Say you have a function in Main that is the same name as a function you've imported, but you don't want to rename it. But then you have to prefix it with "Main" each time you use it: Main.functionName Is there some way to rename Main or make a synonym for it, kind of like the "import qualified" trick, so you could do... M.functionName -- frigidcode.com theologia.indicium.us

http://www.haskell.org/haskellwiki/Import You would do: import qualified Main as M On Fri, Jun 17, 2011 at 10:47 PM, Christopher Howard < christopher.howard@frigidcode.com> wrote:
Say you have a function in Main that is the same name as a function you've imported, but you don't want to rename it. But then you have to prefix it with "Main" each time you use it:
Main.functionName
Is there some way to rename Main or make a synonym for it, kind of like the "import qualified" trick, so you could do...
M.functionName
-- frigidcode.com theologia.indicium.us
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Michael Xavier http://www.michaelxavier.net

On 06/17/2011 11:43 PM, Michael Xavier wrote:
http://www.haskell.org/haskellwiki/Import
You would do: import qualified Main as M
On Fri, Jun 17, 2011 at 10:47 PM, Christopher Howard
mailto:christopher.howard@frigidcode.com> wrote: Say you have a function in Main that is the same name as a function you've imported, but you don't want to rename it. But then you have to prefix it with "Main" each time you use it:
Main.functionName
Is there some way to rename Main or make a synonym for it, kind of like the "import qualified" trick, so you could do...
M.functionName
-- frigidcode.com http://frigidcode.com theologia.indicium.us http://theologia.indicium.us
_______________________________________________ Beginners mailing list Beginners@haskell.org mailto:Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Michael Xavier http://www.michaelxavier.net
Thank you, however, I get the following error message: Module imports form a cycle for modules: Main (add_books.hs) imports: Main I'm running GHC 7.0.4 To be clear, I want Main qualified within the code that is Main. -- frigidcode.com theologia.indicium.us
participants (3)
-
Christopher Howard
-
Michael Xavier
-
Ozgur Akgun