
21 May
2008
21 May
'08
11:31 a.m.
Dmitri O.Kondratiev wrote:
Jules,
Stupid question, please bear with me:
x :: Int -- x declared, but not constructed x = 1 -- x constructed
s1 :: State StdGen a -- s1 declared, yes, but why s1 is *also already constructed* ?
it's not. it's constructed when you do s1 = return 1 ... or ... s1 = get >>= put .. or some other more complex interaction, perhaps using do notation. It's the >>= or the return that construct the State, just as the '1' is enough to construct the Int. Jules