Code from 2018-07-12 doesn't typecheck.
まだ誰も着手していません。
評価
調査の方向性
レポートに示されている Mul の Pretty インスタンス付近の src/Lib.hs を開き、型検査エラーを再現してください。LANGUAGE pragma またはコードの変更が必要かどうかを調査してください。両方のオペランドについて、報告されたエラーなしにインスタンスの型検査が通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
The pretty instance for Mul:
instance (Pretty l, Pretty r) => Pretty (Mul l r) where
pretty (Mul a b) = unwords [autoParens a, "*", autoParens b]
where autoParens a@(Add _ _) = "(" ++ pretty a ++ ")"
autoParens a = pretty a
Gives the following error:
• Couldn't match expected type ‘Add l0 r0’ with actual type ‘l’
‘l’ is a rigid type variable bound by
the instance declaration
at /home/leif/Documents/type-level/src/Lib.hs:91:10-49
• In the first argument of ‘autoParens’, namely ‘a’
In the expression: autoParens a
In the first argument of ‘unwords’, namely
‘[autoParens a, "*", autoParens b]’
• Relevant bindings include
a :: l (bound at /home/leif/Documents/type-level/src/Lib.hs:92:15)
pretty :: Mul l r -> String
(bound at /home/leif/Documents/type-level/src/Lib.hs:92:3)
And the same for autoParens b. I think I'm missing a LANGUAGE pragma somewhere that would prevent autoParens (Add _ _) from collapsing to Add l r -> String.
- 主要言語
- Haskell
- スター
- 18
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell-servant/haskell-servant.github.io のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
haskell-servant/haskell-servant.github.io#62 · コメント 5 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
haskell-servant/haskell-servant.github.io#61 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
haskell-servant/haskell-servant.github.io の issue をすべて見る
似ている issue
-
Web.Scotty.Trans.Lazy.setHeader calls addHeader instead of setHeader対応中かも @tusharad が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
scotty-web/scotty#436 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
input-output-hk/haskell.nix#2617 ·
-
easy first-contributor first-contributors good first issue haskell help wanted up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
fork-commit-merge/fork-commit-merge#8455 ·
メンテナーはふだん 1 日以内に返信
-
new tool
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
dense-analysis/ale#5176 ·
-
infrastructure
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alunduil/siren-json.hs#278 ·
メンテナーはふだん 1 日以内に返信