diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-01-04 09:55:15 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-01-04 09:55:15 -0800 |
commit | 8ed749702ff62bc41a88770c7f93a283a20a2a42 (patch) | |
tree | 90d537cf4d8e47ff768d46df06059c7fdd34ab96 /src/Text/Pandoc/Lua/Marshaling | |
parent | c5b6321b21b85ce3b6c988211d67f07de8c3efe2 (diff) | |
download | pandoc-8ed749702ff62bc41a88770c7f93a283a20a2a42.tar.gz |
Add type annotations to assist ghci.
Diffstat (limited to 'src/Text/Pandoc/Lua/Marshaling')
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/Version.hs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs index 226fe2e71..e8860c92c 100644 --- a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs +++ b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs @@ -1,6 +1,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {- | @@ -67,7 +68,8 @@ instance Pushable ReaderOptions where indexReaderOptions _tbl (AnyValue key) = do Lua.ltype key >>= \case Lua.TypeString -> Lua.peek key >>= \case - "defaultImageExtension" -> Lua.push defaultImageExtension + ("defaultImageExtension" :: Text.Text) + -> Lua.push defaultImageExtension "indentedCodeClasses" -> Lua.push indentedCodeClasses "stripComments" -> Lua.push stripComments "tabStop" -> Lua.push tabStop diff --git a/src/Text/Pandoc/Lua/Marshaling/Version.hs b/src/Text/Pandoc/Lua/Marshaling/Version.hs index f1d4bfd7f..9f80952fb 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Version.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Version.hs @@ -1,6 +1,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua.Marshaling.Version Copyright : © 2019 Albert Krewinkel @@ -19,6 +20,7 @@ module Text.Pandoc.Lua.Marshaling.Version where import Prelude +import Data.Text (Text) import Data.Maybe (fromMaybe) import Data.Version (Version (..), makeVersion, parseVersion, showVersion) import Foreign.Lua (Lua, Optional (..), NumResults, @@ -103,7 +105,7 @@ __index v (AnyValue k) = do Lua.push (Lua.Optional versionPart) return 1 Lua.TypeString -> do - str <- Lua.peek k + (str :: Text) <- Lua.peek k if str == "must_be_at_least" then 1 <$ Lua.pushHaskellFunction must_be_at_least else 1 <$ Lua.pushnil |