X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FWiki%2FInterpreter.hs;h=6bce1d06032f31277acf8be2a09285b2effa4adf;hp=32e1a3aa0e1760516d67e533b2fdb59a1942df43;hb=42f51754dea02201aececaacbf194d714cd58aaf;hpb=98fd1cb53a837a9bda7145544c34872acb13a634 diff --git a/Rakka/Wiki/Interpreter.hs b/Rakka/Wiki/Interpreter.hs index 32e1a3a..6bce1d0 100644 --- a/Rakka/Wiki/Interpreter.hs +++ b/Rakka/Wiki/Interpreter.hs @@ -1,3 +1,6 @@ +{-# LANGUAGE + UnicodeSyntax + #-} module Rakka.Wiki.Interpreter ( Interpreter(..) , InterpreterContext(..) @@ -6,22 +9,21 @@ module Rakka.Wiki.Interpreter , commandType -- private ) where - -import Rakka.Page -import Rakka.Storage -import Rakka.SystemConfig -import Rakka.Wiki -import Text.XML.HXT.DOM.TypeDefs - +import Data.Text (Text) +import Rakka.Page +import Rakka.Storage +import Rakka.SystemConfig +import Rakka.Wiki +import Text.XML.HXT.DOM.TypeDefs data Interpreter = InlineCommandInterpreter { - iciName :: !String - , iciInterpret :: !(InterpreterContext -> InlineCommand -> IO InlineElement) + iciName ∷ !Text + , iciInterpret ∷ !(InterpreterContext → InlineCommand → IO InlineElement) } | BlockCommandInterpreter { - bciName :: !String - , bciInterpret :: !(InterpreterContext -> BlockCommand -> IO BlockElement) + bciName ∷ !Text + , bciInterpret ∷ !(InterpreterContext → BlockCommand → IO BlockElement) } @@ -35,12 +37,10 @@ data InterpreterContext , ctxSysConf :: !SystemConfig } - -commandName :: Interpreter -> String +commandName ∷ Interpreter → Text commandName (InlineCommandInterpreter name _) = name commandName (BlockCommandInterpreter name _) = name - -commandType :: Interpreter -> CommandType +commandType ∷ Interpreter → CommandType commandType (InlineCommandInterpreter _ _) = InlineCommandType commandType (BlockCommandInterpreter _ _) = BlockCommandType