forest/src/Forest/TreeModule.hs
Joscha 220b5a3234 [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.
2020-02-13 23:23:15 +00:00

23 lines
483 B
Haskell

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