Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
[ソースコード]
データFooBar=Foo | バー
[指示]
$ ghc -c foo_bar.hs foo_bar.hs:1:0:関数「main」がモジュール「Main」で定義されていません
[構成]
Glasgow Haskellコンパイラバージョン6.12.3、Haskell 98用、ステージ2、GHCバージョン6.10.4で起動
モジュールでタイプを定義してから、コンパイルする必要があります。
module Test where data FooBar = Foo | Bar
を呼び出すことによりghc -c foo_bar.hs、を定義しなくてもオブジェクトファイルfoo_bar.oが生成されますmain。
ghc -c foo_bar.hs
foo_bar.o
main