Closed stereobooster closed 3 years ago
I don't like focusing on the Monad interface when describing types. You don't say The Array Monad, The Promise Traversable, the Task Applicative. Emphasizing monad just makes the concepts seem scarier.
Sorry for the rant
On Tue, Nov 22, 2016, 8:06 AM stereobooster notifications@github.com wrote:
If we explain Option as union type it would make sense to state that:
- Some higher order type e.g. type that can wrap other type
- None is unit type whose only value is None
Option = Some
| None But given JS code has nothing to do with types, it is rather explains Option as monad (Maybe https://wiki.haskell.org/Maybe monad in Haskell classification).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hemanth/functional-programming-jargon/issues/125, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-4JM0N3oA8quJWwQLmLbH9DS5iJLwks5rAxLngaJpZM4K5nX1 .
I'm not a fan of monads myself, but the code example is about monads and not types (that is my point). Offtopic. Just in case it wasn't clear or something wrong with my wording: I'm not criticising this work, just trying to make it better.
No, I get you. I was just having an argument with myself. I think I put option in the document to give a more useful example of chain/bind since array doesn't really illuminate what it's good for
On Tue, Nov 22, 2016, 11:08 PM stereobooster notifications@github.com wrote:
I'm not a fan of monads myself, but the code example is about monads and not types (that is my point). Offtopic. Just in case it wasn't clear or something wrong with my wording: I'm not criticising this work, just trying to make it better.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/hemanth/functional-programming-jargon/issues/125#issuecomment-262446235, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-4MIaRJ9FwTNDb4wGHgl3b0-CRAjQks5rA-ZSgaJpZM4K5nX1 .
If we explain
Option
as union type it would make sense to state that:Some
higher order type e.g. type that can wrap other typeNone
is unit type whose only value isNone
But given JS code has nothing to do with types, it is rather explains
Option
as monad (Maybe monad in Haskell classification).