@@ -29,6 +29,7 @@ module Foreign.Lua.Module.DocLayout (
2929 , brackets
3030 , cblock
3131 , chomp
32+ , concat
3233 , cr
3334 , double_quotes
3435 , empty
@@ -49,7 +50,6 @@ module Foreign.Lua.Module.DocLayout (
4950
5051 -- * Functions
5152 , render
52- , concat
5353
5454 -- * Marshaling
5555 , peekDoc
@@ -94,6 +94,7 @@ pushModule = do
9494 Lua. addfunction " brackets" brackets
9595 Lua. addfunction " cblock" cblock
9696 Lua. addfunction " chomp" chomp
97+ Lua. addfunction " concat" concat
9798 Lua. addfunction " double_quotes" double_quotes
9899 Lua. addfunction " flush" flush
99100 Lua. addfunction " hang" hang
@@ -108,8 +109,7 @@ pushModule = do
108109 Lua. addfunction " prefixed" prefixed
109110 Lua. addfunction " rblock" rblock
110111 Lua. addfunction " vfill" vfill
111- -- renderign
112- Lua. addfunction " concat" concat
112+ -- rendering
113113 Lua. addfunction " render" render
114114 return 1
115115
@@ -124,13 +124,6 @@ preloadModule = flip Lua.preloadhs pushModule
124124render :: Doc Text -> Optional Int -> Lua Text
125125render doc optLength = return $ Doc. render (Lua. fromOptional optLength) doc
126126
127- -- | Concatenates a list of @'Doc'@s.
128- concat :: [Doc Text ] -> Optional (Doc Text ) -> Lua (Doc Text )
129- concat docs optSep = return $
130- case Lua. fromOptional optSep of
131- Nothing -> mconcat docs
132- Just sep -> mconcat $ intersperse sep docs
133-
134127--
135128-- Constructors
136129--
@@ -169,6 +162,13 @@ cblock width = return . Doc.cblock width
169162chomp :: Doc Text -> Lua (Doc Text )
170163chomp = return . Doc. chomp
171164
165+ -- | Concatenates a list of @'Doc'@s.
166+ concat :: [Doc Text ] -> Optional (Doc Text ) -> Lua (Doc Text )
167+ concat docs optSep = return $
168+ case Lua. fromOptional optSep of
169+ Nothing -> mconcat docs
170+ Just sep -> mconcat $ intersperse sep docs
171+
172172-- | A carriage return. Does nothing if we're at the beginning of
173173-- a line; otherwise inserts a newline.
174174cr :: Doc Text
0 commit comments