You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Maybe and Either types currently fill in the blanks on this sort of Typescript-style type system, but Alan's parser could have a simple syntactic sugar of int64? => Maybe<int64> and int64 | float64 => Either<int64, float64>
This would also necessitate parens in the type definition so you can do int64 | float64? => Either<int64, Maybe<float64>> vs (int64 | float64)? => Maybe<Either<int64, float64>>
Similarly, Array<int64> could be written as int64[], and there are probably other shorthand notations we could produce for many of the other built-in generic types. (Eg, HashMap<string, bool> as simply {string: bool}?)
Certainly a lower priority, and not sure if the dual syntaxes for types will make the language more difficult (certainly less regular) but it could make it easier for Typescript, StandardML, etc users to adjust, and definitely makes the types more compact so more complex types can be more easily described.
The text was updated successfully, but these errors were encountered:
The
Maybe
andEither
types currently fill in the blanks on this sort of Typescript-style type system, but Alan's parser could have a simple syntactic sugar ofint64? => Maybe<int64>
andint64 | float64 => Either<int64, float64>
This would also necessitate parens in the type definition so you can do
int64 | float64? => Either<int64, Maybe<float64>>
vs(int64 | float64)? => Maybe<Either<int64, float64>>
Similarly,
Array<int64>
could be written asint64[]
, and there are probably other shorthand notations we could produce for many of the other built-in generic types. (Eg,HashMap<string, bool>
as simply{string: bool}
?)Certainly a lower priority, and not sure if the dual syntaxes for types will make the language more difficult (certainly less regular) but it could make it easier for Typescript, StandardML, etc users to adjust, and definitely makes the types more compact so more complex types can be more easily described.
The text was updated successfully, but these errors were encountered: