Short answer for now: put "return" (or "return!", either works) in front of "raise" in the async case and it will compile. (I am unclear if this is a bug.)

By on 12/17/2009 1:58 PM ()

Ok, yeah. The language behaves like this:

1
2
3
4
5
6
7
8
9
10
 

// returns Async<unit>
let F() =
    async { failwith "boom" }

// returns Async<'a>
let G() =
    async { return failwith "boom" }

Basically in order for an always-raises-an-expression value to get generalized in a computation, you need to add a "return", otherwise you always get the "unit" type inferred.

By on 12/17/2009 2:09 PM ()

Works great. Thank you!

By on 12/17/2009 6:04 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper