Only static and very basic dynamic websites can be modeled that way. Most dynamic websites handle requests which are intended to have an effect (POST, PUT), which requires your function to be impure or to model state changes (DB updates, file I/O, etc.) in some way like Haskell's monads. And what that looks like is going to be much, much different from anything developers are used to in impure languages.