Naming conventions for newtype deconstructors (destructors?)
- by Petr Pudlák
Looking into Haskell's standard library we can see:
newtype StateT s m a = StateT { runStateT :: s -> m (a, s) }
newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }
newtype Sum a = Sum { getSum :: a }
Apparently, there (at least) 3 different prefixes used to unwrap a value inside a newtype: un-, run- and get-. (Moreover run- and get- capitalizes the next letter while un- doesn't.) This seems confusing.
Are there any reasons for that, or is that just a historical thing?
If I design my own newtype, what prefix should I use and why?