2017-04-10 33 views
1

我通過教程運行,並且我試圖導入Maybe模塊,但我得到下面的錯誤:榆樹:多個模塊命名也許

I found multiple modules named 'Maybe'. 

Module 'Main' is trying to import it. 

Modules with that name were found in the following locations: 

directory ././Maybe.elm 
package elm-lang/core 

如何指向的一個以上包?

回答

2

elm-lang/core包中的Maybe模塊是imported by default,所以如果這就是您要導入的內容,則不需要這樣做。

我無法確定是什麼原因造成了名稱衝突,而沒有看到您已經安裝了哪些軟件包,但是如果您創建了自己的模塊Maybe,我建議將其重命名。模塊名稱模式(例如NameOfDirectory.NameOfModule)在Elm中很常見(實際上,我認爲它們有點強制執行)。

+1

我明白了。我只是有一個名爲maybe.elm的文件,這是導致衝突。我重命名了它並修復了它。 – Rich