Add basic server

This commit is contained in:
Joscha 2020-02-08 18:02:08 +00:00
parent cde21038cb
commit 33f1076b52
4 changed files with 113 additions and 0 deletions

16
src/Forest/TreeModule.hs Normal file
View file

@ -0,0 +1,16 @@
module Forest.TreeModule
( TreeModule(..)
, ModuleConstructor
) where
import qualified Data.Text as T
import Forest.Api
class TreeModule a where
edit :: a -> Path -> T.Text -> IO ()
delete :: a -> Path -> IO ()
reply :: a -> Path -> T.Text -> IO ()
act :: a -> Path -> IO ()
type ModuleConstructor a = (Node -> IO ()) -> (a -> IO ()) -> IO ()