diff options
author | Eduardo Julian | 2017-12-10 15:26:36 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-12-10 15:26:36 -0400 |
commit | 859c7485cd0e9ebe8d456ed58238bdec849bd6e1 (patch) | |
tree | b854f14eb921d8567e4c06f38d1149a0659ff0a4 /stdlib/source/lux/time | |
parent | 6352437a8403b09fa0c83843984323ce1e67e980 (diff) |
- Some minor refactoring.
- Eliminated the dependency of STM upon FRP.
Diffstat (limited to 'stdlib/source/lux/time')
-rw-r--r-- | stdlib/source/lux/time/duration.lux | 16 | ||||
-rw-r--r-- | stdlib/source/lux/time/instant.lux | 18 |
2 files changed, 17 insertions, 17 deletions
diff --git a/stdlib/source/lux/time/duration.lux b/stdlib/source/lux/time/duration.lux index f2eb63863..c17c5693f 100644 --- a/stdlib/source/lux/time/duration.lux +++ b/stdlib/source/lux/time/duration.lux @@ -17,16 +17,16 @@ (def: #export from-millis (-> Int Duration) - (|>> @abstract)) + (|>> @abstraction)) (def: #export to-millis (-> Duration Int) - (|>> @repr)) + (|>> @representation)) (do-template [<name> <op>] [(def: #export (<name> param subject) (-> Duration Duration Duration) - (@abstract (<op> (@repr param) (@repr subject))))] + (@abstraction (<op> (@representation param) (@representation subject))))] [merge i/+] [frame i/%] @@ -34,21 +34,21 @@ (def: #export (scale scalar duration) (-> Int Duration Duration) - (@abstract (i/* scalar (@repr duration)))) + (@abstraction (i/* scalar (@representation duration)))) (def: #export (query param subject) (-> Duration Duration Int) - (i// (@repr param) (@repr subject))) + (i// (@representation param) (@representation subject))) (struct: #export _ (Eq Duration) (def: (= param subject) - (i/= (@repr param) (@repr subject)))) + (i/= (@representation param) (@representation subject)))) (struct: #export _ (Order Duration) (def: eq Eq<Duration>) (do-template [<name> <op>] [(def: (<name> param subject) - (<op> (@repr param) (@repr subject)))] + (<op> (@representation param) (@representation subject)))] [< i/<] [<= i/<=] @@ -59,7 +59,7 @@ (do-template [<name> <op>] [(def: #export (<name> duration) (-> Duration Bool) - (<op> 0 (@repr duration)))] + (<op> 0 (@representation duration)))] [positive? i/>] [negative? i/<] diff --git a/stdlib/source/lux/time/instant.lux b/stdlib/source/lux/time/instant.lux index 381820058..334b05115 100644 --- a/stdlib/source/lux/time/instant.lux +++ b/stdlib/source/lux/time/instant.lux @@ -24,37 +24,37 @@ (def: #export from-millis (-> Int Instant) - (|>> @abstract)) + (|>> @abstraction)) (def: #export to-millis (-> Instant Int) - (|>> @repr)) + (|>> @representation)) (def: #export (span from to) (-> Instant Instant duration.Duration) - (duration.from-millis (i/- (@repr from) (@repr to)))) + (duration.from-millis (i/- (@representation from) (@representation to)))) (def: #export (shift duration instant) (-> duration.Duration Instant Instant) - (@abstract (i/+ (duration.to-millis duration) (@repr instant)))) + (@abstraction (i/+ (duration.to-millis duration) (@representation instant)))) (def: #export (relative instant) (-> Instant duration.Duration) - (|> instant @repr duration.from-millis)) + (|> instant @representation duration.from-millis)) (def: #export (absolute offset) (-> duration.Duration Instant) - (|> offset duration.to-millis @abstract)) + (|> offset duration.to-millis @abstraction)) (struct: #export _ (Eq Instant) (def: (= param subject) - (:: number.Eq<Int> = (@repr param) (@repr subject)))) + (:: number.Eq<Int> = (@representation param) (@representation subject)))) (struct: #export _ (Order Instant) (def: eq Eq<Instant>) (do-template [<name>] [(def: (<name> param subject) - (:: number.Order<Int> <name> (@repr param) (@repr subject)))] + (:: number.Order<Int> <name> (@representation param) (@representation subject)))] [<] [<=] [>] [>=] )) @@ -63,7 +63,7 @@ (def: order Order<Instant>) (do-template [<name>] [(def: <name> - (|>> @repr (:: number.Enum<Int> <name>) @abstract))] + (|>> @representation (:: number.Enum<Int> <name>) @abstraction))] [succ] [pred] )) |