pprintErr' i (ReflectionError parts orig) =
  let parts' = map (hsep . map showPart) parts in
  vsep parts' <>
  if (opt_origerr (idris_options i))
    then line <> line <> text "Original error:" <$> indented (pprintErr' i orig)
    else empty
  where showPart :: ErrorReportPart -> Doc OutputAnnotation
        showPart (TextPart str) = text str
        showPart (NamePart n)   = annName n
        showPart (TermPart tm)  = pprintTerm i (delab i tm)
        showPart (SubReport rs) = indented . hsep . map showPart $ rs
pprintErr' i (ReflectionError parts orig) =
  let parts' = map (hsep . map showPart) parts in
  vsep parts' <>
  if (opt_origerr (idris_options i))
    then line <> line <> text "Original error:" <$> indented (pprintErr' i orig)
    else empty
  where showPart :: ErrorReportPart -> Doc OutputAnnotation
        showPart (TextPart str) = text str
        showPart (NamePart n)   = annName n
        showPart (TermPart tm)  = pprintTerm i (delab i tm)
        showPart (SubReport rs) = indented . hsep . map showPart $ rs
pprintErr' i (ReflectionError parts orig) =
  let parts' = map (hsep . map showPart) parts in
  vsep parts' <>
  if (opt_origerr (idris_options i))
    then line <> line <> text "Original error:" <$> indented (pprintErr' i orig)
    else empty
  where showPart :: ErrorReportPart -> Doc OutputAnnotation
        showPart (TextPart str) = text str
        showPart (NamePart n)   = annName n
        showPart (TermPart tm)  = pprintTerm i (delab i tm)
        showPart (SubReport rs) = indented . hsep . map showPart $ rs