diff --git a/Bindings/Haskell/dist-mcabal/autogen/Paths_p2prc.hs b/Bindings/Haskell/dist-mcabal/autogen/Paths_p2prc.hs deleted file mode 100644 index 4304a93..0000000 --- a/Bindings/Haskell/dist-mcabal/autogen/Paths_p2prc.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Paths_p2prc where -import Data.Version -version :: Version; version = makeVersion [0,1,0,0] -getDataDir :: IO FilePath; getDataDir = return "/Users/akilan/.mcabal/mhs-0.12.3.0/packages/p2prc-0.1.0.0/data" diff --git a/Bindings/Haskell/lib/API.hs b/Bindings/Haskell/lib/API.hs index d82fbb1..f2d7186 100644 --- a/Bindings/Haskell/lib/API.hs +++ b/Bindings/Haskell/lib/API.hs @@ -20,17 +20,17 @@ import Error import JSON ( IPAddressTable(..) , MapPortResponse(..) - , P2prcConfig + , P2PRCConfig ) import CLI ( StdInput(..) , CLIOpt(..) , eitherErrDecode - , p2PrcCmdName + , p2prcCmdName , eitherExecProcess , eitherExecProcessParser - , spawnProcP2Prc + , spawnProcP2PRC ) @@ -41,7 +41,7 @@ data P2PRCapi = MkP2PRCapi { startServer :: IOEitherError ProcessHandle -- ^ Start server - , execInitConfig :: IOEitherError P2prcConfig + , execInitConfig :: IOEitherError P2PRCConfig -- ^ Instantiate server configuration , execListServers :: IOEitherError IPAddressTable -- ^ List servers in network @@ -94,14 +94,14 @@ main = p2prcAPI :: P2PRCapi p2prcAPI = MkP2PRCapi - { startServer = spawnProcP2Prc p2PrcCmdName [ MkOptAtomic "--s" ] + { startServer = spawnProcP2PRC p2prcCmdName [ MkOptAtomic "--s" ] , execListServers = - execProcP2PrcParser [ MkOptAtomic "--ls" ] MkEmptyStdInput + execProcP2PRCParser [ MkOptAtomic "--ls" ] MkEmptyStdInput , execMapPort = \ (MkMapPortRequest portNumber domainName) -> - execProcP2PrcParser + execProcP2PRCParser [ MkOptTuple ( "--mp" , show portNumber @@ -115,7 +115,7 @@ p2prcAPI = , execInitConfig = do - confInitRes <- execProcP2Prc [ MkOptAtomic "--dc" ] MkEmptyStdInput + confInitRes <- execProcP2PRC [ MkOptAtomic "--dc" ] MkEmptyStdInput case confInitRes of (Right _) -> do @@ -140,12 +140,12 @@ p2prcAPI = where - execProcP2PrcParser :: + execProcP2PRCParser :: FromJSON a => [CLIOpt] -> StdInput -> IOEitherError a - execProcP2PrcParser = eitherExecProcessParser p2PrcCmdName + execProcP2PRCParser = eitherExecProcessParser p2prcCmdName -- TODO: GHC question, why does it scope down instead staying generic - execProcP2Prc = eitherExecProcess p2PrcCmdName + execProcP2PRC = eitherExecProcess p2prcCmdName diff --git a/Bindings/Haskell/lib/CLI.hs b/Bindings/Haskell/lib/CLI.hs index ff0b69e..0896c3c 100644 --- a/Bindings/Haskell/lib/CLI.hs +++ b/Bindings/Haskell/lib/CLI.hs @@ -87,8 +87,8 @@ optsToCLI = concatMap _optToCLI _optToCLI (MkOptTuple (o, v)) = [o, v] -spawnProcP2Prc :: CLICmd -> [CLIOpt] -> IOEitherError ProcessHandle -spawnProcP2Prc cmd opts = +spawnProcP2PRC :: CLICmd -> [CLIOpt] -> IOEitherError ProcessHandle +spawnProcP2PRC cmd opts = do let prc = proc cmd $ optsToCLI opts @@ -115,6 +115,6 @@ eitherErrorDecode esa = -- assumes the program is ran inside the haskell module in p2prc's repo -- assumes that last path segment is "haskell" and that p2prc binary's name is "p2p-rendering-computation" -p2PrcCmdName :: String -p2PrcCmdName = "p2p-rendering-computation" +p2prcCmdName :: String +p2prcCmdName = "p2p-rendering-computation" diff --git a/Bindings/Haskell/lib/JSON.hs b/Bindings/Haskell/lib/JSON.hs index 9affc8c..af34f77 100644 --- a/Bindings/Haskell/lib/JSON.hs +++ b/Bindings/Haskell/lib/JSON.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module JSON - ( P2prcConfig(..) + ( P2PRCConfig(..) , IPAddressTable(..) , IPAddress(..) , ServerInfo(..) @@ -38,11 +38,11 @@ instance FromJSON MapPortResponse where -{-# WARNING P2prcConfig "This type is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-} +{-# WARNING P2PRCConfig "This type is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-} -- | This represents the server configuration that defines its attributes and behaviours in the network, as well as, the location of the runtime persistence artifacts. -newtype P2prcConfig - = MkP2prConfig +newtype P2PRCConfig + = MkP2PRCConfig { machineName :: String -- ^ Machine Name } deriving Show @@ -96,13 +96,13 @@ newtype P2prcConfig -- to have a dedicated port field -instance FromJSON P2prcConfig where +instance FromJSON P2PRCConfig where parseJSON (Object o) = do machineName <- o .: "MachineName" pure - $ MkP2prConfig + $ MkP2PRCConfig { machineName=machineName } diff --git a/Bindings/Haskell/lib/P2PRC.hs b/Bindings/Haskell/lib/P2PRC.hs index 1fb78c0..c948ced 100644 --- a/Bindings/Haskell/lib/P2PRC.hs +++ b/Bindings/Haskell/lib/P2PRC.hs @@ -49,7 +49,7 @@ module P2PRC -- ** Interface data types -- | This section gives an overview on the runtime and host machine interfaces. , P2PRCapi(..) - , P2prcConfig(..) + , P2PRCConfig(..) , MapPortRequest(..) , MapPortResponse(..) @@ -76,7 +76,7 @@ import JSON , ServerInfo(..) , IPAddress(..) , MapPortResponse(..) - , P2prcConfig(..) + , P2PRCConfig(..) ) import API diff --git a/Bindings/Haskell/out.comb b/Bindings/Haskell/out.comb deleted file mode 100644 index fa7af8b..0000000 --- a/Bindings/Haskell/out.comb +++ /dev/null @@ -1 +0,0 @@ -z \ No newline at end of file