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

I'd call a Future a threadsafe queue with one element going thru it IMO, it's just as much of a collection as Optional.


That's the beautiful thing about types which satisfy the Monad laws. Because both Future and Option (in Scala if not other languages) satisfy these laws, I think it perfectly valid to consider a Future to be collection type with a cardinality of 0 or 1 that also abstracts latency.


Yeah, but I can do that without category theory, it's just obvious. I still don't understand what 'monad' offers over 'flatMappable' besides the ability to use 'endofunctor' in the same sentence.


> I still don't understand what 'monad' offers over 'flatMappable'

Its several characters and syllables shorter, and doesn't appeal to an intuition which is distant from many of the productive uses of construct.




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

Search: