parseVersion :: String -> Maybe JupyterVersion
parseVersion versionStr =
  let versions = map (readMaybe . T.unpack) $ T.splitOn "." $ T.pack versionStr
      parsed = all isJust versions
  in if parsed
       then case versions of
         [x, y, z] -> JupyterVersion <$> x <*> y <*> z
         [x, y]    -> JupyterVersion <$> x <*> y <*> pure 0
         [x]       -> JupyterVersion <$> x <*> pure 0 <*> pure 0
         _         -> Nothing
       else Nothing
parseVersion :: String -> Maybe JupyterVersion
parseVersion versionStr =
  let versions = map (readMaybe . T.unpack) $ T.splitOn "." $ T.pack versionStr
      parsed = all isJust versions
  in if parsed
       then case versions of
         [x, y, z] -> JupyterVersion <$> x <*> y <*> z
         [x, y]    -> JupyterVersion <$> x <*> y <*> pure 0
         [x]       -> JupyterVersion <$> x <*> pure 0 <*> pure 0
         _         -> Nothing
       else Nothing
parseVersion versionStr =
  let versions = map (readMaybe . T.unpack) $ T.splitOn "." $ T.pack versionStr
      parsed = all isJust versions
  in if parsed
       then case versions of
         [x, y, z] -> JupyterVersion <$> x <*> y <*> z
         [x, y]    -> JupyterVersion <$> x <*> y <*> pure 0
         [x]       -> JupyterVersion <$> x <*> pure 0 <*> pure 0
         _         -> Nothing
       else Nothing