[server] Adjust TreeModule structure

This commit prepares a slighly more powerful TreeModule structure: Now,
TreeModules can finish their execution, which should make some kinds of menus
and transitions possible.
This commit is contained in:
Joscha 2020-02-13 23:12:28 +00:00
parent d08f858692
commit 220b5a3234
4 changed files with 26 additions and 18 deletions

View file

@ -8,16 +8,16 @@ import qualified Data.Text as T
import Forest.Node
class TreeModule a where
edit :: a -> Path -> T.Text -> IO ()
edit _ _ _ = pure ()
edit :: a -> Path -> T.Text -> IO Bool
edit _ _ _ = pure True
delete :: a -> Path -> IO ()
delete _ _ = pure ()
delete :: a -> Path -> IO Bool
delete _ _ = pure True
reply :: a -> Path -> T.Text -> IO ()
reply _ _ _ = pure ()
reply :: a -> Path -> T.Text -> IO Bool
reply _ _ _ = pure True
act :: a -> Path -> IO ()
act _ _ = pure ()
act :: a -> Path -> IO Bool
act _ _ = pure True
type ModuleConstructor a = (Node -> IO ()) -> (a -> IO ()) -> IO ()