From 7f59fd16534fc4fe417640130c415107008a638c Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 16 Feb 2021 13:11:37 +0300 Subject: Now Machine is in Emulator which is a monad. =) --- Main.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Main.hs') 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 -- cgit v1.2.3