Higher-kinded type variables?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Issue không nêu tên tệp hoặc test nào trong repository. Hãy bắt đầu bằng việc nghiên cứu các encoding Any/ANY được đề xuất trong Haskell và mã GHC về suy luận và hợp nhất mà issue tham chiếu. Để được xem là hoàn tất, cần có thiết kế và triển khai cụ thể cho các biến Typeable higher-kinded, cùng với các test chứng minh việc suy luận và hợp nhất là chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I find myself wanting to be able to Typeable quantify over higher-kinded variables, like * -> * or Constraint. This problem comes in two parts: one of them I've thought a lot about and I'm pretty sure I've cracked, and one of them I haven't been able to swing at successfully.
{-# LANGUAGE PolyKinds, DataKinds, EmptyDataDecls, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperclasses #-}
import GHC.TypeLits (Nat)
import qualified GHC.Exts as E (Any)
There's two different approaches, which depend on what version of GHC you have. The first is the simpler, if you have a newer version.
data family Any :: Nat -> k -- Not exported
type family ANY :: Nat -> k where -- Exported
ANY = Any
Unlike the type family Any from GHC.Exts, the data family here is Typeable.
The other works if you have an older version which can't declare data families ending in anything other than *.
data AnyT0 (n :: Nat) -- None of these datatypes are exported.
data AnyT1 (n :: Nat) (a :: k)
data AnyT2 (n :: Nat) (a :: ka) (b :: kb)
-- And so on.
class E.Any => AnyC0 (n :: Nat) -- And neither are these.
class E.Any => AnyC1 (n :: Nat) (a :: k)
class E.Any => AnyC2 (n :: Nat) (a :: ka) (b :: kb)
type family ANY :: Nat -> k where -- This is, though.
ANY = AnyT0
ANY = AnyT1
ANY = AnyT2
ANY = AnyC0
ANY = AnyC1
ANY = AnyC2
-- And so on.
This is also more convenient because you use GHC-provided Nats rather than bespoke Peano nats.
The problem I'm having, and the reason this is an issue rather than a pull request, is I don't know how to do inference and unification on these types. I suspect you'd need something similar to GHC's code for it.
- Ngôn ngữ chính
- Haskell
- Star
- 753
- Fork
- 101
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của haskell-distributed/distributed-process
-
enhancement Feature Request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
haskell-distributed/distributed-process#486 · 1 bình luận · 1 reaction ·
-
discuss enhancement Feature Request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
haskell-distributed/distributed-process#478 · 4 bình luận · 3 reaction ·
-
enhancement Feature Request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
haskell-distributed/distributed-process#476 · 2 reaction ·
-
Demonstrating the use of Cloud Haskell for a Raft implementationCó thể làm lại được @LaurentRDC đã nhận 482 ngày trước và không có pull request nào đang mở. Đang mởenhancement Feature Request
haskell-distributed/distributed-process#475 · 3 reaction · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
haskell-distributed/distributed-process#473 · 4 bình luận · 1 reaction ·
Tất cả issue của haskell-distributed/distributed-process
Issue tương tự
-
MorphRule, DataizeRule and ContextualizeRule silently accept unknown YAML keys, unlike rewrite `Rule`Có thể đã có người làm @renyamamoto2026-cmyk đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
objectionary/phino#2107 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
tweag/tricorder#640 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày