update Template Haskell code to load foreign code for library archives
add missing genApp case for newtype constructors