Skip to content

Commit

Permalink
New type for Lux (part 1).
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Apr 23, 2024
1 parent d70c93c commit b78b907
Show file tree
Hide file tree
Showing 13 changed files with 301 additions and 290 deletions.
67 changes: 4 additions & 63 deletions stdlib/source/library/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.def# prelude
(.is# (.type# "module")
(.is# (.type# "name_of_module")
"library/lux")
#1)

Expand Down Expand Up @@ -733,70 +733,10 @@
(.def# #mode (slot [{#Some [2 #0 ..info_slots]} Info]) .public)
(.def# #configuration (slot [{#Some [2 #1 ..info_slots]} Info]) .public)

... (every .public Lux
... (Rec Lux
... (Record
... [#info Info
... #source Source
... #provenance Provenance
... #current_module (Maybe Text)
... #modules (Stack [Text Module])
... #scopes (Stack Scope)
... #type_context Type_Context
... #expected (Maybe Type)
... #seed Natural
... #scope_type_vars (Stack Natural)
... #extensions Any
... #eval (-> Type Code (-> Lux (Either Text [Lux Any])))
... #host Any])))
(.def# Lux
(.is# Type
{#Named [..prelude "Lux"]
(.when# {#Reification {#0 ["" {#Empty}]} {#Parameter 0}}
Lux
{#Reification {#0 ["" {#Empty}]}
{#Universal {#Empty}
{#Product
... info
Info
{#Product
... source
Source
{#Product
... provenance
Provenance
{#Product
... current_module
{#Reification Text Maybe}
{#Product
... modules
{#Reification {#Product Text Module} Stack}
{#Product
... scopes
{#Reification Scope Stack}
{#Product
... type_context
Type_Context
{#Product
... expected
{#Reification Type Maybe}
{#Product
... seed
Natural
{#Product
... scope_type_vars
{#Reification Natural Stack}
{#Product
... extensions
Any
{#Product
... eval
{#Function Type
{#Function Code
{#Function Lux
{#Sum Text {#Product Lux Any}}}}}
... host
Any}}}}}}}}}}}}}})})
(.type# "lux")})
.public)

(.def# lux_slots
Expand Down Expand Up @@ -6032,7 +5972,8 @@
(Meta Any))
(do meta#monad
[eval (function (_ lux)
{#Right [lux (its #eval lux)]})]
{#Right [lux (.as# (.type# "eval")
(its #eval lux))]})]
(eval type code)))

(every .public Target
Expand Down
4 changes: 3 additions & 1 deletion stdlib/source/library/lux/compiler/default/init.lux
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
{.#Right [source' output]}
{try.#Success [(|> compiler
(has .#source source')
(has .#provenance (code.provenance output)))
(is Lux)
(has .#provenance (code.provenance output))
(is Lux))
[source' output]]})))

(every (Operation it)
Expand Down
Loading

0 comments on commit b78b907

Please sign in to comment.