Port of johntyree/rio to Haskell