packages feed

ginger 0.8.1.0 → 0.8.2.0

raw patch · 4 files changed

+22/−3 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.Ginger.GVal: instance Text.Ginger.GVal.FromGVal m a => Text.Ginger.GVal.FromGVal m (GHC.Base.Maybe a)
- Text.Ginger.GVal: instance Text.Ginger.GVal.ToGVal m v => Text.Ginger.GVal.ToGVal m (GHC.Base.Maybe v)
- Text.Ginger.Parse: instance GHC.Exception.Exception Text.Ginger.Parse.ParserError
+ Text.Ginger.GVal: instance Text.Ginger.GVal.FromGVal m a => Text.Ginger.GVal.FromGVal m (GHC.Maybe.Maybe a)
+ Text.Ginger.GVal: instance Text.Ginger.GVal.ToGVal m v => Text.Ginger.GVal.ToGVal m (GHC.Maybe.Maybe v)
+ Text.Ginger.Parse: instance GHC.Exception.Type.Exception Text.Ginger.Parse.ParserError
+ Text.Ginger.Run: ArgumentsError :: Maybe Text -> Text -> RuntimeError p
+ Text.Ginger.Run: EvalParseError :: ParserError -> RuntimeError p
+ Text.Ginger.Run: IndexError :: Text -> RuntimeError p
+ Text.Ginger.Run: NotAFunctionError :: RuntimeError p
+ Text.Ginger.Run: RuntimeError :: Text -> RuntimeError p
+ Text.Ginger.Run: RuntimeErrorAt :: p -> RuntimeError p -> RuntimeError p
+ Text.Ginger.Run: TypeError :: [Text] -> Maybe Text -> RuntimeError p
+ Text.Ginger.Run: UndefinedBlockError :: Text -> RuntimeError p
+ Text.Ginger.Run: data RuntimeError p
+ Text.Ginger.Run: runtimeErrorMessage :: RuntimeError p -> Text
+ Text.Ginger.Run: runtimeErrorWhat :: RuntimeError p -> Text
+ Text.Ginger.Run: runtimeErrorWhere :: RuntimeError p -> [p]
+ Text.Ginger.Run.Builtins: capitalize :: Text -> Text
+ Text.Ginger.Run.Builtins: center :: Text -> Int -> Text -> Text
+ Text.Ginger.Run.Builtins: difference :: Num a => [a] -> a
+ Text.Ginger.Run.Builtins: formatFileSize :: Bool -> Integer -> String
+ Text.Ginger.Run.Builtins: getTimeLocale :: Monad m => GVal (Run p m h) -> Run p m h TimeLocale
+ Text.Ginger.Run.Builtins: gfnAll :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnAny :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnCenter :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnCompose :: forall m p h. Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnConcat :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnContains :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnDateFormat :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnDefault :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnDictsort :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnDivisibleBy :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnEquals :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnEscape :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnEscaped :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnEven :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnFileSizeFormat :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnFilter :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnGreater :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnGreaterEquals :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnIn :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnJSON :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnLess :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnLessEquals :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnMap :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnNEquals :: Monad m => Function m
+ Text.Ginger.Run.Builtins: gfnOdd :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnPartial :: forall m p h. Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnPrintf :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnRawHtml :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnReplace :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnSlice :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnSort :: forall p m h. Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnUrlEncode :: Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnZip :: forall m p h. Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: gfnZipWith :: forall m p h. Monad m => Function (Run p m h)
+ Text.Ginger.Run.Builtins: greater :: Monad m => GVal m -> GVal m -> Maybe Bool
+ Text.Ginger.Run.Builtins: greaterEq :: Monad m => GVal m -> GVal m -> Maybe Bool
+ Text.Ginger.Run.Builtins: gvalAutoParseDate :: TimeZone -> GVal m -> Maybe ZonedTime
+ Text.Ginger.Run.Builtins: gvalDictToDate :: TimeZone -> GVal m -> Maybe ZonedTime
+ Text.Ginger.Run.Builtins: gvalListToDate :: TimeZone -> GVal m -> Maybe ZonedTime
+ Text.Ginger.Run.Builtins: gvalToDate :: TimeZone -> GVal m -> Maybe ZonedTime
+ Text.Ginger.Run.Builtins: gvalToTZ :: GVal m -> Maybe TimeZone
+ Text.Ginger.Run.Builtins: inDict :: GVal m -> GVal m -> Bool
+ Text.Ginger.Run.Builtins: inList :: GVal m -> GVal m -> Bool
+ Text.Ginger.Run.Builtins: intRatio :: (Integral a, Num a) => [a] -> a
+ Text.Ginger.Run.Builtins: less :: Monad m => GVal m -> GVal m -> Maybe Bool
+ Text.Ginger.Run.Builtins: lessEq :: Monad m => GVal m -> GVal m -> Maybe Bool
+ Text.Ginger.Run.Builtins: listToIndexedDict :: [a] -> [(Text, a)]
+ Text.Ginger.Run.Builtins: looseEquals :: GVal m -> GVal m -> Bool
+ Text.Ginger.Run.Builtins: modulo :: (Integral a, Num a) => [a] -> a
+ Text.Ginger.Run.Builtins: onFst :: (a -> a -> b) -> (a, c) -> (a, d) -> b
+ Text.Ginger.Run.Builtins: parseTZ :: String -> Maybe TimeZone
+ Text.Ginger.Run.Builtins: printfG :: String -> [GVal m] -> String
+ Text.Ginger.Run.Builtins: ratio :: (Show a, Fractional a, Num a) => [a] -> a
+ Text.Ginger.Run.Builtins: tshow :: Show a => a -> Text
+ Text.Ginger.Run.Type: ArgumentsError :: Maybe Text -> Text -> RuntimeError p
+ Text.Ginger.Run.Type: EvalParseError :: ParserError -> RuntimeError p
+ Text.Ginger.Run.Type: GingerContext :: (VarName -> Run p m h (GVal (Run p m h))) -> (h -> Run p m h ()) -> (RuntimeError p -> Run p m h ()) -> (GVal (Run p m h) -> h) -> Maybe (Newlines h) -> GingerContext p m h
+ Text.Ginger.Run.Type: IndexError :: Text -> RuntimeError p
+ Text.Ginger.Run.Type: Newlines :: (h -> [h]) -> ([h] -> h) -> (h -> h) -> (h -> Bool) -> Newlines h
+ Text.Ginger.Run.Type: NotAFunctionError :: RuntimeError p
+ Text.Ginger.Run.Type: RunState :: HashMap VarName (GVal (Run p m h)) -> h -> Template p -> Maybe Text -> Maybe [h] -> Bool -> p -> RunState p m h
+ Text.Ginger.Run.Type: RuntimeError :: Text -> RuntimeError p
+ Text.Ginger.Run.Type: RuntimeErrorAt :: p -> RuntimeError p -> RuntimeError p
+ Text.Ginger.Run.Type: TypeError :: [Text] -> Maybe Text -> RuntimeError p
+ Text.Ginger.Run.Type: UndefinedBlockError :: Text -> RuntimeError p
+ Text.Ginger.Run.Type: [contextEncode] :: GingerContext p m h -> GVal (Run p m h) -> h
+ Text.Ginger.Run.Type: [contextLookup] :: GingerContext p m h -> VarName -> Run p m h (GVal (Run p m h))
+ Text.Ginger.Run.Type: [contextNewlines] :: GingerContext p m h -> Maybe (Newlines h)
+ Text.Ginger.Run.Type: [contextWarn] :: GingerContext p m h -> RuntimeError p -> Run p m h ()
+ Text.Ginger.Run.Type: [contextWrite] :: GingerContext p m h -> h -> Run p m h ()
+ Text.Ginger.Run.Type: [endsWithNewline] :: Newlines h -> h -> Bool
+ Text.Ginger.Run.Type: [joinLines] :: Newlines h -> [h] -> h
+ Text.Ginger.Run.Type: [rsAtLineStart] :: RunState p m h -> Bool
+ Text.Ginger.Run.Type: [rsCapture] :: RunState p m h -> h
+ Text.Ginger.Run.Type: [rsCurrentBlockName] :: RunState p m h -> Maybe Text
+ Text.Ginger.Run.Type: [rsCurrentSourcePos] :: RunState p m h -> p
+ Text.Ginger.Run.Type: [rsCurrentTemplate] :: RunState p m h -> Template p
+ Text.Ginger.Run.Type: [rsIndentation] :: RunState p m h -> Maybe [h]
+ Text.Ginger.Run.Type: [rsScope] :: RunState p m h -> HashMap VarName (GVal (Run p m h))
+ Text.Ginger.Run.Type: [splitLines] :: Newlines h -> h -> [h]
+ Text.Ginger.Run.Type: [stripIndent] :: Newlines h -> h -> h
+ Text.Ginger.Run.Type: class ContextEncodable h
+ Text.Ginger.Run.Type: data GingerContext p m h
+ Text.Ginger.Run.Type: data Newlines h
+ Text.Ginger.Run.Type: data RunState p m h
+ Text.Ginger.Run.Type: data RuntimeError p
+ Text.Ginger.Run.Type: easyContext :: (Monad m, ContextEncodable h, ToGVal (Run p m h) v) => (h -> m ()) -> v -> GingerContext p m h
+ Text.Ginger.Run.Type: encode :: forall m. ContextEncodable h => GVal m -> h
+ Text.Ginger.Run.Type: getSourcePos :: (Monad m, Applicative m, Functor m) => Run p m h p
+ Text.Ginger.Run.Type: hoistContext :: Monad m => (h -> t) -> (t -> h) -> GingerContext p m h -> GingerContext p m t
+ Text.Ginger.Run.Type: hoistNewlines :: (h -> t) -> (t -> h) -> Newlines h -> Newlines t
+ Text.Ginger.Run.Type: hoistRun :: Monad m => (h -> t) -> (t -> h) -> Run p m h a -> Run p m t a
+ Text.Ginger.Run.Type: hoistRunState :: Monad m => (h -> t) -> (t -> h) -> RunState p m h -> RunState p m t
+ Text.Ginger.Run.Type: instance Data.Default.Class.Default (Text.Ginger.Run.Type.RuntimeError p)
+ Text.Ginger.Run.Type: instance GHC.Show.Show p => GHC.Show.Show (Text.Ginger.Run.Type.RuntimeError p)
+ Text.Ginger.Run.Type: instance Text.Ginger.GVal.ToGVal m p => Text.Ginger.GVal.ToGVal m (Text.Ginger.Run.Type.RuntimeError p)
+ Text.Ginger.Run.Type: instance Text.Ginger.Run.Type.ContextEncodable Data.Text.Internal.Text
+ Text.Ginger.Run.Type: instance Text.Ginger.Run.Type.ContextEncodable Text.Ginger.Html.Html
+ Text.Ginger.Run.Type: liftRun :: Monad m => m a -> Run p m h a
+ Text.Ginger.Run.Type: liftRun2 :: Monad m => (a -> m b) -> a -> Run p m h b
+ Text.Ginger.Run.Type: makeContext :: (VarName -> GVal (Run p (Writer Html) Html)) -> GingerContext p (Writer Html) Html
+ Text.Ginger.Run.Type: makeContext' :: Monoid h => (VarName -> GVal (Run p (Writer h) h)) -> (GVal (Run p (Writer h) h) -> h) -> Maybe (Newlines h) -> GingerContext p (Writer h) h
+ Text.Ginger.Run.Type: makeContextExM' :: (Monad m, Functor m) => (VarName -> Run p m h (GVal (Run p m h))) -> (h -> m ()) -> (RuntimeError p -> m ()) -> (GVal (Run p m h) -> h) -> Maybe (Newlines h) -> GingerContext p m h
+ Text.Ginger.Run.Type: makeContextHtml :: (VarName -> GVal (Run p (Writer Html) Html)) -> GingerContext p (Writer Html) Html
+ Text.Ginger.Run.Type: makeContextHtmlExM :: (Monad m, Functor m) => (VarName -> Run p m Html (GVal (Run p m Html))) -> (Html -> m ()) -> (RuntimeError p -> m ()) -> GingerContext p m Html
+ Text.Ginger.Run.Type: makeContextHtmlM :: (Monad m, Functor m) => (VarName -> Run p m Html (GVal (Run p m Html))) -> (Html -> m ()) -> GingerContext p m Html
+ Text.Ginger.Run.Type: makeContextM :: (Monad m, Functor m) => (VarName -> Run p m Html (GVal (Run p m Html))) -> (Html -> m ()) -> GingerContext p m Html
+ Text.Ginger.Run.Type: makeContextM' :: (Monad m, Functor m) => (VarName -> Run p m h (GVal (Run p m h))) -> (h -> m ()) -> (GVal (Run p m h) -> h) -> Maybe (Newlines h) -> GingerContext p m h
+ Text.Ginger.Run.Type: makeContextText :: (VarName -> GVal (Run p (Writer Text) Text)) -> GingerContext p (Writer Text) Text
+ Text.Ginger.Run.Type: makeContextTextExM :: (Monad m, Functor m) => (VarName -> Run p m Text (GVal (Run p m Text))) -> (Text -> m ()) -> (RuntimeError p -> m ()) -> GingerContext p m Text
+ Text.Ginger.Run.Type: makeContextTextM :: (Monad m, Functor m) => (VarName -> Run p m Text (GVal (Run p m Text))) -> (Text -> m ()) -> GingerContext p m Text
+ Text.Ginger.Run.Type: newlines :: ContextEncodable h => Maybe (Newlines h)
+ Text.Ginger.Run.Type: runtimeErrorMessage :: RuntimeError p -> Text
+ Text.Ginger.Run.Type: runtimeErrorWhat :: RuntimeError p -> Text
+ Text.Ginger.Run.Type: runtimeErrorWhere :: RuntimeError p -> [p]
+ Text.Ginger.Run.Type: throwHere :: Monad m => RuntimeError p -> Run p m h a
+ Text.Ginger.Run.Type: type Run p m h = ExceptT (RuntimeError p) (StateT (RunState p m h) (ReaderT (GingerContext p m h) m))
+ Text.Ginger.Run.Type: warn :: Monad m => RuntimeError p -> Run p m h ()
+ Text.Ginger.Run.Type: warnFromMaybe :: Monad m => RuntimeError p -> a -> Maybe a -> Run p m h a
+ Text.Ginger.Run.Type: withSourcePos :: (Monad m, Applicative m, Functor m) => p -> Run p m h a -> Run p m h a
- Text.Ginger.AST: CallE :: a -> (Expression a) -> [(Maybe Text, (Expression a))] -> Expression a
+ Text.Ginger.AST: CallE :: a -> Expression a -> [(Maybe Text, Expression a)] -> Expression a
- Text.Ginger.AST: DefMacroS :: a -> VarName -> (Macro a) -> Statement a
+ Text.Ginger.AST: DefMacroS :: a -> VarName -> Macro a -> Statement a
- Text.Ginger.AST: DoE :: a -> (Statement a) -> Expression a
+ Text.Ginger.AST: DoE :: a -> Statement a -> Expression a
- Text.Ginger.AST: ExpressionS :: a -> (Expression a) -> Statement a
+ Text.Ginger.AST: ExpressionS :: a -> Expression a -> Statement a
- Text.Ginger.AST: ForS :: a -> (Maybe VarName) -> VarName -> (Expression a) -> (Statement a) -> Statement a
+ Text.Ginger.AST: ForS :: a -> Maybe VarName -> VarName -> Expression a -> Statement a -> Statement a
- Text.Ginger.AST: IfS :: a -> (Expression a) -> (Statement a) -> (Statement a) -> Statement a
+ Text.Ginger.AST: IfS :: a -> Expression a -> Statement a -> Statement a -> Statement a
- Text.Ginger.AST: IndentS :: a -> (Expression a) -> (Statement a) -> Statement a
+ Text.Ginger.AST: IndentS :: a -> Expression a -> Statement a -> Statement a
- Text.Ginger.AST: InterpolationS :: a -> (Expression a) -> Statement a
+ Text.Ginger.AST: InterpolationS :: a -> Expression a -> Statement a
- Text.Ginger.AST: LambdaE :: a -> [Text] -> (Expression a) -> Expression a
+ Text.Ginger.AST: LambdaE :: a -> [Text] -> Expression a -> Expression a
- Text.Ginger.AST: ListE :: a -> [(Expression a)] -> Expression a
+ Text.Ginger.AST: ListE :: a -> [Expression a] -> Expression a
- Text.Ginger.AST: MemberLookupE :: a -> (Expression a) -> (Expression a) -> Expression a
+ Text.Ginger.AST: MemberLookupE :: a -> Expression a -> Expression a -> Expression a
- Text.Ginger.AST: ObjectE :: a -> [((Expression a), (Expression a))] -> Expression a
+ Text.Ginger.AST: ObjectE :: a -> [(Expression a, Expression a)] -> Expression a
- Text.Ginger.AST: PreprocessedIncludeS :: a -> (Template a) -> Statement a
+ Text.Ginger.AST: PreprocessedIncludeS :: a -> Template a -> Statement a
- Text.Ginger.AST: ScopedS :: a -> (Statement a) -> Statement a
+ Text.Ginger.AST: ScopedS :: a -> Statement a -> Statement a
- Text.Ginger.AST: SetVarS :: a -> VarName -> (Expression a) -> Statement a
+ Text.Ginger.AST: SetVarS :: a -> VarName -> Expression a -> Statement a
- Text.Ginger.AST: SwitchS :: a -> (Expression a) -> [((Expression a), (Statement a))] -> (Statement a) -> Statement a
+ Text.Ginger.AST: SwitchS :: a -> Expression a -> [(Expression a, Statement a)] -> Statement a -> Statement a
- Text.Ginger.AST: TernaryE :: a -> (Expression a) -> (Expression a) -> (Expression a) -> Expression a
+ Text.Ginger.AST: TernaryE :: a -> Expression a -> Expression a -> Expression a -> Expression a
- Text.Ginger.AST: TryCatchS :: a -> (Statement a) -> [CatchBlock a] -> (Statement a) -> Statement a
+ Text.Ginger.AST: TryCatchS :: a -> Statement a -> [CatchBlock a] -> Statement a -> Statement a
- Text.Ginger.GVal: (~!) :: (FromGVal m v) => GVal m -> GVal m -> Maybe v
+ Text.Ginger.GVal: (~!) :: FromGVal m v => GVal m -> GVal m -> Maybe v
- Text.Ginger.Run.FuncUtils: binaryFunc :: forall m h p. (Monad m) => (GVal (Run p m h) -> GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
+ Text.Ginger.Run.FuncUtils: binaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
- Text.Ginger.Run.FuncUtils: ignoreArgNames :: ([a] -> b) -> ([(c, a)] -> b)
+ Text.Ginger.Run.FuncUtils: ignoreArgNames :: ([a] -> b) -> [(c, a)] -> b
- Text.Ginger.Run.FuncUtils: unaryFunc :: forall m h p. (Monad m) => (GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
+ Text.Ginger.Run.FuncUtils: unaryFunc :: forall m h p. Monad m => (GVal (Run p m h) -> GVal (Run p m h)) -> Function (Run p m h)
- Text.Ginger.Run.VM: withLocalScope :: (Monad m) => Run p m h a -> Run p m h a
+ Text.Ginger.Run.VM: withLocalScope :: Monad m => Run p m h a -> Run p m h a
- Text.PrintfA: T :: forall r. PrintfType r => r -> PrintfTypeT
+ Text.PrintfA: T :: (forall r. PrintfType r => r) -> PrintfTypeT

Files

ginger.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                ginger-version:             0.8.1.0+version:             0.8.2.0 synopsis:            An implementation of the Jinja2 template language in Haskell description:         Ginger is Jinja, minus the most blatant pythonisms. Wants                      to be feature complete, but isn't quite there yet.@@ -28,11 +28,12 @@                  , Text.Ginger.Optimizer                  , Text.Ginger.Parse                  , Text.Ginger.Run+                 , Text.Ginger.Run.Type+                 , Text.Ginger.Run.Builtins                  , Text.PrintfA                  , Text.Ginger.Run.VM                  , Text.Ginger.Run.FuncUtils-  other-modules: Text.Ginger.Run.Type-               , Text.Ginger.Run.Builtins+  -- other-modules:   -- other-extensions:   build-depends: base >=4.8 && <5                , aeson
src/Text/Ginger/Run.hs view
@@ -54,6 +54,11 @@ , hoistRun , hoistNewlines , hoistRunState+-- * Errors+, RuntimeError (..)+, runtimeErrorWhat+, runtimeErrorWhere+, runtimeErrorMessage ) where 
src/Text/Ginger/Run/Builtins.hs view
@@ -6,6 +6,11 @@ {-#LANGUAGE MultiParamTypeClasses #-} {-#LANGUAGE ScopedTypeVariables #-} {-#LANGUAGE LambdaCase #-}++-- | Implementations of the default template context functions and values. You+-- will not normally need to import this module, unless you want to provide+-- your own context with things that reuse functionality from the default+-- ones. module Text.Ginger.Run.Builtins where 
src/Text/Ginger/Run/Type.hs view
@@ -5,6 +5,12 @@ {-#LANGUAGE TypeSynonymInstances #-} {-#LANGUAGE MultiParamTypeClasses #-} {-#LANGUAGE ScopedTypeVariables #-}++-- | The internals of the 'Run' monad, and various things needed to make the+-- magic happen. You will not normally need to import this module;+-- 'Text.Ginger.Run' re-exports the things you probably want. However, if you+-- want to provide your own run monad that extends 'Run' somehow, this module+-- may be of use. module Text.Ginger.Run.Type ( GingerContext (..) , makeContext@@ -26,6 +32,8 @@ , RunState (..) , RuntimeError (..) , runtimeErrorWhat+, runtimeErrorWhere+, runtimeErrorMessage -- * The Newlines type -- | Required for handling indentation , Newlines (..)