robrix / surface Goto Github PK
View Code? Open in Web Editor NEWDependently-typed language w/ little to say for itself
License: BSD 3-Clause "New" or "Revised" License
Dependently-typed language w/ little to say for itself
License: BSD 3-Clause "New" or "Revised" License
I don’t know when this broke exactly, but Sigma no longer typechecks:
λ: runCommand (Surface.Command.Run "src/Prelude.surf")
Cannot unify A -> Type with Type
(checkDeclaration Prelude.Sigma, { g3, [] })
(isType (A -> (A -> Type) -> Type), { g3, [] })
(isType Type, { g3, [] })
(isType ((A -> Type) -> Type), { g3, [ A :: Type ] })
(isType (A -> Type), { g3, [ A :: Type ] })
(isType A, { g3, [ A :: Type ] })
(isType Type, { g3, [ A :: Type ] })
(isType Type, { g3, [ A :: Type, _ :: A ] })
(isType Type, { g3, [ A :: Type, B :: (A -> Type) ] })
(checkConstructor Prelude.Sigma.sigma, { g3, [] })
(fresh Type, { g3, [ ; ] })
(fresh (A -> Type), { h3, [ ;, g3 := Type ] })
(infer (A -> (B : (A -> Type)) -> (a : A) -> B a -> Sigma A B), { i3, [ ;, g3 := Type, h3 := (A -> Type) ] })
(infer ((B : (A -> Type)) -> (a : A) -> B a -> Sigma A B), { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type ] })
(infer ((a : A) -> B a -> Sigma A B), { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type) ] })
(infer (B a -> Sigma A B), { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A ] })
(infer (Sigma A B), { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a ] })
(infer B, { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a ] })
(fresh A, { i3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a ] })
(fresh _, { j3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A ] })
(check (Sigma A) (Type -> j3), { k3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(infer (Sigma A), { k3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(infer A, { k3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(fresh _, { k3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(check Sigma (Type -> k3), { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := _ ] })
(unify (A -> (A -> Type) -> Type) (Type -> k3), { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := _ ] })
(unify Type Type, { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := _ ] })
(unify ((A -> Type) -> Type) k3, { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := _ ] })
(solve k3 [] ((A -> Type) -> Type), { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := _ ] })
(replace [ k3 := ((A -> Type) -> Type) ], { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(unify (Type -> j3) k3, { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := ((A -> Type) -> Type) ] })
(solve k3 [] (Type -> j3), { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _, k3 := ((A -> Type) -> Type) ] })
(unify ((A -> Type) -> Type) (Type -> j3), { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
(unify (A -> Type) Type, { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
([ "Cannot unify A -> Type with Type", "" ], { l3, [ ;, g3 := Type, h3 := (A -> Type), A :: Type, B :: (A -> Type), a :: A, _ :: B a, i3 := A, j3 := _ ] })
E.g. if you rename the constructor these :: l -> r -> These l r
to These :: l -> r -> These l r
, its type can no longer be inferred.
I think the data constructor is overwriting the type constructor in the environment.
I think we’re going to want to use a Cofree
structure for Expr
to accomplish this.
Comment syntax like -- … \n
and/or {- … -}
would be good. Ideally we should also have some sort of annotation syntax for e.g. checked doc comments, but I think we can leave that til later.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.