Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like your approach. However, I don't think that this:

- List<T> is a functor because it "contains" T's. List<int> "contains" ints.

Is really correct. I believe a `Container<T>` becomes a functor only if it also 'has' (can have?) a function that can take a function and apply it to all values in the 'container'. So, a 'map' of some sort.

I mean, I see your explanation of 'map' later on. It's also probably true that in real world software engineering contexts any 'container type' of that kind would also be one that either has or can naturally have a `map'. It's just that if someone willing to understand this read your comment and went: "Aha! Some container thing is a functor because it contains things!" I think they'd gain incorrect understanding.

Not that I'm an FP guru, so..



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: