readSession :: String -> IO (Maybe Session)
readSession filename = do
  d <- (eitherDecode <$> getJSON) :: IO (Either String Session)
  case d of
    -- error with string
    Left err -> do
           putStrLn err
           return Nothing
    -- success with Session
    Right s -> return $ Just s
  where
    getJSON = B.readFile filename
readSession :: String -> IO (Maybe Session)
readSession filename = do
  d <- (eitherDecode <$> getJSON) :: IO (Either String Session)
  case d of
    -- error with string
    Left err -> do
           putStrLn err
           return Nothing
    -- success with Session
    Right s -> return $ Just s
  where
    getJSON = B.readFile filename
readSession filename = do
  d <- (eitherDecode <$> getJSON) :: IO (Either String Session)
  case d of
    -- error with string
    Left err -> do
           putStrLn err
           return Nothing
    -- success with Session
    Right s -> return $ Just s
  where
    getJSON = B.readFile filename