Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created November 9, 2011 19:43
Show Gist options
  • Save joshcough/1352695 to your computer and use it in GitHub Desktop.
Save joshcough/1352695 to your computer and use it in GitHub Desktop.
let forceFormat<'a>(a:'a) = match box a with
| :? Format as f -> f
| bad -> failwith ("not a format: " + bad.ToString())
type P2<'a, 'b>(a:'a, b:'b) =
interface Format with member f.Translate l =
l.TypeApplication("P2", [forceFormat(a).Translate l; forceFormat(b).Translate l])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment