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 #-}
6
6
{-# OPTIONS_GHC -fno-warn-orphans #-}
7
7
{-|
8
8
Module : HsLua.Module.DocLayout
@@ -78,10 +78,6 @@ import Text.DocLayout (Doc, (<+>), ($$), ($+$))
78
78
import qualified Data.Text as T
79
79
import qualified Text.DocLayout as Doc
80
80
81
- #if ! MIN_VERSION_base(4, 11, 0)
82
- import Data.Monoid ((<>) )
83
- #endif
84
-
85
81
--
86
82
-- Module
87
83
--
@@ -98,14 +94,15 @@ documentedModule = Module
98
94
, moduleDescription = description
99
95
, moduleFunctions = functions
100
96
, moduleOperations = []
97
+ , moduleTypeInitializers = [initType typeDoc]
101
98
}
102
99
103
100
--
104
101
-- Fields
105
102
--
106
103
107
104
-- | Exposed fields.
108
- fields :: LuaError e => [Field e ]
105
+ fields :: forall e . LuaError e => [Field e ]
109
106
fields =
110
107
[ blankline
111
108
, cr
@@ -114,36 +111,40 @@ fields =
114
111
]
115
112
116
113
-- | Wrapped and documented 'Doc.blankline' value.
117
- blankline :: LuaError e => Field e
114
+ blankline :: forall e . LuaError e => Field e
118
115
blankline = Field
119
116
{ fieldName = " blankline"
120
117
, fieldDescription = " Inserts a blank line unless one exists already."
118
+ , fieldType = udTypeSpec @ e typeDoc
121
119
, fieldPushValue = pushDoc Doc. blankline
122
120
}
123
121
124
122
-- | Wrapped and documented 'Doc.cr' value.
125
- cr :: LuaError e => Field e
123
+ cr :: forall e . LuaError e => Field e
126
124
cr = Field
127
125
{ fieldName = " cr"
128
126
, fieldDescription = " A carriage return. Does nothing if we're at " <>
129
127
" the beginning of a line; " <>
130
128
" otherwise inserts a newline."
129
+ , fieldType = udTypeSpec @ e typeDoc
131
130
, fieldPushValue = pushDoc Doc. cr
132
131
}
133
132
134
133
-- | Wrapped and documented 'Doc.empty' value.
135
- empty :: LuaError e => Field e
134
+ empty :: forall e . LuaError e => Field e
136
135
empty = Field
137
136
{ fieldName = " empty"
138
137
, fieldDescription = " The empty document."
138
+ , fieldType = udTypeSpec @ e typeDoc
139
139
, fieldPushValue = pushDoc Doc. empty
140
140
}
141
141
142
142
-- | Wrapped and documented 'Doc.space' value.
143
- space :: LuaError e => Field e
143
+ space :: forall e . LuaError e => Field e
144
144
space = Field
145
145
{ fieldName = " space"
146
146
, fieldDescription = " A breaking (reflowable) space."
147
+ , fieldType = udTypeSpec @ e typeDoc
147
148
, fieldPushValue = pushDoc Doc. space
148
149
}
149
150
0 commit comments