Skip to content

Commit

Permalink
Removed the world/time/series machinery.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Feb 7, 2024
1 parent 3e4f0e4 commit 2e1538a
Show file tree
Hide file tree
Showing 90 changed files with 960 additions and 1,175 deletions.
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
($.definition /.Location
"Locations are for specifying the location of Code nodes in Lux files during compilation.")

($.definition (/.Ann meta_data datum)
($.definition (/.Annotated meta_data datum)
"The type of things that can be annotated with meta-data of arbitrary types.")

($.definition /.Code
Expand Down
98 changes: 49 additions & 49 deletions stdlib/source/library/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@
(.def# #line (slot [{#Some [1 #0 ..location_slots]} Location]) #1)
(.def# #column (slot [{#Some [1 #1 ..location_slots]} Location]) #1)

... (every .public (Ann m v)
... (every .public (Annotated m v)
... (Record
... [#meta m
... #datum v]))
(.def# Ann
(.def# Annotated
(.is# Type
{#Named [..prelude "Ann"]
{#Named [..prelude "Annotated"]
{#Universal {#End}
{#Universal {#End}
{#Product
Expand All @@ -337,8 +337,8 @@
{#Item [..prelude "#datum"]
{#End}}})
#0)
(.def# #meta (slot [{#Some [0 #0 ..ann_slots]} Ann]) #1)
(.def# #datum (slot [{#Some [0 #1 ..ann_slots]} Ann]) #1)
(.def# #meta (slot [{#Some [0 #0 ..ann_slots]} Annotated]) #1)
(.def# #datum (slot [{#Some [0 #1 ..ann_slots]} Annotated]) #1)

... (every .public (Code' w)
... (Variant
Expand Down Expand Up @@ -422,11 +422,11 @@
(.def# #Tuple (tag [{#Some [8 #1 ..code'_tags]} Code']) #1)

... (every .public Code
... (Ann Location (Code' (Ann Location))))
... (Annotated Location (Code' (Annotated Location))))
(.def# Code
(.is# Type
{#Named [..prelude "Code"]
(.when# (.is# Type {#Apply Location Ann})
(.when# (.is# Type {#Apply Location Annotated})
w
{#Apply {#Apply w Code'} w})})
#1)
Expand All @@ -447,8 +447,8 @@
#1
#1)

(.def# _ann
(.is# {#Function {#Apply {#Apply Location Ann} Code'}
(.def# annotated
(.is# {#Function {#Apply {#Apply Location Annotated} Code'}
Code}
(.function# _ data
[location#dummy data]))
Expand All @@ -457,67 +457,67 @@
(.def# as_bit
(.is# {#Function Bit
Code}
(.function# _ value (_ann {#Bit value})))
(.function# _ value (annotated {#Bit value})))
#0)

(.def# as_natural
(.is# {#Function Natural
Code}
(.function# _ value (_ann {#Natural value})))
(.function# _ value (annotated {#Natural value})))
#0)

(.def# as_integer
(.is# {#Function Integer
Code}
(.function# _ value (_ann {#Integer value})))
(.function# _ value (annotated {#Integer value})))
#0)

(.def# as_revolution
(.is# {#Function Revolution
Code}
(.function# _ value (_ann {#Revolution value})))
(.function# _ value (annotated {#Revolution value})))
#0)

(.def# as_decimal
(.is# {#Function Decimal
Code}
(.function# _ value (_ann {#Decimal value})))
(.function# _ value (annotated {#Decimal value})))
#0)

(.def# as_text
(.is# {#Function Text
Code}
(.function# _ text (_ann {#Text text})))
(.function# _ text (annotated {#Text text})))
#0)

(.def# as_symbol
(.is# {#Function Symbol
Code}
(.function# _ name (_ann {#Symbol name})))
(.function# _ name (annotated {#Symbol name})))
#0)

(.def# as_local
(.is# {#Function Text
Code}
(.function# _ name (_ann {#Symbol ["" name]})))
(.function# _ name (annotated {#Symbol ["" name]})))
#0)

(.def# as_form
(.is# {#Function {#Apply Code List}
Code}
(.function# _ tokens (_ann {#Form tokens})))
(.function# _ tokens (annotated {#Form tokens})))
#0)

(.def# as_variant
(.is# {#Function {#Apply Code List}
Code}
(.function# _ tokens (_ann {#Variant tokens})))
(.function# _ tokens (annotated {#Variant tokens})))
#0)

(.def# as_tuple
(.is# {#Function {#Apply Code List}
Code}
(.function# _ tokens (_ann {#Tuple tokens})))
(.function# _ tokens (annotated {#Tuple tokens})))
#0)

... (every .public Definition
Expand Down Expand Up @@ -1054,33 +1054,33 @@
(.function# _ tokens
(.when# tokens
{#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}
(meta#in {#Item (_ann {#Form {#Item (as_symbol [..prelude "function#"])
{#Item (_ann {#Symbol ["" ""]})
{#Item arg
{#Item (.when# args'
{#End}
body

_
(_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]})
{#Item (_ann {#Tuple args'})
{#Item body {#End}}}}}))
{#End}}}}}})
(meta#in {#Item (annotated {#Form {#Item (as_symbol [..prelude "function#"])
{#Item (annotated {#Symbol ["" ""]})
{#Item arg
{#Item (.when# args'
{#End}
body

_
(annotated {#Form {#Item (annotated {#Symbol [..prelude "function''"]})
{#Item (annotated {#Tuple args'})
{#Item body {#End}}}}}))
{#End}}}}}})
{#End}})

{#Item [_ {#Symbol ["" self]}] {#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}}
(meta#in {#Item (_ann {#Form {#Item (as_symbol [..prelude "function#"])
{#Item (_ann {#Symbol ["" self]})
{#Item arg
{#Item (.when# args'
{#End}
body

_
(_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]})
{#Item (_ann {#Tuple args'})
{#Item body {#End}}}}}))
{#End}}}}}})
(meta#in {#Item (annotated {#Form {#Item (as_symbol [..prelude "function#"])
{#Item (annotated {#Symbol ["" self]})
{#Item arg
{#Item (.when# args'
{#End}
body

_
(annotated {#Form {#Item (annotated {#Symbol [..prelude "function''"]})
{#Item (annotated {#Tuple args'})
{#Item body {#End}}}}}))
{#End}}}}}})
{#End}})

_
Expand All @@ -1107,11 +1107,11 @@
output

{#Item head tail}
(_ann {#Form {#Item (as_symbol [..prelude "function#"])
{#Item self
{#Item head
{#Item (as_function (_ann {#Symbol ["" ""]}) tail output)
{#End}}}}}}))))
(annotated {#Form {#Item (as_symbol [..prelude "function#"])
{#Item self
{#Item head
{#Item (as_function (annotated {#Symbol ["" ""]}) tail output)
{#End}}}}}}))))
#0)

(.def# as_macro
Expand Down
40 changes: 13 additions & 27 deletions stdlib/source/library/lux/control/logic.lux
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
[monad (.only Monad
do)]]
[control
["[0]" try (.only Try) (.use "[1]#[0]" monad)]]
["[0]" try (.only Try) (.use "[1]#[0]" monad)]
["[0]" state]]
[data
["[0]" product]
["[0]" text]
Expand Down Expand Up @@ -51,24 +52,23 @@
(Equivalence Text)
text.equivalence)

(every .public ID
(every ID
Natural)

(every .public Binding
(every Binding
(for_some (_ of)
[(Equivalence of)
(Either ID of)]))

(every .public Context
(every Context
(Dictionary ID Binding))

(the empty
Context
(dictionary.empty natural.hash))

(every .public (Logic of)
(-> Context
(List [Context of])))
(every .public Logic
(state.With Context List))

(the .public (values it)
(for_any (_ of)
Expand All @@ -79,8 +79,7 @@
(list#each product.right)))

(the .public failure
(for_any (_ of)
(Logic of))
(Logic Nothing)
(function (_ context)
(list)))

Expand All @@ -89,26 +88,13 @@
(function (_ context)
(list [context []])))

(the .public functor
(Functor Logic)
(implementation
(the (each $ !a)
(|>> !a
(list#each (function (_ [context it])
[context ($ it)]))))))

(the .public monad
(Monad Logic)
(implementation
(the functor ..functor)
(the (in it)
(function (_ context)
(list [context it])))
(the (conjoint !!a)
(|>> !!a
(list#each (function (_ [context it])
(it context)))
list#conjoint))))
(state.with list.monad))

(the .public functor
(Functor Logic)
(by ..monad functor))

(the .public (or left right)
(for_any (_ of)
Expand Down
Loading

0 comments on commit 2e1538a

Please sign in to comment.