What are the most interesting equivalences arising from the Curry-Howard Isomorphism?

Since you explicitly asked for the most interesting and obscure ones: You can extend C-H to many interesting logics and formulations of logics to obtain a really wide variety of correspondences. Here I’ve tried to focus on some of the more interesting ones rather than on the obscure, plus a couple of fundamental ones that … Read more

What is the difference between eq?, eqv?, equal?, and = in Scheme?

I’ll answer this question incrementally. Let’s start with the = equivalence predicate. The = predicate is used to check whether two numbers are equal. If you supply it anything else but a number then it will raise an error: (= 2 3) => #f (= 2.5 2.5) => #t (= ‘() ‘()) => error The … Read more

In pure functional languages, is there an algorithm to get the inverse function?

In some cases, yes! There’s a beautiful paper called Bidirectionalization for Free! which discusses a few cases — when your function is sufficiently polymorphic — where it is possible, completely automatically to derive an inverse function. (It also discusses what makes the problem hard when the functions are not polymorphic.) What you get out in … Read more

Set operations (union, intersection) on Swift array?

Yes, Swift has the Set class. let array1 = [“a”, “b”, “c”] let array2 = [“a”, “b”, “d”] let set1:Set<String> = Set(array1) let set2:Set<String> = Set(array2) Swift 3.0+ can do operations on sets as: firstSet.union(secondSet)// Union of two sets firstSet.intersection(secondSet)// Intersection of two sets firstSet.symmetricDifference(secondSet)// exclusiveOr Swift 2.0 can calculate on array arguments: set1.union(array2) // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)