DFRP implementation in Haskell