do! keyword
-
Friday, June 08, 2012 5:54 AM
Quick question, what is the difference between do and do! in F#. I understand let and let! but can't find any resources on do!
Cheers.
All Replies
-
Friday, June 08, 2012 6:18 AM
Just as do is the unit-valued equivalent of let, do! is the unit-valued equivalent of let!
let! pat = expr in cexpr // desugars to b.Bind(expr,(fun pat -> «cexpr»))
do! expr in cexpr // desugars to b.Bind(expr,(fun () -> «cexpr»))
-
Friday, June 08, 2012 12:17 PM
You could also take a look at language specification (sec. 6.3.10 Computation Expressions):
http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc321997063Petr
-
Friday, July 27, 2012 1:34 PM
I found this old blog post very useful:
http://blogs.msdn.com/b/dsyme/archive/2007/09/22/some-details-on-f-computation-expressions-aka-monadic-or-workflow-syntax.aspx
Then, the "Interface" is described in: http://msdn.microsoft.com/en-us/library/dd233182.aspx

