Typecase regular Swift function to Curry Function
问题 I am trying to convert a regular function into curry function but getting Execution was interrupted Below is the code where I am currying a function and doing an unsafeBitCast to call a function with one parameter and call it later with the second parameter. func curry<T>(f: (T, T) -> T) -> T -> T -> T { return { a in typealias Function = (T) -> (T -> T) let fn = unsafeBitCast(f, Function.self) return curry(fn(a)) } } func curry<T>(f: T -> T) -> T -> T { return { f($0) } // Throws Runtime