Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LastRunState
- lrsHost :: Lens' LastRunState Hostname
- lrsPort :: Lens' LastRunState Port
- lrsUserId :: Lens' LastRunState UserId
- lrsSelectedChannelId :: Lens' LastRunState (Maybe ChannelId)
- lrsOpenThread :: Lens' LastRunState (Maybe (ChannelId, PostId))
- writeLastRunStates :: ChatState -> IO ()
- readLastRunState :: TeamId -> IO (Either String LastRunState)
- isValidLastRunState :: ChatResources -> User -> LastRunState -> Bool
Documentation
data LastRunState Source #
Run state of the program. This is saved in a file on program exit and | looked up from the file on program startup.
Instances
FromJSON LastRunState Source # | |
Defined in Matterhorn.LastRunState parseJSON :: Value -> Parser LastRunState # parseJSONList :: Value -> Parser [LastRunState] # | |
ToJSON LastRunState Source # | |
Defined in Matterhorn.LastRunState toJSON :: LastRunState -> Value # toEncoding :: LastRunState -> Encoding # toJSONList :: [LastRunState] -> Value # toEncodingList :: [LastRunState] -> Encoding # |
lrsOpenThread :: Lens' LastRunState (Maybe (ChannelId, PostId)) Source #
writeLastRunStates :: ChatState -> IO () Source #
Writes the run state to a file. The file is specific to the current team. | Writes only if the current channel is an ordrinary or a private channel.
readLastRunState :: TeamId -> IO (Either String LastRunState) Source #
Reads the last run state from a file given the current team ID.
isValidLastRunState :: ChatResources -> User -> LastRunState -> Bool Source #
Checks if the given last run state is valid for the current server and user.