From faa90283bfdd13740ebecd91c3f966591d183d79 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 13 Aug 2013 01:38:18 +0200 Subject: Explode when using mapContext over ListField --- src/Hakyll/Web/Template/Context.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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!" -------------------------------------------------------------------------------- -- cgit v1.2.3