Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why isn Kogut more functional?

Functional Kogut
0
Posted

Why isn Kogut more functional?

0

In a pure functional language like Haskell, functions are all referentially transparent. So if x == y, then f(x) == f(y). This may sound good at first, but it really causes a lot of problems. For example, say you want a function to generate random numbers. Typically, you would expect this to return a different result (usually) whenever it was called (with no arguments). But in Haskell, that would break referential transparency, so you send something to the function that is different every time, authorizing it to break this rule. All of the code dealing with the random number generator also needs to know what the new value of this is, so that it too can break referential transparency. In Haskell, this is encapsulated in the IO monad, but the problem still exists. Kogut does away with referential transparency at the expense of a few academic goals, but it gains much more.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123