Make “sublibrary” standard terminology in docs
[cabal.git] / Cabal / src / Distribution / Simple / Build / PackageInfoModule / Z.hs
blob6bc973148092631ccd2fc799059cc805025a6bac
1 {-# LANGUAGE DeriveGeneric #-}
3 module Distribution.Simple.Build.PackageInfoModule.Z (render, Z (..)) where
5 import Distribution.ZinzaPrelude
7 data Z = Z
8 { zPackageName :: String
9 , zVersionDigits :: String
10 , zSynopsis :: String
11 , zCopyright :: String
12 , zHomepage :: String
13 , zSupportsNoRebindableSyntax :: Bool
15 deriving (Generic)
17 render :: Z -> String
18 render z_root = execWriter $ do
19 if (zSupportsNoRebindableSyntax z_root)
20 then do
21 tell "{-# LANGUAGE NoRebindableSyntax #-}\n"
22 return ()
23 else do
24 return ()
25 tell "{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}\n"
26 tell "{-# OPTIONS_GHC -w #-}\n"
27 tell "module PackageInfo_"
28 tell (zPackageName z_root)
29 tell " (\n"
30 tell " name,\n"
31 tell " version,\n"
32 tell " synopsis,\n"
33 tell " copyright,\n"
34 tell " homepage,\n"
35 tell " ) where\n"
36 tell "\n"
37 tell "import Data.Version (Version(..))\n"
38 tell "import Prelude\n"
39 tell "\n"
40 tell "name :: String\n"
41 tell "name = "
42 tell (show $ zPackageName z_root)
43 tell "\n"
44 tell "version :: Version\n"
45 tell "version = Version "
46 tell (zVersionDigits z_root)
47 tell " []\n"
48 tell "\n"
49 tell "synopsis :: String\n"
50 tell "synopsis = "
51 tell (show $ zSynopsis z_root)
52 tell "\n"
53 tell "copyright :: String\n"
54 tell "copyright = "
55 tell (show $ zCopyright z_root)
56 tell "\n"
57 tell "homepage :: String\n"
58 tell "homepage = "
59 tell (show $ zHomepage z_root)
60 tell "\n"