done the haskell way