From 31502b0a3e585265e71f869053a7780744eaa575 Mon Sep 17 00:00:00 2001 From: Maisa Date: Thu, 6 Aug 2020 14:02:02 -0300 Subject: [PATCH 1/5] Add numbers max and a Time parse --- lib/Time.fm | 9 +++++++++ lib/Time.parse_ms.fm | 29 +++++++++++++++++++++++++++++ lib/U16.max.fm | 2 ++ lib/U32.max.fm | 2 ++ lib/U64.max.fm | 2 ++ lib/U8.max.fm | 2 ++ 6 files changed, 46 insertions(+) create mode 100644 lib/Time.fm create mode 100644 lib/Time.parse_ms.fm create mode 100644 lib/U16.max.fm create mode 100644 lib/U32.max.fm create mode 100644 lib/U64.max.fm create mode 100644 lib/U8.max.fm diff --git a/lib/Time.fm b/lib/Time.fm new file mode 100644 index 00000000..7117cbe1 --- /dev/null +++ b/lib/Time.fm @@ -0,0 +1,9 @@ +T Time +| Time.new( + days: U64, + hours: U64, + minutes: U64, + seconds: U64, + milliseconds: U64, + microseconds: U64, + nanoseconds: U64); \ No newline at end of file diff --git a/lib/Time.parse_ms.fm b/lib/Time.parse_ms.fm new file mode 100644 index 00000000..22f9c6cc --- /dev/null +++ b/lib/Time.parse_ms.fm @@ -0,0 +1,29 @@ +// MIT License +// Copyright (c) Sindre Sorhus (sindresorhus.com) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +Time.parse_ms(ms: U64): Time + Time.new( + U64.div(ms, 86400000l), // days + U64.mod(U64.div(ms, 3600000l), 24l), // hours + U64.mod(U64.div(ms, 60000l), 60l), // minutes + U64.mod(U64.div(ms, 1000l), 60l), // seconds + U64.mod(ms, 1000l), // milliseconds + U64.mod(U64.mul(ms, 1000l), 1000l), // microseconds + U64.mod(U64.mul(ms, 1000000l), 1000l) // nanoseconds + ) \ No newline at end of file diff --git a/lib/U16.max.fm b/lib/U16.max.fm new file mode 100644 index 00000000..488d3642 --- /dev/null +++ b/lib/U16.max.fm @@ -0,0 +1,2 @@ +U16.max: U16 + 65535s \ No newline at end of file diff --git a/lib/U32.max.fm b/lib/U32.max.fm new file mode 100644 index 00000000..472739e6 --- /dev/null +++ b/lib/U32.max.fm @@ -0,0 +1,2 @@ +U32.max: U32 + 4294967295u \ No newline at end of file diff --git a/lib/U64.max.fm b/lib/U64.max.fm new file mode 100644 index 00000000..0a0c58ad --- /dev/null +++ b/lib/U64.max.fm @@ -0,0 +1,2 @@ +U64.max: U64 + 18446744073709551615l \ No newline at end of file diff --git a/lib/U8.max.fm b/lib/U8.max.fm new file mode 100644 index 00000000..011dad4f --- /dev/null +++ b/lib/U8.max.fm @@ -0,0 +1,2 @@ +U8.max: U8 + 255b \ No newline at end of file From 1d983952fdf18bfa14e7b0151eaa059212ecbccd Mon Sep 17 00:00:00 2001 From: Maisa Date: Thu, 6 Aug 2020 19:36:19 -0300 Subject: [PATCH 2/5] Add some examples --- lib/Time.ex.fm | 62 ++++++++++++++++++++++++++++++++++ lib/Time.parse_days.fm | 2 ++ lib/Time.parse_hours.fm | 2 ++ lib/Time.parse_microseconds.fm | 2 ++ lib/Time.parse_miliseconds.fm | 2 ++ lib/Time.parse_minutes.fm | 2 ++ lib/Time.parse_ms.fm | 14 ++++---- lib/Time.parse_nanoseconds.fm | 2 ++ lib/Time.parse_seconds.fm | 2 ++ lib/Time.parse_years.fm | 2 ++ lib/Time.show.fm | 11 ++++++ lib/Time.stringify.fm | 9 +++++ 12 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 lib/Time.ex.fm create mode 100644 lib/Time.parse_days.fm create mode 100644 lib/Time.parse_hours.fm create mode 100644 lib/Time.parse_microseconds.fm create mode 100644 lib/Time.parse_miliseconds.fm create mode 100644 lib/Time.parse_minutes.fm create mode 100644 lib/Time.parse_nanoseconds.fm create mode 100644 lib/Time.parse_seconds.fm create mode 100644 lib/Time.parse_years.fm create mode 100644 lib/Time.show.fm create mode 100644 lib/Time.stringify.fm diff --git a/lib/Time.ex.fm b/lib/Time.ex.fm new file mode 100644 index 00000000..c4fa06b5 --- /dev/null +++ b/lib/Time.ex.fm @@ -0,0 +1,62 @@ +Time.ex.parse: Time + Time.parse_ms(1337000001l) + +Time.ex.show_seconds: String + let time = Time.show(Time.ex.parse) + case time: + | time.seconds; + +Time.ex.show_hours_min: String + let time = Time.show(Time.ex.parse) + case time: + | String.concat(time.minutes, String.concat(" ", time.seconds)); + +// Examples from https://github.com/sindresorhus/parse-ms#usage +// Time.ex.test_days: Bool +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.days, 15l); +// res + +// Time.ex.test_hours: Type +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.hours, 11l); +// Bool.IsTrue(Bool.false) + +// Time.ex.test_minutes: Bool.IsTrue +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.minutes, 23l); +// same(res) + +// Time.ex.test_seconds: Bool.IsTrue +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.seconds, 20l); +// same(res) + +// Time.ex.test_miliseconds: Bool.IsTrue +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.miliseconds, 1l); +// same(res) + +// Time.ex.test_microseconds: Bool.IsTrue +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.microseconds, 0l); +// same(res) + +// Time.ex.test_nanoseconds: Bool.IsTrue +// let time = Time.ex.parse +// let res = +// case time: +// | U64.eql(time.nanoseconds, 0l); +// same(res) \ No newline at end of file diff --git a/lib/Time.parse_days.fm b/lib/Time.parse_days.fm new file mode 100644 index 00000000..3a7cc1f4 --- /dev/null +++ b/lib/Time.parse_days.fm @@ -0,0 +1,2 @@ +Time.parse_days(ms: U64): U64 + U64.div(ms, 86400000l) \ No newline at end of file diff --git a/lib/Time.parse_hours.fm b/lib/Time.parse_hours.fm new file mode 100644 index 00000000..3c6acd77 --- /dev/null +++ b/lib/Time.parse_hours.fm @@ -0,0 +1,2 @@ +Time.parse_hours(ms: U64): U64 + U64.mod(U64.div(ms, 3600000l), 24l) \ No newline at end of file diff --git a/lib/Time.parse_microseconds.fm b/lib/Time.parse_microseconds.fm new file mode 100644 index 00000000..7ad7327f --- /dev/null +++ b/lib/Time.parse_microseconds.fm @@ -0,0 +1,2 @@ +Time.parse_microseconds(ms: U64): U64 + U64.mod(U64.mul(ms, 1000l), 1000l) \ No newline at end of file diff --git a/lib/Time.parse_miliseconds.fm b/lib/Time.parse_miliseconds.fm new file mode 100644 index 00000000..44fce5ea --- /dev/null +++ b/lib/Time.parse_miliseconds.fm @@ -0,0 +1,2 @@ +Time.parse_miliseconds(ms: U64): U64 + U64.mod(ms, 1000l) \ No newline at end of file diff --git a/lib/Time.parse_minutes.fm b/lib/Time.parse_minutes.fm new file mode 100644 index 00000000..576bd836 --- /dev/null +++ b/lib/Time.parse_minutes.fm @@ -0,0 +1,2 @@ +Time.parse_minutes(ms: U64): U64 + U64.mod(U64.div(ms, 60000l), 60l) \ No newline at end of file diff --git a/lib/Time.parse_ms.fm b/lib/Time.parse_ms.fm index 22f9c6cc..0219794a 100644 --- a/lib/Time.parse_ms.fm +++ b/lib/Time.parse_ms.fm @@ -19,11 +19,11 @@ // SOFTWARE. Time.parse_ms(ms: U64): Time Time.new( - U64.div(ms, 86400000l), // days - U64.mod(U64.div(ms, 3600000l), 24l), // hours - U64.mod(U64.div(ms, 60000l), 60l), // minutes - U64.mod(U64.div(ms, 1000l), 60l), // seconds - U64.mod(ms, 1000l), // milliseconds - U64.mod(U64.mul(ms, 1000l), 1000l), // microseconds - U64.mod(U64.mul(ms, 1000000l), 1000l) // nanoseconds + Time.parse_days(ms), + Time.parse_hours(ms), + Time.parse_minutes(ms), + Time.parse_seconds(ms), + Time.parse_miliseconds(ms), + Time.parse_microseconds(ms), + Time.parse_nanoseconds(ms) ) \ No newline at end of file diff --git a/lib/Time.parse_nanoseconds.fm b/lib/Time.parse_nanoseconds.fm new file mode 100644 index 00000000..5fd6ba11 --- /dev/null +++ b/lib/Time.parse_nanoseconds.fm @@ -0,0 +1,2 @@ +Time.parse_nanoseconds(ms: U64): U64 + U64.mod(U64.mul(ms, 1000000l), 1000l) \ No newline at end of file diff --git a/lib/Time.parse_seconds.fm b/lib/Time.parse_seconds.fm new file mode 100644 index 00000000..5c0bfe0b --- /dev/null +++ b/lib/Time.parse_seconds.fm @@ -0,0 +1,2 @@ +Time.parse_seconds(ms: U64): U64 + U64.mod(U64.div(ms, 1000l), 60l) \ No newline at end of file diff --git a/lib/Time.parse_years.fm b/lib/Time.parse_years.fm new file mode 100644 index 00000000..6ac0b11c --- /dev/null +++ b/lib/Time.parse_years.fm @@ -0,0 +1,2 @@ +Time.parse_years(ms: U64): U64 + U64.div(Time.parse_days(ms), 365l) \ No newline at end of file diff --git a/lib/Time.show.fm b/lib/Time.show.fm new file mode 100644 index 00000000..def088ee --- /dev/null +++ b/lib/Time.show.fm @@ -0,0 +1,11 @@ +Time.show(t: Time): Time.stringify + case t: + | let days = String.concat(Nat.show(U64.to_nat(t.days)), "d") + let hours = String.concat(Nat.show(U64.to_nat(t.hours)), "h") + let mins = String.concat(Nat.show(U64.to_nat(t.minutes)), "m") + let secs = String.concat(Nat.show(U64.to_nat(t.seconds)), "s") + let mili = String.concat(Nat.show(U64.to_nat(t.milliseconds)), "ms") + let micro = String.concat(Nat.show(U64.to_nat(t.microseconds)), "µs") + let nano = String.concat(Nat.show(U64.to_nat(t.nanoseconds)), "ns") + Time.stringify.new(days, hours, mins, secs, mili, micro, nano) + ; diff --git a/lib/Time.stringify.fm b/lib/Time.stringify.fm new file mode 100644 index 00000000..0320ab42 --- /dev/null +++ b/lib/Time.stringify.fm @@ -0,0 +1,9 @@ +T Time.stringify +| Time.stringify.new( + days: String, + hours: String, + minutes: String, + seconds: String, + milliseconds: String, + microseconds: String, + nanoseconds: String); From 254a1691a883ffda920579de86936e81fe086ffd Mon Sep 17 00:00:00 2001 From: Maisa Date: Fri, 7 Aug 2020 15:13:42 -0300 Subject: [PATCH 3/5] Add prettify and refactor some details in Time --- lib/Time.ex.fm | 37 ++++++++++++++++++----- lib/Time.prettify.fm | 48 +++++++++++++++++++++++++++++ lib/Time.show.fm | 65 +++++++++++++++++++++++++++++++++++----- lib/Time.time_to_list.fm | 11 +++++++ lib/U64.show.fm | 3 ++ 5 files changed, 148 insertions(+), 16 deletions(-) create mode 100644 lib/Time.prettify.fm create mode 100644 lib/Time.time_to_list.fm create mode 100644 lib/U64.show.fm diff --git a/lib/Time.ex.fm b/lib/Time.ex.fm index c4fa06b5..77d16b42 100644 --- a/lib/Time.ex.fm +++ b/lib/Time.ex.fm @@ -2,22 +2,43 @@ Time.ex.parse: Time Time.parse_ms(1337000001l) Time.ex.show_seconds: String - let time = Time.show(Time.ex.parse) + let time = Time.show(Time.ex.parse, Bool.false) case time: | time.seconds; Time.ex.show_hours_min: String - let time = Time.show(Time.ex.parse) + let time = Time.show(Time.ex.parse, Bool.false) case time: | String.concat(time.minutes, String.concat(" ", time.seconds)); +Time.ex.show: Time.stringify + Time.show(Time.ex.parse, Bool.false) + +// TODO: add proof that returns Bool.true +Time.ex.prettify_0: Bool + let parsed = Time.parse_ms(144000000l) + let res = Time.prettify(parsed, Bool.true) + String.eql(res, "1 day 16 hours ") + +Time.ex.prettify_1: Bool + let res = Time.prettify(Time.ex.parse, Bool.false) + String.eql(res, "15d 11h 23m 20s 1ms ") + // Examples from https://github.com/sindresorhus/parse-ms#usage -// Time.ex.test_days: Bool -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.days, 15l); -// res +// TODO: add proof that returns Bool.true +Time.ex.test_days: Bool + let time = Time.ex.parse + case time: + | U64.eql(time.days, 15l); + +Time.ex.prettify: String + Time.prettify(Time.parse_ms(144000000l), Bool.true) + +// Time.ex: Bool +// Bool.and(Time.ex.test_days, Bool.false) + +// Time.ex.test: Time.ex.test_days == Bool.true +// _ // Time.ex.test_hours: Type // let time = Time.ex.parse diff --git a/lib/Time.prettify.fm b/lib/Time.prettify.fm new file mode 100644 index 00000000..0a45e738 --- /dev/null +++ b/lib/Time.prettify.fm @@ -0,0 +1,48 @@ +Time.prettify(t: Time, verbose: Bool): String + let time_list = Time.time_to_list(t) + case t: + | let str = "" + let str = + case U64.gtn(t.nanoseconds, 0l): + | let nano = String.concat(Time.show.nanoseconds(t.nanoseconds, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.microseconds, 0l): + | let nano = String.concat(Time.show.microseconds(t.microseconds, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.milliseconds, 0l): + | let nano = String.concat(Time.show.milliseconds(t.milliseconds, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.seconds, 0l): + | let nano = String.concat(Time.show.seconds(t.seconds, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.minutes, 0l): + | let nano = String.concat(Time.show.minutes(t.minutes, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.hours, 0l): + | let nano = String.concat(Time.show.hours(t.hours, verbose), " ") + String.concat(nano, str); + | str; + + let str = + case U64.gtn(t.days, 0l): + | let nano = String.concat(Time.show.days(t.days, verbose), " ") + String.concat(nano, str); + | str; + + str + ; \ No newline at end of file diff --git a/lib/Time.show.fm b/lib/Time.show.fm index def088ee..ed7e45f1 100644 --- a/lib/Time.show.fm +++ b/lib/Time.show.fm @@ -1,11 +1,60 @@ -Time.show(t: Time): Time.stringify +Time.show(t: Time, verbose: Bool): Time.stringify case t: - | let days = String.concat(Nat.show(U64.to_nat(t.days)), "d") - let hours = String.concat(Nat.show(U64.to_nat(t.hours)), "h") - let mins = String.concat(Nat.show(U64.to_nat(t.minutes)), "m") - let secs = String.concat(Nat.show(U64.to_nat(t.seconds)), "s") - let mili = String.concat(Nat.show(U64.to_nat(t.milliseconds)), "ms") - let micro = String.concat(Nat.show(U64.to_nat(t.microseconds)), "µs") - let nano = String.concat(Nat.show(U64.to_nat(t.nanoseconds)), "ns") + | let days = Time.show.days(t.days, verbose) + let hours = Time.show.hours(t.hours, verbose) + let mins = Time.show.minutes(t.minutes, verbose) + let secs = Time.show.seconds(t.seconds, verbose) + let mili = Time.show.milliseconds(t.milliseconds, verbose) + let micro = Time.show.microseconds(t.microseconds, verbose) + let nano = Time.show.nanoseconds(t.nanoseconds, verbose) Time.stringify.new(days, hours, mins, secs, mili, micro, nano) ; + +Time.show.days(t.days: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.days, 1l), U64.eql(t.days, 0l)): + | String.concat(U64.show(t.days), " days"); + | String.concat(U64.show(t.days), " day");; + | String.concat(U64.show(t.days), "d"); + +Time.show.hours(t.hours: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.hours, 1l), U64.eql(t.hours, 0l)): + | String.concat(U64.show(t.hours), " hours"); + | String.concat(U64.show(t.hours), " hour");; + | String.concat(U64.show(t.hours), "h"); + +Time.show.minutes(t.minutes: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.minutes, 1l), U64.eql(t.minutes, 0l)): + | String.concat(U64.show(t.minutes), " minutes"); + | String.concat(U64.show(t.minutes), " minute");; + | String.concat(U64.show(t.minutes), "m"); + +Time.show.seconds(t.seconds: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.seconds, 1l), U64.eql(t.seconds, 0l)): + | String.concat(U64.show(t.seconds), " seconds"); + | String.concat(U64.show(t.seconds), " second");; + | String.concat(U64.show(t.seconds), "s"); + +Time.show.milliseconds(t.milliseconds: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.milliseconds, 1l), U64.eql(t.milliseconds, 0l)): + | String.concat(U64.show(t.milliseconds), " milliseconds"); + | String.concat(U64.show(t.milliseconds), " millisecond");; + | String.concat(U64.show(t.milliseconds), "ms"); + +Time.show.microseconds(t.microseconds: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.microseconds, 1l), U64.eql(t.microseconds, 0l)): + | String.concat(U64.show(t.microseconds), " microseconds"); + | String.concat(U64.show(t.microseconds), " microsecond");; + | String.concat(U64.show(t.microseconds), "µs"); + +Time.show.nanoseconds(t.nanoseconds: U64, verbose: Bool): String + case verbose: + | case Bool.or(U64.gtn(t.nanoseconds, 1l), U64.eql(t.nanoseconds, 0l)): + | String.concat(U64.show(t.nanoseconds), " nanoseconds"); + | String.concat(U64.show(t.nanoseconds), " nanosecond");; + | String.concat(U64.show(t.nanoseconds), "ns"); \ No newline at end of file diff --git a/lib/Time.time_to_list.fm b/lib/Time.time_to_list.fm new file mode 100644 index 00000000..3401a26d --- /dev/null +++ b/lib/Time.time_to_list.fm @@ -0,0 +1,11 @@ +Time.time_to_list(t: Time): List(U64) + case t: + | let nano = List.cons<>(t.nanoseconds, List.nil<>) + let micro = List.cons<>(t.microseconds, nano) + let milliseconds = List.cons<>(t.milliseconds, micro) + let seconds = List.cons<>(t.seconds, milliseconds) + let minutes = List.cons<>(t.minutes, seconds) + let hours = List.cons<>(t.hours, minutes) + let days = List.cons<>(t.days, hours) + days + ; \ No newline at end of file diff --git a/lib/U64.show.fm b/lib/U64.show.fm new file mode 100644 index 00000000..f6419c85 --- /dev/null +++ b/lib/U64.show.fm @@ -0,0 +1,3 @@ +// TODO: do a correct U64.show +U64.show(u: U64): String + Nat.show(U64.to_nat(u)) \ No newline at end of file From 400f749f290dfea04db0667e2e74663c30521ad1 Mon Sep 17 00:00:00 2001 From: Maisa Date: Mon, 10 Aug 2020 15:16:20 -0300 Subject: [PATCH 4/5] Add proof draft --- lib/Time.ex.fm | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/lib/Time.ex.fm b/lib/Time.ex.fm index 77d16b42..984e7f6c 100644 --- a/lib/Time.ex.fm +++ b/lib/Time.ex.fm @@ -6,6 +6,11 @@ Time.ex.show_seconds: String case time: | time.seconds; +// Time.ex.show_secs: The(_, Bool.true) +// let time = Time.show(Time.ex.parse, Bool.false) +// case time: +// | The.value<>(String.eql(time.seconds, "20s")); + Time.ex.show_hours_min: String let time = Time.show(Time.ex.parse, Bool.false) case time: @@ -24,7 +29,6 @@ Time.ex.prettify_1: Bool let res = Time.prettify(Time.ex.parse, Bool.false) String.eql(res, "15d 11h 23m 20s 1ms ") -// Examples from https://github.com/sindresorhus/parse-ms#usage // TODO: add proof that returns Bool.true Time.ex.test_days: Bool let time = Time.ex.parse @@ -34,50 +38,9 @@ Time.ex.test_days: Bool Time.ex.prettify: String Time.prettify(Time.parse_ms(144000000l), Bool.true) +// TODO: do not check. idk why... // Time.ex: Bool // Bool.and(Time.ex.test_days, Bool.false) // Time.ex.test: Time.ex.test_days == Bool.true // _ - -// Time.ex.test_hours: Type -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.hours, 11l); -// Bool.IsTrue(Bool.false) - -// Time.ex.test_minutes: Bool.IsTrue -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.minutes, 23l); -// same(res) - -// Time.ex.test_seconds: Bool.IsTrue -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.seconds, 20l); -// same(res) - -// Time.ex.test_miliseconds: Bool.IsTrue -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.miliseconds, 1l); -// same(res) - -// Time.ex.test_microseconds: Bool.IsTrue -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.microseconds, 0l); -// same(res) - -// Time.ex.test_nanoseconds: Bool.IsTrue -// let time = Time.ex.parse -// let res = -// case time: -// | U64.eql(time.nanoseconds, 0l); -// same(res) \ No newline at end of file From 92ef4e688b2d61a1837d73a1057d7f51513a7ab1 Mon Sep 17 00:00:00 2001 From: Maisa Date: Thu, 13 Aug 2020 09:52:47 -0300 Subject: [PATCH 5/5] Update reference to parse-ms --- lib/Time.parse_ms.fm | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/lib/Time.parse_ms.fm b/lib/Time.parse_ms.fm index 0219794a..d051fe61 100644 --- a/lib/Time.parse_ms.fm +++ b/lib/Time.parse_ms.fm @@ -1,22 +1,4 @@ -// MIT License -// Copyright (c) Sindre Sorhus (sindresorhus.com) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. +// Inspired on https://github.com/sindresorhus/parse-ms Time.parse_ms(ms: U64): Time Time.new( Time.parse_days(ms),