Higher-kinded type variables?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
La issue non nomina file o test del repository. Inizia studiando le codifiche Any/ANY proposte in Haskell e il codice GHC per l'inferenza e l'unificazione a cui fa riferimento. Per considerare il lavoro completato servirebbero un design e un'implementazione concreti per le variabili Typeable higher-kinded, con test che dimostrino un'inferenza e un'unificazione corrette.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Haskell
- Stelle
- 753
- Fork
- 101
- Merge medio
- 1g 3h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell-distributed/distributed-process
-
enhancement Feature Request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
haskell-distributed/distributed-process#486 · 1 commento · 1 reazione ·
-
discuss enhancement Feature Request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
haskell-distributed/distributed-process#478 · 4 commenti · 3 reazioni ·
-
enhancement Feature Request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
haskell-distributed/distributed-process#476 · 2 reazioni ·
-
Demonstrating the use of Cloud Haskell for a Raft implementationForse di nuovo libera @LaurentRDC l’ha presa 482 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement Feature Request
haskell-distributed/distributed-process#475 · 3 reazioni · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
haskell-distributed/distributed-process#473 · 4 commenti · 1 reazione ·
Tutte le issue di haskell-distributed/distributed-process
Issue simili
-
MorphRule, DataizeRule and ContextualizeRule silently accept unknown YAML keys, unlike rewrite `Rule`Forse già presa @renyamamoto2026-cmyk l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/phino#2107 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
tweag/tricorder#640 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno