1- {-# LANGUAGE CPP #-}
2- {-# LANGUAGE FlexibleInstances #-}
3- {-# LANGUAGE LambdaCase #-}
4- {-# LANGUAGE OverloadedStrings #-}
5- {-# LANGUAGE TypeApplications #-}
1+ {-# LANGUAGE FlexibleInstances #-}
2+ {-# LANGUAGE LambdaCase #-}
3+ {-# LANGUAGE OverloadedStrings #-}
4+ {-# LANGUAGE ScopedTypeVariables #-}
5+ {-# LANGUAGE TypeApplications #-}
66{-# OPTIONS_GHC -fno-warn-orphans #-}
77{-|
88Module : HsLua.Module.DocLayout
@@ -78,10 +78,6 @@ import Text.DocLayout (Doc, (<+>), ($$), ($+$))
7878import qualified Data.Text as T
7979import qualified Text.DocLayout as Doc
8080
81- #if ! MIN_VERSION_base(4, 11, 0)
82- import Data.Monoid ((<>) )
83- #endif
84-
8581--
8682-- Module
8783--
@@ -98,14 +94,15 @@ documentedModule = Module
9894 , moduleDescription = description
9995 , moduleFunctions = functions
10096 , moduleOperations = []
97+ , moduleTypeInitializers = [initType typeDoc]
10198 }
10299
103100--
104101-- Fields
105102--
106103
107104-- | Exposed fields.
108- fields :: LuaError e => [Field e ]
105+ fields :: forall e . LuaError e => [Field e ]
109106fields =
110107 [ blankline
111108 , cr
@@ -114,36 +111,40 @@ fields =
114111 ]
115112
116113-- | Wrapped and documented 'Doc.blankline' value.
117- blankline :: LuaError e => Field e
114+ blankline :: forall e . LuaError e => Field e
118115blankline = Field
119116 { fieldName = " blankline"
120117 , fieldDescription = " Inserts a blank line unless one exists already."
118+ , fieldType = udTypeSpec @ e typeDoc
121119 , fieldPushValue = pushDoc Doc. blankline
122120 }
123121
124122-- | Wrapped and documented 'Doc.cr' value.
125- cr :: LuaError e => Field e
123+ cr :: forall e . LuaError e => Field e
126124cr = Field
127125 { fieldName = " cr"
128126 , fieldDescription = " A carriage return. Does nothing if we're at " <>
129127 " the beginning of a line; " <>
130128 " otherwise inserts a newline."
129+ , fieldType = udTypeSpec @ e typeDoc
131130 , fieldPushValue = pushDoc Doc. cr
132131 }
133132
134133-- | Wrapped and documented 'Doc.empty' value.
135- empty :: LuaError e => Field e
134+ empty :: forall e . LuaError e => Field e
136135empty = Field
137136 { fieldName = " empty"
138137 , fieldDescription = " The empty document."
138+ , fieldType = udTypeSpec @ e typeDoc
139139 , fieldPushValue = pushDoc Doc. empty
140140 }
141141
142142-- | Wrapped and documented 'Doc.space' value.
143- space :: LuaError e => Field e
143+ space :: forall e . LuaError e => Field e
144144space = Field
145145 { fieldName = " space"
146146 , fieldDescription = " A breaking (reflowable) space."
147+ , fieldType = udTypeSpec @ e typeDoc
147148 , fieldPushValue = pushDoc Doc. space
148149 }
149150
0 commit comments