0.11.0
This release focused on bug fixes, although there are some new language features.
Language Features
Regular Expression Literal #250
Mint now supports regular expression literals:
Regexp.match("abbc", /ab+c/i) == true
Open Modules #265
Modules now can be defined in multiple places allowing to define constants and functions.
module Greeter {
fun greet (name : String) {
"Hello #{name}!"
}
}
module Greeter {
fun greetPolitely (name : String) {
"Have a nice day Mr. #{name}!"
}
}
This is mostly useful if you want to extend a module in the standard library (like Array
).
Or operator
Added the or
operator as an alias to Maybe.withDefault
:
Maybe.withDefault("Hello", Maybe::Just("Value")) /* "Value" */
Maybe.withDefault("Hello", Maybe::Nothing) /* "Hello" */
Maybe::Just("Value") or "Hello" /* "Value" */
Maybe::Nothing or "Hello" /* "Hello" */
[]
access on tuples
It is now possible to use []
on tuples:
{"Name", "Joe"}[0] == "Name"
Only literal numbers are valid since it's the only way we can only determine the type.
Formatter
- Format the type signature of the inline JavaScript if given.
- Format the type signature of an array literal if given.
Housekeeping
- Moved the CI from Travis to Github actions.
Standard Library
- #288 - Added API wrapper for
DataTransfer
and addeddataTransfer
to Html.Event. - Added return types to all functions @s0kil
- Added
Array.uniq
Minor changes / fixes
- Fixed compiling of calls when the expression is an anonymous function.
- Fixed compiling of referenced html elements.
- Compile empty HTML fragments as
nil
.
Fixed issues
- #249 #319 - Disallow referencing other entities from the same top level entity in the default value of a state or property.
- #277 - Added
clean
command to delete compiler and package artifacts @s0kil - #278 - Format code from STDIN if
--stdin
flag is passed @s0kil - #302 - Added error message for ambiguous pipe operators
- #305 - Allow parsing string literals in css definitions
- #317 - Throw error when record does not have a record definition @s0kil
- #320 - Set
manifest.json
as relative path when--relative
flag is set @s0kil - #326 - Refactor encoding to be explicit
- #327 - Confusing error when trying to add styles to custom components @matthewmcgarvey
- #330 - Make sure inlined variable names are not conflicting with generated ones
- #332 - Add the record type as the last parameter in record constructor functions
- #338 - Allow trailing comment in record definitions.
- #339 - Better error message for
NextCallStateTypeMismatch
@s0kil - #341 - Update documentation viewer to handle inferred types @s0kil
- #349 - Allow prefixing CSS classes using
mint.json