I have this statement:
newtype State st a = State (st -> (st, a))
Hence the type of State is:
State :: (st -> (st, a)) -> State st a
I cannot understand the meaning:
- Are
standajust placeholder of two data-type? Right? - Does the statement means that State is a function that take as argument a function?
Yes and yes. The
stis the state type and theais the answer type.