Higher-kinded type variables?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Das Issue nennt keine Dateien oder Tests des Repositorys. Beginne damit, die vorgeschlagenen Haskell-Any/ANY-Kodierungen sowie den darin referenzierten GHC-Code für Inferenz und Unifikation zu untersuchen. Für den Abschluss wären ein konkretes Design und eine Implementierung für höherkindige Typeable-Variablen erforderlich, mit Tests, die die korrekte Inferenz und Unifikation demonstrieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Haskell
- Sterne
- 753
- Forks
- 101
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus haskell-distributed/distributed-process
-
enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
haskell-distributed/distributed-process#486 · 1 Kommentar · 1 Reaktion ·
-
discuss enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
haskell-distributed/distributed-process#478 · 4 Kommentare · 3 Reaktionen ·
-
enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
haskell-distributed/distributed-process#476 · 2 Reaktionen ·
-
Demonstrating the use of Cloud Haskell for a Raft implementationEvtl. wieder frei @LaurentRDC hat das vor 483 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement Feature Request
haskell-distributed/distributed-process#475 · 3 Reaktionen · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
haskell-distributed/distributed-process#473 · 4 Kommentare · 1 Reaktion ·
Alle Issues in haskell-distributed/distributed-process
Ähnliche Issues
-
MorphRule, DataizeRule and ContextualizeRule silently accept unknown YAML keys, unlike rewrite `Rule`Evtl. vergeben @renyamamoto2026-cmyk hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
objectionary/phino#2107 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
tweag/tricorder#640 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag