3 ms·
[] is a list, yes (not a pair). I explicitly mentioned it as an example of a monad which is an algebraic data type. Then I also mentioned (->) which isn't. Why
by Peaker 13y ago
[] is a list, yes (not a pair). I explicitly mentioned it as an example of a monad which is an algebraic data type. Then I also mentioned (->) which isn't.
Why does the fact that pure code can be executed in all those ways relate to the object files? Same object file can have code of both kinds, and different pieces of code within it can run in different ways/threads/etc.
- deleted 13y ago[deleted]
- dschiptsov 13y agoa List is a generalization of a Pair - it could be empty, while a Pair cannot (logically). Apart from that, a Non-empty List could be viewed as a self-referential (recursive) Pair or a chain of Pairs. So, technically, List is the same ADT as Pair (cond/car/cdr) plus explicit null? and list? functions. Yes, they could, but it is more reasonable to split the code, so you could dlload or statically link the pure code independently from unsafe code.
- Peaker 13y agoA list is not a "generalization" of a pair. If anything that used something else was a "generalization" of that other thing, things would get confusing. Why is it more reasonable to split the code? You get the safety from the type-system, so you don't need extra splitting in obj files. Such splitting would complicate matters, and have no extra gain.
- dschiptsov 13y agoA list is not a "generalization" of a pair. - a lot of good people think otherwise: http://www.youtube.com/watch?v=QV0A_hFPCnw http://www.youtube.com/watch?v=QV0A_hFPCnw
- Peaker 13y agoAgain, please mention a specific quote and time... Or do you expect me to invest 50 minutes finding that quote in there?