Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell: Qualified name in binding position?

Tags:

haskell

I have a file test.hs with the following code:

Mp1.gcd a =a

When I compile it, there is this error:

"Qualified name in binding position:Mp1.gcd Failed, modules loaded:none"

I use Mp1.gcd because the official API has "gcd".

Is this problem about my naming conventions? How can I fix it?

like image 698
user3239558 Avatar asked Jan 30 '14 04:01

user3239558


1 Answers

You can define it without qualifying it at all:

gcd a = {- ... -}

Then qualify it in your export list:

module MyModule (MyModule.gcd) where

Alternatively, remove the possibility for conflict altogether by excluding Prelude's gcd:

import Prelude hiding (gcd)
like image 138
icktoofay Avatar answered Oct 18 '22 02:10

icktoofay