aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-02-16 13:11:37 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-02-16 13:11:37 +0300
commit7f59fd16534fc4fe417640130c415107008a638c (patch)
treeb1dd2f6954f6590c3cd546c5548b26ab3ec1f105 /Main.hs
parent97bbb430e4f1460858b2f1baaffc2ef804c63086 (diff)
downloadsuem-7f59fd16534fc4fe417640130c415107008a638c.tar
suem-7f59fd16534fc4fe417640130c415107008a638c.tar.xz
suem-7f59fd16534fc4fe417640130c415107008a638c.zip
Now Machine is in Emulator which is a monad. =)
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index 05610ed..ca9c155 100644
--- a/Main.hs
+++ b/Main.hs
@@ -1,8 +1,10 @@
+-- This module parses config as passed in arguments and runs Emulator.
module Main where
import Options.Applicative
import Suem
+
inet_socket :: String -> Parser ConfigSocket
inet_socket sock = ConfigInet <$> strOption
( long ("i" ++ sock)
@@ -18,6 +20,7 @@ unix_socket sock = ConfigUnix <$> strOption
socket :: String -> Parser (Maybe ConfigSocket)
socket sock = optional (inet_socket sock <|> unix_socket sock)
+
config :: Parser Config
config = Config
<$> option auto