unpack :: FilePath -> FilePath -> IO ExitCode
unpack file dir =
  let ext = maybe (error "cannot get file extension") id $ extension file
  in case ext of
    "rar" -> rarUnpacker file dir
    "zip" -> zipUnpacker file dir
    _ -> error "unknown file type"
unpack :: FilePath -> FilePath -> IO ExitCode
unpack file dir =
  let ext = maybe (error "cannot get file extension") id $ extension file
  in case ext of
    "rar" -> rarUnpacker file dir
    "zip" -> zipUnpacker file dir
    _ -> error "unknown file type"
unpack file dir =
  let ext = maybe (error "cannot get file extension") id $ extension file
  in case ext of
    "rar" -> rarUnpacker file dir
    "zip" -> zipUnpacker file dir
    _ -> error "unknown file type"