add namespaces to names

This commit is contained in:
2024-12-26 18:51:46 -08:00
parent 9d90dd828e
commit 9655434b2a
27 changed files with 199 additions and 175 deletions

View File

@@ -1,8 +1,5 @@
module Auto
ptype String
ptype Int
pfunc i2s : Int -> String := `(i) => ''+i`
pfunc _++_ : String -> String -> String := `(a,b) => a + b`

View File

@@ -3,7 +3,7 @@ module Auto2
ptype World
pfunc log : {A : U} -> A -> World := `(_, a) => console.log(a)`
ptype Int
pfunc i_plus : Int -> Int -> Int := `(x,y) => x + y`
data Nat : U where

View File

@@ -1,6 +1,6 @@
module Let
ptype Int
foo : Int -> Int
foo n = let x = 42 in x

View File

@@ -14,8 +14,8 @@ module Oper
infixl 8 _+_ _-_
infixl 9 _*_ _/_
ptype Int
ptype String
ptype JVoid
-- If we had a different quote here, we could tell vscode it's javascript.

View File

@@ -5,7 +5,7 @@ module TestCase
-- There are indexes below, but we're got pulling constraints out of them yet.
ptype Int
data Nat : U where
Z : Nat

View File

@@ -51,7 +51,7 @@ transpose : {a : U} {m n : Nat} -> Vect m (Vect n a) -> Vect n (Vect m a)
transpose {a} {Z} {n} Nil = vec n Nil
transpose {a} {S z} {n} (_::_ {a'} {j} x xs) = zipWith (_::_) x (transpose xs)
ptype Int
myArr : Vect (S (S (S Z))) (Vect (S (S Z)) Int)
myArr = (1 :: 2 :: Nil) :: (3 :: 4 :: Nil) :: (5 :: 6 :: Nil) :: Nil

View File

@@ -9,7 +9,7 @@ infixl 7 _+_
_+_ : {A : U} {{_ : Plus A}} -> A -> A -> A
_+_ {{MkPlus plus}} x y = plus x y
ptype Int
pfunc plusInt : Int -> Int -> Int := `(x,y) => x + y`
PlusInt : Plus Int

View File

@@ -4,8 +4,8 @@ module TestPrim
-- we need to be able to declare a primitive type
-- distinct from inductive type. there are no constructors per-se but it is inhabited
ptype String
ptype Int
pfunc strlen : String -> Int := `(x) => x.length()`

View File

@@ -63,7 +63,7 @@ infixr 1 _,_
data Pair : U -> U -> U where
_,_ : A B. A -> B -> Pair A B
ptype Int
test : Maybe Int
test = pure 10

View File

@@ -2,8 +2,8 @@ module Zoo1
-- I'm starting to translate ezoo 01-eval-closures-debruijn as a test cases.
ptype Int
ptype String
------- Prelude stuff