It might look a bit confusing at times tho. Some examples: let data: MyStruct = fs:: read_to_string(p)?@?; let data: MyStruct = fs:: read_to_string(p)?#?; let data: MyStruct = fs:: read_to_string(p)?%?;
With type ascription this might look even more, err, interesting: let data = fs:: read_to_string(p)?@? : MyStruct; let data = fs:: read_to_string(p)?#? : MyStruct; let data = fs:: read_to_string(p)?%? : MyStruct;
-
-
Show this thread
-
Ohh, actually maybe this could be part of type ascription itself? let data = fs::read_to_string(p)? : MyStruct?; Ascribed as a fallible conversion!
Show this thread -
Okay, yeah I like this a lot actually. I think that if you know `?` is for attempting stuff, and ` : ` is for annotating types, then this looks reasonably intuitive!
Show this thread -
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.