From d9aef376e2d80d04c1816ac1fd79f6c707ddfec7 Mon Sep 17 00:00:00 2001 From: Jens Krause Date: Sun, 9 Jul 2017 06:39:59 +0200 Subject: [PATCH] Add `NominalDiffTime` (#168) --- front-ps/src/Data/Time/NominalDiffTime.purs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 front-ps/src/Data/Time/NominalDiffTime.purs diff --git a/front-ps/src/Data/Time/NominalDiffTime.purs b/front-ps/src/Data/Time/NominalDiffTime.purs new file mode 100644 index 0000000..8d337b7 --- /dev/null +++ b/front-ps/src/Data/Time/NominalDiffTime.purs @@ -0,0 +1,17 @@ +module Data.Time.NominalDiffTime + ( NominalDiffTime (..) + ) where + +import Prelude +import Data.Generic (class Generic, gShow) +import Data.Newtype (class Newtype) +import Data.Time.Duration (Seconds) + +newtype NominalDiffTime = NominalDiffTime Seconds + +derive instance ntNominalDiffTime :: Newtype NominalDiffTime _ +derive instance gNominalDiffTime :: Generic NominalDiffTime +derive instance eqNominalDiffTime :: Eq NominalDiffTime +derive instance ordNominalDiffTime :: Ord NominalDiffTime +instance showNominalDiffTime :: Show NominalDiffTime where + show = gShow