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.
.hiインターフェース ファイルのみを生成したいと考えています (オブジェクト ファイルもコード生成もありません)。
.hi
私は試した
ghc -fno-code -ohi out.hi myfile.hs
そして得る
ghc: -ohi can only be used when compiling a single source file
ソースファイルを 1 つしか与えていないので、これはわかりません。
オプションを使用-cするか、そうでなければghcはコンパイルするだけでなくリンクしたい:
-c
ghc -fno-code -ohi out.hi -c myfile.hs
更新:しかし、作成-fno-codeを妨げるため、実際には役に立ちません。.hi
-fno-code
ghc -o /dev/null -ohi out.hi -c myfile.hs
これは、コンパイルの結果を破棄します。ただし、最新の場合out.hiは不要なコンパイルも回避されます。
out.hi