def produce_paths_module(name, version):
  """Produce content of Paths_* module usually generated by Cabal. We do not
  replicate the whole thing yet, only version definition which is the most
  often used thing.

  Args:
    name:    String, package name.
    version: String, version string with dot-separated components, e.g. "1.2.3".

  Returns:
    String, String:
      * Filename for the module file.
      * Textual contents of the file.
  """

  adjusted_pkgname = name.replace("-", "_")

  contents = """
  {-# OPTIONS_GHC -fno-warn-implicit-prelude #-}
  module Paths_"""
  contents += adjusted_pkgname
  contents += """ (
    version
  ) where

  import Data.Version (Version (..))
  import Prelude

  version :: Version
  version = Version ["""
  contents += version.replace(".", ",")
  contents += """] []
  """

  filename = "Paths_" + adjusted_pkgname + ".hs"
  return filename, contents