parsonsmatt/annotated-exception

Helper to auto-promote `SomeException -> AnnotatedException SomeException`

Opened this issue · 0 comments

foo :: SomeException -> AnnotatedException SomeException
foo se = 
  case fromException se of
    Just ann -> ann
    Nothing -> error "impossible"

This should be a safe utility to provide, since fromException for AnnotatedException will always either provide the true underlying AnnotatedException or promote to AnnotatedException [] original.