Explode when using mapContext over ListField
This commit is contained in:
parent
0b111066b0
commit
faa90283bf
1 changed files with 5 additions and 3 deletions
|
@ -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!"
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue