From dc9ee0d653804edf531e4e868be8e62fed0626e3 Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 20 Sep 2016 17:58:19 +0900 Subject: [PATCH] clock: Move hints to HINTS.md --- exercises/clock/HINTS.md | 16 ++++++++++++++++ exercises/clock/src/Clock.hs | 6 ------ exercises/clock/test/Tests.hs | 5 ----- 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 exercises/clock/HINTS.md diff --git a/exercises/clock/HINTS.md b/exercises/clock/HINTS.md new file mode 100644 index 000000000..04ff6c081 --- /dev/null +++ b/exercises/clock/HINTS.md @@ -0,0 +1,16 @@ +## Hints + +To complete this exercise you need to define the data type `Clock`, +with `Eq`, `Show` and `Num` instances, and implement the functions: + +- clockHour +- clockMin +- fromHourMin +- toString + +The function `fromInteger`, from `Num`, must convert minutes +to 24 hour clock time. It is not necessary to have a sensible +implementation of `abs` or `signum`. + +Your can use the provided signatures if you are unsure about the types, but +don't let them restrict your creativity. diff --git a/exercises/clock/src/Clock.hs b/exercises/clock/src/Clock.hs index 50917044a..634674fed 100644 --- a/exercises/clock/src/Clock.hs +++ b/exercises/clock/src/Clock.hs @@ -1,11 +1,5 @@ module Clock (clockHour, clockMin, fromHourMin, toString) where --- The task is to create the data type `Clock`, with `Eq`, --- `Show` and `Num` instances, and implement the functions below. --- The function `fromInteger`, from `Num`, must converts minutes --- to 24 hour clock time. It is not necessary to have a sensible --- implementation of `abs` or `signum`. - clockHour :: Clock -> Int clockHour = undefined diff --git a/exercises/clock/test/Tests.hs b/exercises/clock/test/Tests.hs index b97661b84..bc84a7b44 100644 --- a/exercises/clock/test/Tests.hs +++ b/exercises/clock/test/Tests.hs @@ -9,11 +9,6 @@ import Clock (fromHourMin, toString) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs --- Clock should define a data type that is an instance of Eq and --- Num such that the `fromInteger` converts minutes --- to 24 hour clock time. It is not necessary to have --- a sensible implementation of `abs` or `signum`. - specs :: Spec specs = describe "clock" $ do