3 ms·
Just to clarify, in Haskell: - [x,xs] is the list defined by exactly the element x followed by the element xs; - x:xs is the list defined by the element x fol
by tiziano88 12y ago
Just to clarify, in Haskell:
- [x,xs] is the list defined by exactly the element x followed by the element xs;
- x:xs is the list defined by the element x followed by the list xs.
- ky3 12y agoAnd to add to this, the unspoken Hungarian notation rules have xs typed as a list. So the 1st instance: [x,xs] looks unprofessional and n00b-ish. It's the 2nd instance that's idiomatic.