[英]Haskell : error while declaring new type
我在文件file.hs
定義了新類型
module FunctorChapter
(
FixMePls
)
where
data FixMePls a =
Fixme | Pls a
deriving (Show,Eq)
進口時file.hs
到ghci中它加載成功,但我不能夠使用構造Pls
Main File> Pls "test"
<interactive>:5:1: Not in scope: data constructor ‘Pls’
雖然我可以使用Just構造函數
Main File> Just "me"
Just "me"
我的類型中缺少什么?
您沒有加載FunctorChapter
模塊,但是有一些不同的File
模塊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.