3 ms·
Your post as I read it is very hard to parse, but I don't think the article claimed that Typescript couldn't do it. Many modern languages can do Either or Maybe
by jerf 5y ago
Your post as I read it is very hard to parse, but I don't think the article claimed that Typescript couldn't do it. Many modern languages can do Either or Maybe types precisely because they copied it from Haskell in the first place. (Which is good. Copying is good.)
The dynamic scripting languages can do a "maybe" type because they can do just about anything when it comes to types; what they can't do is enforce correct usage by restrictions, so you write a Maybe type but you can't ever quite be sure it's doing what you think it's doing. This is just something you end up living with in dynamically typed langauges.
- fooyc 5y agoTypescript is a static type system though
- jerf 5y agoYes, the paragraph break was there for a reason.
- prionassembly 5y agoExpressivity and automatic enforcement are completely orthogonal. Some pseudocode in academic papers is sublimely expressive, but can't be typed directly on a computer.