Safe Haskell | Safe-Inferred |
---|---|

Language | GHC2021 |

Time effect, Internal

## Synopsis

- data Time (time :: Type) (date :: Type) :: Effect where
- now :: forall t d r. Member (Time t d) r => Sem r t
- today :: forall t d r. Member (Time t d) r => Sem r d
- sleep :: forall t d u r. TimeUnit u => Member (Time t d) r => u -> Sem r ()
- setTime :: forall t d r. Member (Time t d) r => t -> Sem r ()
- adjust :: forall t d u1 u2 r. AddTimeUnit t u1 u2 => Member (Time t d) r => u1 -> Sem r ()
- setDate :: forall t d r. Member (Time t d) r => d -> Sem r ()

# Documentation

data Time (time :: Type) (date :: Type) :: Effect where Source #

The Time effect.

Now :: Time t d m t | Produce the current time, possibly relative to what was set with |

Today :: Time t d m d | Produce the current date, possibly relative to what was set with |

Sleep :: TimeUnit u => u -> Time t d m () | Suspend the current computation for the specified time span. |

SetTime :: t -> Time t d m () | Set the current time, if the interpreter supports it. |

Adjust :: TimeUnit u1 => u1 -> Time t d m () | Adjust the current time relatively, if the interpreter supports it. |

SetDate :: d -> Time t d m () | Set the current date, if the interpreter supports it. |

sleep :: forall t d u r. TimeUnit u => Member (Time t d) r => u -> Sem r () Source #

Suspend the current computation for the specified time span.

setTime :: forall t d r. Member (Time t d) r => t -> Sem r () Source #

Set the current time, if the interpreter supports it.