diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-08-13 01:38:18 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-08-13 01:38:18 +0200 |
commit | faa90283bfdd13740ebecd91c3f966591d183d79 (patch) | |
tree | ed290afc2d74f4c05223d729a15024ac9d2c6f2b /src/Hakyll/Web/Template | |
parent | 0b111066b0903812125cd55ca1bbabda4d09d445 (diff) | |
download | hakyll-faa90283bfdd13740ebecd91c3f966591d183d79.tar.gz |
Explode when using mapContext over ListField
Diffstat (limited to 'src/Hakyll/Web/Template')
-rw-r--r-- | src/Hakyll/Web/Template/Context.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Template/Context.hs b/src/Hakyll/Web/Template/Context.hs index 428e105..98662dd 100644 --- a/src/Hakyll/Web/Template/Context.hs +++ b/src/Hakyll/Web/Template/Context.hs @@ -100,9 +100,11 @@ functionField name value = Context $ \k i -> case words k of mapContext :: (String -> String) -> Context a -> Context a mapContext f (Context c) = Context $ \k i -> do fld <- c k i - return $ case fld of - StringField str -> StringField (f str) - ListField ctx is -> ListField ctx is + case fld of + StringField str -> return $ StringField (f str) + ListField _ _ -> fail $ + "Hakyll.Web.Template.Context.mapContext: " ++ + "can't map over a ListField!" -------------------------------------------------------------------------------- |