forest/src/Forest/TreeModule.hs
Joscha 6d6344d372 [server] Add ForkModule for combining other modules
This one has some interesting code in its constructor, using the Cont monad
because of the way the ModuleConstructor is structured.
2020-02-12 00:38:29 +00:00

23 lines
467 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 ()
edit _ _ _ = pure ()
delete :: a -> Path -> IO ()
delete _ _ = pure ()
reply :: a -> Path -> T.Text -> IO ()
reply _ _ _ = pure ()
act :: a -> Path -> IO ()
act _ _ = pure ()
type ModuleConstructor a = (Node -> IO ()) -> (a -> IO ()) -> IO ()