-- | rewrite simple events like Birth / Death / Burial into typed tags
placerw :: ByteString                          -- ^ tag
        -> (Place -> Date -> Typed) -- ^ ctor
        -> Records 
        -> Maybe Records
placerw etag ctor (viewTV etag -> Just ( Null
                                       , ((viewTag2 "PLAC" "DATE") -> Just (ts, rs))
                                       )) = f <$> event
  where
    f = (\e -> Fix (TreeF (T e) rs))
    ((value -> place), (value -> date)) = ts
    event = ctor <$> place <*> date
placerw :: ByteString                          -- ^ tag
        -> (Place -> Date -> Typed) -- ^ ctor
        -> Records 
        -> Maybe Records
placerw etag ctor (viewTV etag -> Just ( Null
                                       , ((viewTag2 "PLAC" "DATE") -> Just (ts, rs))
                                       )) = f <$> event
  where
    f = (\e -> Fix (TreeF (T e) rs))
    ((value -> place), (value -> date)) = ts
    event = ctor <$> place <*> date
placerw etag ctor (viewTV etag -> Just ( Null
                                       , ((viewTag2 "PLAC" "DATE") -> Just (ts, rs))
                                       )) = f <$> event
  where
    f = (\e -> Fix (TreeF (T e) rs))
    ((value -> place), (value -> date)) = ts
    event = ctor <$> place <*> date