Skip to content

Commit 21d6de7

Browse files
committed
Use Data.Data to get constructor names
1 parent a0c3f27 commit 21d6de7

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/Text/Pandoc/Lua/Marshal/Inline.hs

+2-21
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import Text.Pandoc.Lua.Marshal.MathType (peekMathType, pushMathType)
4747
import Text.Pandoc.Lua.Marshal.QuoteType (peekQuoteType, pushQuoteType)
4848
import Text.Pandoc.Lua.Marshal.Shared (walkBlocksAndInlines)
4949
import Text.Pandoc.Lua.Walk (SpliceList, Walkable, walkSplicing, walkStraight)
50+
import qualified Data.ByteString.Char8 as Char8
5051
import qualified Data.Text as T
5152
import qualified Text.Pandoc.Builder as B
5253

@@ -376,27 +377,7 @@ typeInline = defsumtype "Inline"
376377
<#> parameter peekFilter "Filter" "lua_filter" "table of filter functions"
377378
=#> functionResult pushInline "Inline" "modified element"
378379
]
379-
(\case
380-
Cite{} -> "Cite"
381-
Code{} -> "Code"
382-
Emph{} -> "Emph"
383-
Image{} -> "Image"
384-
LineBreak{} -> "LineBreak"
385-
Link{} -> "Link"
386-
Math{} -> "Math"
387-
Note{} -> "Note"
388-
Quoted{} -> "Quoted"
389-
RawInline{} -> "RawInline"
390-
SmallCaps{} -> "SmallCaps"
391-
SoftBreak{} -> "SoftBreak"
392-
Space{} -> "Space"
393-
Span{} -> "Span"
394-
Strikeout{} -> "Strikeout"
395-
Strong{} -> "Strong"
396-
Str{} -> "Str"
397-
Subscript{} -> "Subscript"
398-
Superscript{} -> "Superscript"
399-
Underline{} -> "Underline")
380+
(Name . Char8.pack . showConstr . toConstr)
400381
[ defconstructor "Cite"
401382
"Citation"
402383
[ ("citations", citationsProperty)

0 commit comments

Comments
 (0)