Consolidated shared data types and utility functions into Demo2Shared.hs