From 7eb80a3145017cab713d860134e77887bbf27bb1 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 20 Apr 2020 23:49:02 -0400 Subject: [PATCH 1/6] Removed #clock from the beginning causing bin/ensure to fail. --- exercises/clock/.meta/hints.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/exercises/clock/.meta/hints.md b/exercises/clock/.meta/hints.md index 203e3e034..3a5ab241f 100644 --- a/exercises/clock/.meta/hints.md +++ b/exercises/clock/.meta/hints.md @@ -1,3 +1,9 @@ +Implement a 24 hour clock that handles times. + +You should be able to add and subtract hours and minutes to it. + +Two clocks that represent the same time should be equal to each other. + ## Hints To complete this exercise you need to define the data type `Clock`, @@ -10,6 +16,19 @@ add an `Eq` instance, and implement the functions: `addDelta` adds a duration, expressed in hours and minutes, to a given time, represented by an instance of `Clock`. +`fromHourMin` takes an hour and minute, and returns an instance of `Clock` with +those hours and minutes. + +`toString` takes an instance of `Clock` and returns a string representation +of the clock, in 0 padded format like "08:03" or "22:35" + You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, newtype or type synonym. + +If you need help getting started with Types, take a look at: +- [Data Types in 5 Steps][types] + +[types]: https://mmhaskell.com/blog/2017/12/24/haskell-data-types-in-5-steps + + From 8c7d43f8416c659810db143c4c259e8c12fac0a5 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 21 Apr 2020 16:09:25 -0400 Subject: [PATCH 2/6] Updated hints file and used a local problem-specifications to generate the readme. --- exercises/clock/.meta/hints.md | 8 -------- exercises/clock/README.md | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/exercises/clock/.meta/hints.md b/exercises/clock/.meta/hints.md index 3a5ab241f..161bd4828 100644 --- a/exercises/clock/.meta/hints.md +++ b/exercises/clock/.meta/hints.md @@ -1,9 +1,3 @@ -Implement a 24 hour clock that handles times. - -You should be able to add and subtract hours and minutes to it. - -Two clocks that represent the same time should be equal to each other. - ## Hints To complete this exercise you need to define the data type `Clock`, @@ -30,5 +24,3 @@ If you need help getting started with Types, take a look at: - [Data Types in 5 Steps][types] [types]: https://mmhaskell.com/blog/2017/12/24/haskell-data-types-in-5-steps - - diff --git a/exercises/clock/README.md b/exercises/clock/README.md index 98e992fdc..48212d5d0 100644 --- a/exercises/clock/README.md +++ b/exercises/clock/README.md @@ -1,8 +1,8 @@ # Clock -Implement a clock that handles times without dates. +Implement a 24 hour clock that handles times. -You should be able to add and subtract minutes to it. +You should be able to add and subtract hours and minutes to it. Two clocks that represent the same time should be equal to each other. @@ -18,10 +18,21 @@ add an `Eq` instance, and implement the functions: `addDelta` adds a duration, expressed in hours and minutes, to a given time, represented by an instance of `Clock`. +`fromHourMin` takes an hour and minute, and returns an instance of `Clock` with +those hours and minutes. + +`toString` takes an instance of `Clock` and returns a string representation +of the clock, in 0 padded format like "08:03" or "22:35" + You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, newtype or type synonym. +If you need help getting started with Types, take a look at: +- [Data Types in 5 Steps][types] + +[types]: https://mmhaskell.com/blog/2017/12/24/haskell-data-types-in-5-steps + ## Getting Started From e20ea24bfe61f0c8b8a3d958e9b48875b4df6cbf Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 21 Apr 2020 16:33:33 -0400 Subject: [PATCH 3/6] Left problem specifications untouched. --- exercises/clock/.meta/hints.md | 4 +++- exercises/clock/README.md | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/exercises/clock/.meta/hints.md b/exercises/clock/.meta/hints.md index 161bd4828..edce2d480 100644 --- a/exercises/clock/.meta/hints.md +++ b/exercises/clock/.meta/hints.md @@ -1,3 +1,5 @@ +It's a 24 hour clock going from "00:00" to "23:59". + ## Hints To complete this exercise you need to define the data type `Clock`, @@ -14,7 +16,7 @@ represented by an instance of `Clock`. those hours and minutes. `toString` takes an instance of `Clock` and returns a string representation -of the clock, in 0 padded format like "08:03" or "22:35" +of the clock, in 0-padded format like "08:03" or "22:35" You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, diff --git a/exercises/clock/README.md b/exercises/clock/README.md index 48212d5d0..84b23a848 100644 --- a/exercises/clock/README.md +++ b/exercises/clock/README.md @@ -1,11 +1,13 @@ # Clock -Implement a 24 hour clock that handles times. +Implement a clock that handles times without dates. -You should be able to add and subtract hours and minutes to it. +You should be able to add and subtract minutes to it. Two clocks that represent the same time should be equal to each other. +It's a 24 hour clock going from "00:00" to "23:59". + ## Hints To complete this exercise you need to define the data type `Clock`, @@ -22,7 +24,7 @@ represented by an instance of `Clock`. those hours and minutes. `toString` takes an instance of `Clock` and returns a string representation -of the clock, in 0 padded format like "08:03" or "22:35" +of the clock, in 0-padded format like "08:03" or "22:35" You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, From 17f5c8fd65865fb354ad915966a88e922f014421 Mon Sep 17 00:00:00 2001 From: Kevin Meyers <37648386+kevin-meyers@users.noreply.github.com> Date: Tue, 21 Apr 2020 19:43:17 -0400 Subject: [PATCH 4/6] Lowercase types. Co-Authored-By: Simon Shine --- exercises/clock/.meta/hints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/clock/.meta/hints.md b/exercises/clock/.meta/hints.md index edce2d480..3bbe0c1b8 100644 --- a/exercises/clock/.meta/hints.md +++ b/exercises/clock/.meta/hints.md @@ -22,7 +22,7 @@ You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, newtype or type synonym. -If you need help getting started with Types, take a look at: +If you need help getting started with types, take a look at: - [Data Types in 5 Steps][types] [types]: https://mmhaskell.com/blog/2017/12/24/haskell-data-types-in-5-steps From 5f774abea19ebbf04bea34de3469f5281b55e949 Mon Sep 17 00:00:00 2001 From: Kevin Meyers <37648386+kevin-meyers@users.noreply.github.com> Date: Tue, 21 Apr 2020 19:43:47 -0400 Subject: [PATCH 5/6] Move everything into hints for clarity of development. Co-Authored-By: Simon Shine --- exercises/clock/.meta/hints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/clock/.meta/hints.md b/exercises/clock/.meta/hints.md index 3bbe0c1b8..2b7731849 100644 --- a/exercises/clock/.meta/hints.md +++ b/exercises/clock/.meta/hints.md @@ -1,7 +1,7 @@ -It's a 24 hour clock going from "00:00" to "23:59". - ## Hints +It's a 24 hour clock going from "00:00" to "23:59". + To complete this exercise you need to define the data type `Clock`, add an `Eq` instance, and implement the functions: From 621ca5388489c6ea392cc7c589604772999a0c5a Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 21 Apr 2020 19:59:31 -0400 Subject: [PATCH 6/6] Regenerated README to match hint changes. --- exercises/clock/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/clock/README.md b/exercises/clock/README.md index 84b23a848..ba3812763 100644 --- a/exercises/clock/README.md +++ b/exercises/clock/README.md @@ -6,10 +6,10 @@ You should be able to add and subtract minutes to it. Two clocks that represent the same time should be equal to each other. -It's a 24 hour clock going from "00:00" to "23:59". - ## Hints +It's a 24 hour clock going from "00:00" to "23:59". + To complete this exercise you need to define the data type `Clock`, add an `Eq` instance, and implement the functions: @@ -30,7 +30,7 @@ You will find a dummy data declaration and type signatures already in place, but it is up to you to define the functions and create a meaningful data type, newtype or type synonym. -If you need help getting started with Types, take a look at: +If you need help getting started with types, take a look at: - [Data Types in 5 Steps][types] [types]: https://mmhaskell.com/blog/2017/12/24/haskell-data-types-in-5-steps