    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE TypeApplications    #-}
    {- |
       Module      : Text.Pandoc.Lua.Module.System
       Copyright   : © 2019-2024 Albert Krewinkel
       License     : GNU GPL, version 2 or above

       Maintainer  : Albert Krewinkel <albert+pandoc@tarleb.com>
       Stability   : alpha

    Pandoc's system Lua module.
    -}
    module Text.Pandoc.Lua.Module.System
      ( documentedModule
      ) where

    import Data.Version (makeVersion)
    import HsLua
    import HsLua.Module.System
      ( arch, cputime, env, getwd, ls, mkdir, os, rmdir
      , with_env, with_tmpdir, with_wd)
    import qualified HsLua.Module.System as MSys

    -- | Push the pandoc.system module on the Lua stack.
    documentedModule :: forall e. LuaError e => Module e
    documentedModule :: forall e. LuaError e => Module e
    documentedModule = Module
      { moduleName :: Name
    moduleName = Name
    "pandoc.system"
      , moduleDescription :: Text
    moduleDescription = forall e. Module e -> Text
    moduleDescription @e Module e
    forall e. LuaError e => Module e
    MSys.documentedModule
      , moduleFields :: [Field e]
    moduleFields =
          [ Field e
    forall e. Field e
    arch
          , Field e
    forall e. Field e
    os
          ]
      , moduleFunctions :: [DocumentedFunction e]
    moduleFunctions =
          [ DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    cputime                                        DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    3,Int
    1,Int
    1]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "environment" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    env                      DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    7,Int
    3]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "get_working_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    getwd          DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    8]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "list_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    ls                    DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    19]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "make_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    mkdir                 DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    19]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "remove_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    rmdir               DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    19]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "with_environment" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    with_env            DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    7,Int
    3]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "with_temporary_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    with_tmpdir DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    8]
          , Name -> DocumentedFunction e -> DocumentedFunction e
    forall e. Name -> DocumentedFunction e -> DocumentedFunction e
    setName Name
    "with_working_directory" DocumentedFunction e
    forall e. LuaError e => DocumentedFunction e
    with_wd       DocumentedFunction e -> Version -> DocumentedFunction e
    forall e. DocumentedFunction e -> Version -> DocumentedFunction e
    `since` [Int] -> Version
    v[Int
    2,Int
    7,Int
    3]
          ]
      , moduleOperations :: [(Operation, DocumentedFunction e)]
    moduleOperations = []
      , moduleTypeInitializers :: [LuaE e Name]
    moduleTypeInitializers = []
      }
     where
      v :: [Int] -> Version
    v = [Int] -> Version
    makeVersion