@@ -57,24 +57,17 @@ attrToMap (id',classes,keyvals) = M.fromList
5757 : ("class", unwords classes)
5858 : keyvals
5959
60−getList :: StackValue a => LuaState -> Int -> IO [a]
61−getList lua i' = do
62− continue <- Lua.next lua i'
63− if continue
64− then do
65− next <- Lua.peek lua (-1)
66− Lua.pop lua 1
67− x <- maybe (fail "peek returned Nothing") return next
68− rest <- getList lua i'
69− return (x : rest)
70− else return []
71−
7260#if MIN_VERSION_hslua(0,4,0)
61+#if MIN_VERSION_base(4,8,0)
7362instance {-# OVERLAPS #-} StackValue [Char] where
63+#else
64+instance StackValue [Char] where
65+#endif
7466 push lua cs = Lua.push lua (UTF8.fromString cs)
7567 peek lua i = do
7668 res <- Lua.peek lua i
7769 return $ UTF8.toString `fmap` res
70+ valuetype _ = Lua.TSTRING
7871#else
7972#if MIN_VERSION_base(4,8,0)
8073instance {-# OVERLAPS #-} StackValue a => StackValue [a] where
@@ -93,6 +86,18 @@ instance StackValue a => StackValue [a] where
9386 Lua.pop lua 1
9487 return (Just lst)
9588 valuetype _ = Lua.TTABLE
89+
90+getList :: StackValue a => LuaState -> Int -> IO [a]
91+getList lua i' = do
92+ continue <- Lua.next lua i'
93+ if continue
94+ then do
95+ next <- Lua.peek lua (-1)
96+ Lua.pop lua 1
97+ x <- maybe (fail "peek returned Nothing") return next
98+ rest <- getList lua i'
99+ return (x : rest)
100+ else return []
96101#endif
97102
98103instance StackValue Format where