/* @flow */ type $Function1 = (arg: A) => B; type _Function1Value> = B; type $Function1Value, A> = _Function1Value; var toString = (value) => String(value) var toNumber = (value) => parseFloat(value) || 0 type ToStringRetVal = $Function1Value type ToNumberRetVal = $Function1Value ;(toString: (val: any) => ToStringRetVal) declare var x: ToStringRetVal declare var y: ToNumberRetVal ;(x: string) ;(y: number) // Clearly, this is not the best use-case for this type. function fnValueReturner>(fn: F, v: V): $Function1Value { return fn(v) } ;(fnValueReturner(toString, 1234): string)