mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-30 07:02:24 +03:00
ad632d825d
It's disappointing to have to do this, but I think necessary because various issue reports have shown it to be unsound (at least as far as inference goes) and, at the very least, confusing. This patch brings us back to the basic rules of QTT. On the one hand, this makes the 1 multiplicity less useful, because it means we can't flag arguments as being used exactly once which would be useful for optimisation purposes as well as precision in the type. On the other hand, it removes some complexity (and a hack) from unification, and has the advantage of being correct! Also, I still consider the 1 multiplicity an experiment. We can still do interesting things like protocol state tracking, which is my primary motivation at least. Ideally, if the 1 multiplicity is going to be more generall useful, we'll need some kind of way of doing multiplicity polymorphism in the future. I don't think subtyping is the way (I've pretty much always come to regret adding some form of subtyping). Fixes #73 (and maybe some others).
15 lines
357 B
Plaintext
15 lines
357 B
Plaintext
1/2: Building Test (Test.idr)
|
|
2/2: Building As (As.idr)
|
|
As> Prelude.id : a -> a
|
|
As> Prelude.Uninhabited : Type -> Type
|
|
As> Toast.pythag : Int -> List (Int, (Int, Int))
|
|
As> Toast.Inside.fact : Nat -> Nat
|
|
As> Toast.nardle : Needle a => a -> a
|
|
As> Toast.noo : Needle a => a -> a
|
|
As> 16
|
|
As> [(3, (4, 5)), (6, (8, 10))]
|
|
As> pythag
|
|
As> 24
|
|
As> 24
|
|
As> Bye for now!
|