diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/world/service/journal.lux | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/stdlib/source/lux/world/service/journal.lux b/stdlib/source/lux/world/service/journal.lux index aa151fdab..3919d11f9 100644 --- a/stdlib/source/lux/world/service/journal.lux +++ b/stdlib/source/lux/world/service/journal.lux @@ -1,36 +1,50 @@ (.module: [lux #* [control + [equivalence (#+ Equivalence)] + [interval (#+ Interval)] [security - [capability (#+ Capability)]]] + ["!" capability (#+ capability:)]]] [data - [error (#+ Error)]] + [error (#+ Error)] + [text ("text/." equivalence)]] [time - [instant (#+ Instant)]] - [macro - [poly (#+ derived:) - [equivalence (#+ Equivalence<?>)]]]]) + ["." instant (#+ Instant) ("instant/." equivalence)]]]) -(type: #export Entry - {#what Text +(type: #export (Entry a) + {#what a #why Text #how Text - #who (List Text) + #who Text #where Text #when Instant}) -(derived: #export (Equivalence<?> Entry)) +(type: #export Range + (Interval Instant)) -(type: #export (Can-Write !) - (Capability Entry (! (Error Any)))) +(def: #export (range start end) + (-> Instant Instant Range) + (structure + (def: &enum instant.enum) + (def: bottom start) + (def: top end))) -(type: #export Range - {#from Instant - #to Instant}) +(structure: #export (equivalence (^open "_/.")) + (All [a] (-> (Equivalence a) (Equivalence (Entry a)))) + (def: (= reference sample) + (and (_/= (get@ #what reference) (get@ #what sample)) + (text/= (get@ #why reference) (get@ #why sample)) + (text/= (get@ #how reference) (get@ #how sample)) + (text/= (get@ #who reference) (get@ #who sample)) + (text/= (get@ #where reference) (get@ #where sample)) + (instant/= (get@ #when reference) (get@ #when sample))))) + +(capability: #export (Can-Write ! a) + (can-write (Entry a) (! (Error Any)))) -(type: #export (Can-Read !) - (Capability Range (! (Error (List Entry))))) +(capability: #export (Can-Read ! a) + (can-read Range (! (Error (List (Entry a)))))) -(type: #export (Service !) - {#can-write (Can-Write !) - #can-read (Can-Read !)}) +(type: #export (Journal ! a) + {#can-write (Can-Write ! a) + #can-read (Can-Read ! a)}) |