Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • "I would see the type of f2 as being union ( int->string, string->int )" This is where I started out, but it doesn't seem right to me. The issue I see with this is that semantically, this should mean that either f2 can contain a function int->string or a function string->int, but not both at the same time, which is what it actually is. I think this means it needs to have its own type constructor, perhaps product as suggested by @svick. The use of type variables is an interesting idea I hadn't thought of though. I suspect it will be more complex, but definitely worth considering. Commented Jun 8, 2016 at 19:41
  • Interesting. Perhaps f2 the conjunction of those signatures, rather than the disjunction of them? Commented Jun 8, 2016 at 20:17