[all] Reorganize haskell code into multiple packages

This commit is contained in:
Joscha 2020-03-14 01:02:57 +00:00
parent 0edc241149
commit 4b8d0ee4a4
37 changed files with 368 additions and 140 deletions

View file

@ -1,25 +0,0 @@
{-# LANGUAGE MultiParamTypeClasses #-}
module Forest.Server.TreeModule
( TreeModule(..)
, ModuleConstructor
) where
import qualified Data.Text as T
import Forest.Node
class TreeModule a r where
edit :: a r -> Path -> T.Text -> IO (Maybe r)
edit _ _ _ = pure Nothing
delete :: a r -> Path -> IO (Maybe r)
delete _ _ = pure Nothing
reply :: a r -> Path -> T.Text -> IO (Maybe r)
reply _ _ _ = pure Nothing
act :: a r -> Path -> IO (Maybe r)
act _ _ = pure Nothing
type ModuleConstructor a = (Node -> IO ()) -> (a -> IO ()) -> IO ()