User loginNavigation 
How to name the inverse functions of constructorsI am working on the design of a language (Albatross) which allows for static verification. It has a strong functional core. One of the most important types in a functional language is the inductive or algebraic type. One of the most prominent examples is a list. E.g. a list type in Albatross is declared as follows.
It has the constructor From a nonempty list we can extract the head and the tail with the following functions.
The functions The most immediate ideas are _desctructors_ or _unconstructors_ which I don't find very appealing. A better name might be _inverse constructors_ which seem to precisely describe what they are, but sound a little bit clumsy. Does anyone have a good idea on how to name these animals? Some background information on why I need these type of functions: Algebraic data types are a great tool, but they are not always the appropriate tool. E.g. in order to describe natural numbers their implementation is straighforward but awfully inefficient (this is one of the big problems when you want to extract source code from Coq). There are two ways to describe natural numbers with an efficient implementation. Either as machine numbers with modulo arithmetic or as arbitrary sized numbers where the components are machine numbers. Machine numbers are not objects of algebraic type. But they are similar. The have constructors (zero and successor) and an induction law. Furthermore they have discriminator functions ( As soon as a type has an induction law (which implicitely defines the constructor functions), discriminator functions and inverse constructors the compiler can treat these types like inductive types in order to define recursive functions (which are guaranteed to terminate), do pattern matching etc. The discriminator functions and inverse constructors are necessary for the compiler in order to be able to compile pattern matching expressions into executable code. In my opinion these pseudo algebraic/inductive types will be a great tool. Therefore I need good notions and names to express properties well. Thanks for any help. By hbrandl at 20161106 23:46  LtU Forum  previous forum topic  next forum topic  other blogs  4814 reads

Browse archivesActive forum topics 
Recent comments
35 min 34 sec ago
10 hours 42 min ago
13 hours 5 min ago
15 hours 45 min ago
18 hours 41 min ago
21 hours 44 min ago
1 day 8 hours ago
2 days 1 hour ago
2 days 1 hour ago
2 days 8 hours ago