Skip to content

Commit

Permalink
New type for Type (part 3).
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed May 5, 2024
1 parent 3514c95 commit 2630555
Show file tree
Hide file tree
Showing 25 changed files with 126 additions and 87 deletions.
33 changes: 33 additions & 0 deletions stdlib/source/library/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,39 @@
#1)
#1)

... https://en.wikipedia.org/wiki/Quantifier_(logic)
(.def# Quantification
(.is# Type
..Bit)
#1)

... https://en.wikipedia.org/wiki/Universal_quantification
(.def# universal
(.is# Quantification
#0)
#1)

... https://en.wikipedia.org/wiki/Existential_quantification
(.def# existential
(.is# Quantification
#1)
#1)

(.def# Parameter
(.is# Type
..Bit)
#1)

(.def# abstraction
(.is# Quantification
#0)
#1)

(.def# argument
(.is# Quantification
#1)
#1)

(.def# Natural
(.is# Type
{6 #1
Expand Down
6 changes: 3 additions & 3 deletions stdlib/source/library/lux/compiler.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Code
[lux (.except Code Parameter
#module)
[error
[try (.only Try)]
Expand Down Expand Up @@ -58,7 +58,7 @@
(-> (Key document) (Stack Parameter)
(Compiler state document)))

(exception.the .public (cannot_compile module)
(Exception descriptor.Module)
(exception.the .public (cannot_compile [module])
(Exception [descriptor.Module])
(exception.report
(list ["Module" module])))
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except)
[lux (.except existential)
[abstract
[monad (.only do)]]
[error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except)
[lux (.except abstraction)
[abstract
[monad (.only do)]]
[control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

(.using
[library
[lux (.except Type Module Declaration Integer Double
[lux (.except Type Module Declaration Integer Double Parameter
#Default #Variable
type with)
type with argument)
["[0]" ffi (.only import)]
[abstract
[monad (.only do)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Type Definition Declaration
[lux (.except Type Definition Declaration Parameter
#Variable)
["[0]" ffi (.only import)]
[abstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

(.using
[library
[lux (.except Type)
[lux (.except Type Parameter
argument)
[abstract
[monad (.only do)]
["<>" projection (.use "[1]#[0]" functor)]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except)
[lux (.except abstraction)
[abstract
[monad (.only do)]
["[0]" enum]]
Expand Down Expand Up @@ -60,24 +60,24 @@
(/.abstraction @ functionS)
(if (n.= (its /.#arity functionS)
(list.size argsS))
(do !
[locals /.locals]
(in (|> functionS
(//loop.optimization true locals argsS)
(maybe#each (is (-> [Natural (List /.Term) /.Term]
/.Term)
(function (_ [start inits iteration])
(when iteration
(/.tail_recursion @ [start' inits' output])
(if (and (n.= start start')
(list.empty? inits'))
(/.tail_recursion @ [start inits output])
(/.tail_recursion @ [start inits iteration]))
(do !
[locals /.locals]
(in (|> functionS
(//loop.optimization true locals argsS)
(maybe#each (is (-> [Natural (List /.Term) /.Term]
/.Term)
(function (_ [start inits iteration])
(when iteration
(/.tail_recursion @ [start' inits' output])
(if (and (n.= start start')
(list.empty? inits'))
(/.tail_recursion @ [start inits output])
(/.tail_recursion @ [start inits iteration]))

_
(/.tail_recursion @ [start inits iteration])))))
(maybe.else <reification>))))
(in <reification>))
_
(/.tail_recursion @ [start inits iteration])))))
(maybe.else <reification>))))
(in <reification>))

(/.reification @ [funcS' argsS'])
(in (/.reification @ [funcS' (list#composite argsS' argsS)]))
Expand Down Expand Up @@ -259,12 +259,12 @@
currying? /.currying?]
(in (<| (/.abstraction @)
(if currying?
abstraction
(when (//loop.optimization false 1 (list) abstraction)
{.#Some it}
[/.#environment environment
/.#arity (its /.#arity abstraction)
/.#body (/.tail_recursion @ it)]

{.#None}
abstraction))))))
abstraction
(when (//loop.optimization false 1 (list) abstraction)
{.#Some it}
[/.#environment environment
/.#arity (its /.#arity abstraction)
/.#body (/.tail_recursion @ it)]
{.#None}
abstraction))))))
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(.using
[library
[lux (.except Type Label
with)
with abstraction)
[abstract
[monad (.only do)]]
[error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#locals #source
i64 local
let exec when its variant tuple text
if or and)
if or and
abstraction)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/data/collection/list.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except only all static has revised)
[lux (.except only all static has revised abstraction)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/ffi.jvm.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Type Declaration Integer Double
[lux (.except Type Declaration Integer Double Parameter
is as type)
[abstract
[monad (.only do)]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/math/number/complex.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except text)
[lux (.except text argument)
[abstract
[equivalence (.only Equivalence)]
[format (.only Format)]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/reflection.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except type)
[lux (.except Parameter type)
["[0]" ffi (.only import)]
[abstract
[monad (.only do)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Type Declaration)
[lux (.except Type Declaration Parameter)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/alias.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Type)
[lux (.except Type Parameter)
[abstract
[monad (.only do)]
["<>" projection (.use "[1]#[0]" functor)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/category.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Declaration)
[lux (.except Declaration Parameter)
[macro
["[0]" template]
["[0]" expansion]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/descriptor.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Declaration)
[lux (.except Declaration Parameter)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except type)
[lux (.except Parameter type)
[abstract
[monad (.only do)]
["<>" projection (.use "[1]#[0]" monad)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/reflection.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Declaration)
[lux (.except Declaration Parameter)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/target/jvm/type/signature.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except Declaration)
[lux (.except Declaration Parameter)
[abstract
[equivalence (.only Equivalence)]
[hash (.only Hash)]]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/type/check.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except try except with type)
[lux (.except try except with type existential)
[abstract
[equivalence (.only Equivalence)]
[functor (.only Functor)]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux/type/nominal.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.using
[library
[lux (.except every)
[lux (.except every abstraction)
[abstract
[monad (.only do)]
["<>" projection (.use "[1]#[0]" monad)]]
Expand Down
Loading

0 comments on commit 2630555

Please sign in to comment.