Created
January 12, 2013 18:23
-
-
Save mdekstrand/4519754 to your computer and use it in GitHub Desktop.
Processing code for path-dependent types post.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch[T](req: WebRequest[T]): Result[T] | |
def process(need: Need) { | |
val req = need.request | |
val res = fetch(req) | |
// now we save the data | |
res match { | |
case Good(data) => need.save(store, data) | |
/* error cases */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment