Skip to content

Instantly share code, notes, and snippets.

@agocke
Created July 18, 2022 18:08
Show Gist options
  • Save agocke/1eeb2bd9d2a43a4464dd5aad53c61c1d to your computer and use it in GitHub Desktop.
Save agocke/1eeb2bd9d2a43a4464dd5aad53c61c1d to your computer and use it in GitHub Desktop.
interface IWebApplication<abstract TResult>
{
TResult MapGet(string route, Func<TResult, TResult> f);
}
class NotFound : IResult { }
class OK<TValue> : IResult { }
class MyWebApp : IWebApplication<IResult>
{
IResult MapGet(string route, Func<TResult, TResult f) => f(OK<int>(200));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment