consider an ordinary state monad that we've seen 1000 times: newtype StateTrans s a = ST( s -> (s, a) ) instance Monad (StateTrans s) where (ST p) >>= k = ST( \s0 -> let (s1, a) = p s0 (ST q) = k a in q s1 ) return a = ST( \s -> (s, a) ) now Haskell is an applicative language in which every expression has a value. the value of the expression return 3 is unprintable. it is a newtype whose representation is a function. I need a term for the 3. that is, I need a name for the variable a above. unless someone suggests a better name or knows of a name already in the literature, I'm going to call 3 the "oblique value" of the expression return 3.
hi, Richard Uhtenwoldt wrote:
... now Haskell is an applicative language in which every expression has a value. the value of the expression
return 3
is unprintable. it is a newtype whose representation is a function. i sometimes call values of "monadic type" computations. so i would say that a value of type "StateTrans s a" is a computation which will produce a result of type a, but it may also depend on, and modify the state (of type s).
so in "return 3" i would say that 3 is the result of the computation. bye iavor -- ================================================== | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki | ==================================================
participants (2)
-
Iavor S. Diatchki -
Richard Uhtenwoldt