3 ms·
Functions are just containers of calculations (the whole “code is data”). I don’t know why lists as values in a container would be confusing. Lots of very popu
by hajile 2y ago
Functions are just containers of calculations (the whole “code is data”).
I don’t know why lists as values in a container would be confusing. Lots of very popular languages literally have box types which may not be exactly the same, but show that expecting containers to potentially commission complex data isn’t unusual.
- fn-mote 2y ago> I don’t know why lists as values in a container would be confusing. The GP makes it pretty clear - the misunderstanding is that there is one value in a container. A list has many.
- hajile 2y agoThat's like saying a dev would be confused that an Object can contain a list. I can't see that tripping up anyone but the most junior of developers.
- codebje 2y agoOne source for confusion around lists is that the list monad is often used to model non-determinism, rather than just "many things". If you're thinking about non-determinism, a list is akin to a container of one item when you don't precisely know which item it is, but do know it's one of zero or more candidates. The most widely recognised example, IMO, would be monadic parser combinators. "A parser for a thing, is a function from a string, to a list of pairs of strings and things."