4 ms·
They're call isomorphic functions. Recently, I've been thinking a lot about them and also have been looking for a language/framework that supports them. What w
by miguelrochefort 9y ago
They're call isomorphic functions.
Recently, I've been thinking a lot about them and also have been looking for a language/framework that supports them. What would be very interesting is a way to inverse non-isomorphic functions and get a constrained set of possible values (i.e., the reverse of age(birth, now) would return a range of date for either birth or now). Often, the complete value is not necessary and you're only interested in some subset of it (i.e., that a person's age is greater than 18).
- zmonx 9y agoIt is true: An isomorphic function admits an inverse function. However, what you are describing in the second paragraph is a generalization of functions: You are now reasoning in terms of relations, where a single entity can be related to one or more others. Hence, a programming language that reasons in terms of relations (not functions) seems very appropriate for your use case. Logic programming is a such a natural generalization of functional programming. For example, if you want to reason flexibly over dates and times, check out Prolog and its finite domain constraints. Michael Hendricks has implemented a great library for this, called library(julian): http://mndrix.github.io/julian/ http://mndrix.github.io/julian/ This library lets you reason in terms of ranges and other constraints to describe general relations between dates and times.