UJSPCZEQ5H5RKBLFM2SEJJTSKANJ7NKSM7DDWDWQ743ZPHMECROQC
O2MR7QHTC3YJ2BBLNDEI7LY6RWE53BEAJNOQXJYSXEHFI7JKHAUQC
SH5LN2XPACSVN3WOY66HB6SMHT7CICVTEK4HRL2OPD57XBB2NHDAC
B2JWXIEPCMVVITDJDR2SACY4VHITXGH7ZM6A5RWN6E7OKTO43TUAC
R3FT6FQUBETBTUO3IV5VWORIULZ4JR23YEF5NYWWSNDP7NYWVGYQC
R3GV7TM2HTCXTHWA76FZK6JJRSXCPRPXHV7FKMWXPQ2W2RIOTXEQC
XOHIUPWBW5BT2S6Y53DNE4VEYJHE6N3OAPTQLQAB53EDD2WN62JQC
dispatch :: Command -> ReaderT (Config Run) IO ()
dispatch (Options.Primer x) = primerDispatch x
primerDispatch :: Primer.PrimerCommand -> ReaderT (Config Run) IO ()
primerDispatch (Primer.Add vol loc) = undefined
primerDispatch (Primer.New vol from to loc) = undefined
primerDispatch Primer.List = do
config <- ask
primers <- listPrimers
liftIO $ print primers
listPrimers :: ReaderT (Config Run) IO [Primer]
listPrimers = do
config <- ask
-- Get the file contents
let filename = Options.fromRun $ Options.dataFile config
liftIO $ withFile filename ReadMode
(\filehandle -> do
contents <- hGetContents filehandle
putStrLn contents
)
-- Decode from JSON to list of Al Bhed Primers
-- Return the primers
return []