1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

stylish-haskellをBlockArgumentsに対応させる

Posted at

stylish-haskellをBlockArgumentsに対応させる

 次に同じことをするときのための自分用のメモ。

背景と問題

  • 私はHaskellのフォーマッタにstylish-haskellを使っている。
  • BlockArgumentsやDerivingVia拡張を使うと、stylish-haskellがこれをパースできなくなってしまう。

解決策

 ありがたいことに、解決策はここに書いてあった。

 グローバルへの汚染が最も少なそうな2番目の手順を試したところ、新たにインストールしたstylish-haskellは問題なく動いてくれた。
 他に書くべきこともないので、私がやった手順の日本語訳を置いておく。

手頃なプロジェクトの stack.yaml を編集して、extra-dephaskell-src-exts-1.23.0 を与える。その後、そのプロジェクト上でstack install stylish-haskellを実行する。

引用元

 引用元のURLはこちら。

Unable to parse BlockArguments syntax #229
https://github.com/jaspervdj/stylish-haskell/issues/229#issuecomment-598839774

 翻訳元のコメントはこちら。

stylish-haskell\ will work with this provided that you build it with haskell-src-exts-1.23.0`. You can do this in a few ways:

  1. Edit your global project (~/.stack/global-project/stack.yaml) to set haskell-src-exts-1.23.0 as an extra-dep, and then do stack install stylish-haskell
  2. Edit whatever project stack.yaml you have handy and set haskell-src-exts-1.23.0 as an extra-dep, and then do stack install stylish-haskell from that project.
  3. Run stack exec --no-ghc-package-path -- cabal new-install stylish-haskell which will automatically pull dependencies and use the GHC provided by stack (may require you to call stack install cabal-install)

haskell-src-exts is currently being held up by haskell-names, and I have opened a PR that should unblock haskell-src-exts.

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?