mkehrt
Joined 13 years ago
Joined 13 years ago
When people who don't know much about them think of dependent types, they are probably thinking of functions, which can take a value on the left hand side to be used in the type on the right. Confusingly, these are normally called "dependent products" in the type theory. However since this is confusing and they are generally written with a capital Pi, they are often just referred to as "Pis". For example
Pi x:nat . Vec x string
is a function that takes a nat (non-negative number) and returns a Vector whose length is that nat and which is encoded in the type.On the other hand, you are talking about pairs (confusingly: "dependent sums", here "sum" being something like a union/enum in type theory), often called "Sigmas". These are pairs (2-tuples) of values in which the type of the second value depends on the value of the first. So, your example, a pair where the vector length is held in the first element and the vector itself in the second. In this contrived example, Vector may not know its own length at runtime, so we need to package them up together.
Sigma x: nat . Vec x string
These are both "dependent types", but people who are only passingly familiar with them might mostly know about the first.(Why are functions "dependent products" and pairs "dependent sums"? I've never understood this but I've heard hand-wavy explanations that infintitary products are functions and infinitary sums are products ¯\(ツ)/¯)
When I was a grad student studying this stuff (~20 years ago), we used "parallelism" to mean running on different cores at the same time and "concurrency" to mean preemptive multithreading on a single processor.
This is what reduce does, though? It reduces a list to a single thing. It seems like you're thinking of filter.
stty -ixon
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'