I have an application that uses a (generic) service to perform IO actions. I want to aggregate the usual IO functions (Save, SaveAs, etc.) into an F# type but the compiler seems to dislike this notation:
type InputService<'a> = { // Fine SomeFunc : 'a -> Option<'a> // Error (VS2012): "Anonymous type variables are not permitted in this declaration" Save : 'a -> () // Error (see above) Load : () -> 'a } I'm aware that stateful functions like this may not be idiomatic. In reality, I plan on currying in UI prompts, file paths, etc but is it possible to define that function signature in my type?