Porting DReAM Plug class to Haskell