Explode when using mapContext over ListField

This commit is contained in:
Jasper Van der Jeugt 2013-08-13 01:38:18 +02:00
parent 0b111066b0
commit faa90283bf

View file

@ -100,9 +100,11 @@ functionField name value = Context $ \k i -> case words k of
mapContext :: (String -> String) -> Context a -> Context a mapContext :: (String -> String) -> Context a -> Context a
mapContext f (Context c) = Context $ \k i -> do mapContext f (Context c) = Context $ \k i -> do
fld <- c k i fld <- c k i
return $ case fld of case fld of
StringField str -> StringField (f str) StringField str -> return $ StringField (f str)
ListField ctx is -> ListField ctx is ListField _ _ -> fail $
"Hakyll.Web.Template.Context.mapContext: " ++
"can't map over a ListField!"
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------