polysemy-time 0.1.2.3 → 0.1.2.4
raw patch · 6 files changed
+15/−17 lines, 6 files
Files
- lib/Polysemy/Time/At.hs +1/−1
- lib/Polysemy/Time/Calendar.hs +2/−2
- lib/Polysemy/Time/Data/Time.hs +1/−1
- lib/Polysemy/Time/Prelude.hs +9/−11
- polysemy-time.cabal +1/−1
- readme.md +1/−1
lib/Polysemy/Time/At.hs view
@@ -50,7 +50,7 @@ -- |Interpret 'Time' so that the time when the program starts is @startAt@. interpretTimeAt ::- ∀ (diff :: *) t d r a .+ ∀ (diff :: Type) t d r a . TimeUnit diff => Torsor t diff => HasDate t d =>
lib/Polysemy/Time/Calendar.hs view
@@ -50,8 +50,8 @@ -- |Construct datetimes, dates or times from integers. class Calendar dt where- type CalendarDate dt :: *- type CalendarTime dt :: *+ type CalendarDate dt :: Type+ type CalendarTime dt :: Type mkDate :: Int64 -> Int64 -> Int64 -> CalendarDate dt mkTime :: Int64 -> Int64 -> Int64 -> CalendarTime dt mkDatetime :: Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> dt
lib/Polysemy/Time/Data/Time.hs view
@@ -3,7 +3,7 @@ import Polysemy.Time.Data.TimeUnit (AddTimeUnit, TimeUnit) -- |The Time effect.-data Time (time :: *) (date :: *) :: Effect where+data Time (time :: Type) (date :: Type) :: Effect where -- |Produce the current time, possibly relative to what was set with 'SetTime' or 'SetDate' Now :: Time t d m t -- |Produce the current date, possibly relative to what was set with 'SetTime' or 'SetDate'
lib/Polysemy/Time/Prelude.hs view
@@ -8,6 +8,7 @@ module Data.Default, module Data.Either.Combinators, module Data.Foldable,+ module Data.Kind, module Data.List.NonEmpty, module Data.Map.Strict, module GHC.Err,@@ -16,7 +17,6 @@ module Polysemy.AtomicState, module Polysemy.Time.Debug, module Polysemy.Error,- module Polysemy.Internal.Bundle, module Polysemy.Reader, module Polysemy.State, module Relude,@@ -24,13 +24,14 @@ import Control.Exception (throwIO, try) import qualified Data.Aeson as Aeson-import Data.Aeson (FromJSON(parseJSON), ToJSON(toJSON))+import Data.Aeson (FromJSON (parseJSON), ToJSON (toJSON)) import Data.Aeson.TH (deriveFromJSON, deriveJSON) import Data.Composition ((.:), (.:.), (.::))-import Data.Default (Default(def))+import Data.Default (Default (def)) import Data.Either.Combinators (mapLeft) import Data.Fixed (div') import Data.Foldable (foldl, traverse_)+import Data.Kind (Type) import Data.List.NonEmpty ((<|)) import qualified Data.Map.Strict as Map import Data.Map.Strict (Map, lookup)@@ -62,10 +63,8 @@ ) import Polysemy.AtomicState (AtomicState, atomicGet, atomicGets, atomicModify', atomicPut, runAtomicStateTVar) import Polysemy.Error (Error, fromEither, mapError, note, runError, throw)-import Polysemy.Internal.Bundle (Append) import Polysemy.Reader (Reader) import Polysemy.State (State, evalState, get, gets, modify, modify', put, runState)-import Polysemy.Time.Debug (dbg, dbgs, dbgs_) import Relude hiding ( Reader, State,@@ -91,6 +90,8 @@ ) import System.IO.Error (userError) +import Polysemy.Time.Debug (dbg, dbgs, dbgs_)+ unit :: Applicative f => f ()@@ -212,26 +213,23 @@ type Basic a = (Eq a, Show a) -type family Basics (as :: [*]) :: Constraint where+type family Basics (as :: [Type]) :: Constraint where Basics '[] = () Basics (a : as) = (Basic a, Basics as) type Eso a = (Basic a, Ord a) -type family Esos (as :: [*]) :: Constraint where+type family Esos (as :: [Type]) :: Constraint where Esos '[] = () Esos (a : as) = (Eso a, Esos as) type Json a = (FromJSON a, ToJSON a, Basic a) -type family Jsons (r :: [*]) :: Constraint where+type family Jsons (r :: [Type]) :: Constraint where Jsons '[] = () Jsons (a ': r) = (Json a, Jsons r)--type a ++ b =- Append a b rightOr :: (a -> b) -> Either a b -> b rightOr f =
polysemy-time.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: polysemy-time-version: 0.1.2.3+version: 0.1.2.4 synopsis: Polysemy Effect for Time description: Please see the readme on Github at <https://github.com/tek/polysemy-time> category: Time
readme.md view
@@ -43,7 +43,7 @@ The only effect contained in **polysemy-time** is: ```haskell-data Time (time :: *) (date :: *) :: Effect where+data Time (time :: Type) (date :: Type) :: Effect where Now :: Time t d m t Today :: Time t d m d Sleep :: TimeUnit u => u -> Time t d m ()