Make it possible to evaluate monadic actions when assigning record fields

Isaac Dupree isaacdupree at charter.net
Tue Jul 10 12:12:03 EDT 2007


Adde wrote:
>  tmp <- foo
>  return Bar {
>    barFoo = tmp
>  }

There is a feature being worked on in GHC HEAD that would let you do

  do
   tmp <- foo
   return Bar{..}

which captures fields from everything of the same name that's in scope. 
  I think this would also satisfy your desire.

(also, the liftM approach doesn't let you choose the order of the 
monadic actions.)

Isaac


More information about the Haskell-prime mailing list