- The
setmodule gains theis_subset,is_disjoint, andsymmetric_differencefunctions - The
sortfunction of thelistmodule has been optimised in case it's working on an already sorted list. - The
dictmodule gains theeachfunction. - The
listmodule gains thewrapfunction. - The
iteratormodule gains thefind_mapfunction. - Fixed
string.inspectnot formatting the\fform feed control character correctly on Erlang. dynamic.unsafe_coercefunction has been deprecated.- Fixed
bit_arrayslices of slices sometimes being incorrect on JavaScript. - The
dictmodule gains thecombinefunction. - The deprecated
list.at,bool.max, andbool.minfunctions has been removed.
- The
ordermodule gains thebreak_tieandlazy_break_tiefunctions. list.athas been deprecated as it was misleading and would be commonly misused, resulting in poor code.list.LengthMismatchhas been removed.- The mistakenly public
bit_array.do_inspectfunction has been removed. - Fixed the
dynamic.classificationfunction for bools. - The
minfunction in theboolmodule has been deprecated in favour ofbool.and. - The
maxfunction in theboolmodule has been deprecated in favour ofbool.or. - Fixed a bug with
regex.splitwhere it could includeNilelements in the returned list of strings on the JavaScript target when the expression to split with included an optional match group which wasn't matched.
- Fixed a bug where on JavaScript the
dynamic.fieldfunction could crash when givennull. - The
composeandconstantfunctions in thefunctionmodule have been deprecated in favour of thefnliteral syntax.
- Fixed a warning on the JavaScript target.
- The
bit_arraymodule gains theinspectfunction. - The base 64 encoding and decoding functions in the
bit_arraymodule no longer insert newlines in the output on JavaScript, making them consistent with the Erlang target. - The
setmodule gains thedifferencefunction. - The deprecated
bit_string,bit_builder,base, andmapmodules have been removed. - The deprecated
map, andbit_stringfunctions in thedynamicmodule have been removed.
- The
int.randomfunction now takes a single argument. - The
float.randomfunction no longer takes any arguments. - Changed
list.index_mapcallback signature tofn(a, Int) -> bfromfn(Int, a) -> b, to be consistent withlist.index_fold. - Changed
iterator.indexto returnIterator(#(a, Int))instead ofIterator(#(Int, a)).
- Fixed
string.to_graphemesfailing on JavaScript runtimes when theIntl.Segmenterclass is not available.
- The
boolmodule gains thelazy_guardfunction. - The
gleam/mapmodule has been deprecated in favour of thegleam/dictmodule. - The
mapfunction in thegleam/dynamicmodule has been deprecated in favour of thedictfunction.
- The printing of maps by
string.inspecthas been improved.
- The
set.filterlabelforwas renamed tokeeping. - The
map.filterlabelforwas renamed tokeeping. - The
iterator.filterlabelforwas renamed tokeeping. - The
list.filterlabelforwas renamed tokeeping. - Updated for Gleam v0.32.0 syntax.
- The
basemodule has been deprecated in favour of the newbit_arraymodule. - The
bit_stringmodule has been deprecated in favour of the newbit_arraymodule. - The
bit_buildermodule has been deprecated in favour of the newbytes_buildermodule. - The
bit_arraymodule also contains thebase16_encodeandbase16_decodefunctions. - Improved performance of
string.to_graphemeson JavaScript. - The
iteratormodule gains themap2function. - The
listmodule gains thekey_filterfunction. - Fixed a bug on target JavaScript where
Mapequality would not be correctly checked for maps of different sizes. - Fixed a bug where non-byte aligned bit arrays would be printed suboptimally by
string.inspect.
list.flattenis no longer deprecated and is kept as a synonym oflist.concat- The
iteratormodule gains theconcatfunction. - The
intmodule gains thebitwise_and,bitwise_or,bitwise_exclusive_or,bitwise_not,bitwise_shift_left, andbitwise_shift_rightfunctions.
- Fixed a bug where
base.decode64could crash on the Erlang target.
- Updated to Gleam v0.30.0 syntax.
- Atoms are now shown using
atom.create_from_stringwhen passed tostring.inspect. - Fixed a bug where
string.inspectwould show atoms as Gleam custom types even when the format is invalid. - The
iteratormodule gains theyieldfunction.
- The
listmodule gains thelist.map2function. reversehas been renamed tonegatein theordermodule.- A new
reversefunction is added to theordermodule, which reverses an ordering function. flattenhas been renamed toconcatin thelistmodule. The old name is still available as an alias and is deprecated.
- improve
string.joinandstring.concatperformance on JavaScript target. - The
resultmodule gains thetry_recoverfunction. - The
stringmodule gains thebyte_sizefunction.
- Fixed a bug on target JavaScript where
regex.checkwould not correctly execute while using the same regular expression in consecutive calls. - The
zipfunction's second argument in thelistmodule gains thewithlabel. - The
strict_zipfunction's second argument in thelistmodule gains thewithlabel. - The
pairmodule gains thenewfunction.
- The
resultmodule gains thepartitionfunction. dynamic.tupleNfunctions now support lists.
- Fixed a bug where
dynamic.mapwould crash when passed the JavaScript values ofnullorundefined. - Fixed a bug where
io.debugwould crash when called in a React Native environment.
- The
iteratormodule gains theeachfunction. - Fixed a bug in maps when running on JavaScript where value membership could be incorrectly stated in some cases.
result.thenis now an alias ofresult.try; both do the same.- The
listmodule gains thetry_eachfunction. - The
dynamicmodule gains theoptional_fieldfunction.
regex.scannow behaves consistently across both targets when a capture group does not capture anything.- The
Maptype was rewritten as a persistent immutable data structure. This results in drastically improved performance when constructing or updating maps, especially with large maps. - The
allandanyfunctions in theiteratormodule are now tail recursive.
- The
boolmodule gains theguardfunction. - Fixed a bug where
io.print,io.print_error, andio.print_debugwould useconsole.logand add"\n"to the output when running on Deno. - Fixed a bug where
int.floor_dividewould return the wrong result in certain edge-cases. - The
iteratormodule gains thelengthfunction.
- The
prependfunction in thelistmodule gains thethislabel. - The
listmodule gains thegroupfunction. - The
dynamicmodule is able to decode simple JavaScript objects to maps. So, the behaviour of thefieldandobjectfunctions are consistent. - For a given empty list as an argument,
int.productnow returns1instead of0, andfloat.productnow returns1.0instead of0.0. This mimics the behavior of Elixir'sEnum.product/1.
- The
dynamicmodule gains thedecode1function. - The
floatmodule gains theloosely_equalsfunction. - The
iomodule gainsprint_errorandprintln_errorfunctions for printing to stderr. - The
setmodule gains thedropfunction. - The
io.debugfunction now prints to stderr instead of stdout when using the Erlang target or running in Node.js (but still usesconsole.logwhen running as JavaScript in a browser) - The
iteratormodule gains thetransformfunction. - The
list.atfunction now returnsError(Nil)if given index is smaller than zero, instead of returning the first element. - Fixed a bug where some string functions would incorrectly handle newlines when
iterating over graphemes in older JavaScript environments that do not have the
Intl.Segmenterclass. - The
stringmodule gainsto_utf_codepoints,from_utf_codepoints, andutf_codepoint_to_intfunctions. - Fixed
string.inspect's escaping of",\,\n,\r,\r\n, and\t, which in turn fixesio.debug's output of such strings. - The
bit_stringfunction in thedynamicmodule now knows how to handle JavaScriptUint8Arrays.
- The
boolmodule gains theandandorfunctions. - The
floatmodule gains theadd,subtractandmultiplyfunctions. - The
intmodule gains theadd,subtractandmultiplyfunctions. - Fixed a bug where
list.permutationswould not correctly permutate lists with non-unique item values. - For
regexp.compileunicode character properties are now used when resolving\B,\b,\D,\d,\S,\s,\W, and\won target Erlang. list.sortis now tail recursive and will no longer exceed the stack size on large inputs on target JavaScript.list.sortis now a "stable" sort, meaning elements which are equal in regards to the given comparison function will keep their previous order.- Added functions
function.apply1throughfunction.apply3which help working with functions in pipelines. - Fixed a bug where
regex.scanwould not work correctly on utf8. - The performance of
list.flattenhas been greatly improved. - The
string_buildermodule gains thejoinfunction. - The
listmodule gains theshufflefunction. string.splitwill now return a list of graphemes if split on an empty string ("").
string.sliceis now tail recursive and will no longer exceed the stack size on large inputs on target JavaScript.- Added
int.remainderandint.modulofunctions which allow safe remainder and modulo operations the way common languages support them. - Added
int.floor_divideto complement the truncatedint.divide.
- Fixed
string.inspectandio.debugcrashing on improper Erlang lists (#333).
- Removed a duplicate import.
- The list dynamic decoding functions can now decode JavaScript arrays into Gleam lists.
list.rangeis now tail recursive and will not blow the stack with large ranges when compiled to JavaScript.- Fixed a bug where the
listmodule'scontains,any, andallcould exhaust the stack when compiling to JavaScript. list.rangeanditerator.rangereturn values are now inclusive of both start and end bounds.
- Fixed a bug where
big_string.concatcould crash. - The
bit_buildermodule gains thefrom_bit_stringsfunction. - Changed
list.contains,list.any,list.allso that Gleam can do tail call optimization which fixes stack size crashes on Firefox, Chrome and NodeJS (#322).
- The
floatmodule gains thedividefunction. - The
intmodule gains thedivide,power, andsquare_rootfunctions. - The
stringmodule gains thefirst,last,capitaliseandinspectfunctions. - Fixed a bug where
string_builder.reversewould break utf8 strings on target JavaScript. - Fixed a bug where
string.reversewould break utf8 strings on target JavaScript. - Fixed a bug where
string.slicewould break utf8 strings on target JavaScript. - The
string_buildermodule loses thefrom_floatfunction. Usefloat.to_stringinstead. - Fixed the
int.powerandfloat.powerfunctions by properly handling error cases. - The grapheme iterator used by
string.graphemesis now locale independent on target JavaScript. - Unified
io.debugto yield Gleam syntax to standard output (stdout) not just on JavaScript but also Erlang.
- Fixed a bug where record-based map keys would clash in JavaScript.
- The
eunitErlang headers are no longer required to compile this package. - Fixed a bug where the
string.lengthfunction would cause a JavaScript error for empty strings on older JavaScript runtimes. - The
boolmodule gains theto_stringfunction. - The
functionmodule gains thetapfunction. - The
floatmodule gains therandomfunction. - The
intmodule gains therandomfunction. - The JavaScript target implementation of the
string.replacereceived a bug fix. - The
listmodule gains aprependfunction (#284).
- The
dynamicmodule gains thedecode9function. - The
floatmodule gains theloosely_comparefunction. - The
string_buildermodule gains thenewfunction. - The
bit_buildermodule gains thenewfunction. - The
resultmodule gains thereplace,unwrap_bothandunwrap_errorfunctions.
- Fixed a bug where
io.printandio.printlnmay print unicode characters incorrectly. - Fixed a bug where the
dynamic.fieldfunction would return an incorrect error value.
- The
dynamic.dynamicfunction is is no longer a thunk.
- The
dynamic.dynamicfunction now returns a result. - The
dynamic.mapfunction is now curried and requires the decoders for keys and values to be supplied. - The
dynamic.result,dynamic.optional,dynamic.field, anddynamic.listfunctions are now partially applied.
- The
dynamicmodule gains thedynamicfunction. - The shallow
dynamic.listfunction has been renamed todynamic.shallow_list. - The shallow
result, andtuple*functions have been removed from thedynamicmodule. - The
dynamic.typed_listfunction has been renamed todynamic.list. - The
dynamic.typed_resultfunction has been renamed todynamic.result. - The
dynamic.anyis now available on JavaScript. - The
dynamic.typed_tuple*functions have been renamed todynamic.tuple*. - The
dynamic.fieldanddynamic.elementfunctions now requires the type of the field to be specified. - The
dynamic.DecodeErrornow has apathfield. - The decoder functions of the
dynamicmodule now return multiple errors. - The
dynamic.any,dynamic.elementanddynamic.tuple*functions are now partially applied. - The
dynamicmodule gains thedecode2,decode3,decode4,decode5,decode6,decode7, anddecode8functions. - The
intmodule gains thedigitsandundigitsfunctions. - The
optionmodule gains thelazy_orandlazy_unwrapfunctions.
- The
functionmodule gains theconstantfunction. - The internal
gleam_stdlib.jsmodule has been renamed togleam_stdlib.mjs.
- Converted to use the Gleam build tool, not rebar3.
- The
iteratormodule gains thefirstandatfunctions. - The
listmodule renames theheadandtailfunctions tofirstandrest. - The
list.atfunction now behaves uniformly toiterator.at. int.to_base_stringnow returns aResult(Int, InvalidBase).- The
intmodule gains theto_base2,to_base8,to_base16andto_base36functions.
uri.parsenow returns a result.
- All modules have been updated to work on JavaScript as well as Erlang.
- The
bit_stringmodule gains theconcatfunction and has thepartfunction renamed toslice. - The
osmodule has been removed in favour of target specific libraries. - The
rescuefunction has been removed from thefunctionlibrary in favour of target specific versions in Erlang and JavaScript specific libraries. - The
map.updatefunction now usesOptionrather thanResult. - The
iteratormodule gains thefold_untilandtry_foldfunctions. - The
bit_stringmodule loses the u32 functions in favour of bit string literals. - The
dynamicmodule loses theatomfunction and gains theclassifyfunction. - The
dynamic.optionfunction has been renamed tooptionaland made more permissive to other null values. - The
dynamic.resultfunction has been made more permissive to other result values. - The
dynamic.thunkfunction has been removed. - The
dynamic.elementlabelpositionwas renamed toget. - The
dynamic.elementnow accepts negative indexes. - The
io.get_linefunction has been moved to thegleam_erlanglibrary. - The
atommodule has been moved to thegleam_erlanglibrary. - Prelude types like
Result,Listetc. are no longer redefined in their stdlib modules. - The
dynamicmodule functions now return structured error values instead of a string error description. - The
stringmodule gains theto_optionfunction. - Fixed a bug where
io.printcould crash when printing special characters. - The
regex.Matchrecord no longer has thebyte_indexfield any more. - The
shouldmodule has been moved to thegleam_should_assertionspackage. - The
uri.percent_encodefunction has a slightly different behaviour. For example spaces are encoded as%20, not as+. - The order of the arguments of the the function accepted by the
list.map_fold,list.fold,list.fold_right,list.index_fold,list.try_fold,list.fold_until,list.reduce,list.scan,map.fold,set.fold,iterator.fold,iterator.scan,iterator.reduce,iterator.fold_until, anditerator.try_foldhave been flipped.
- The
listmodule gains theinterleave,flat_mapandtransposefunctions. - The
optionmodule gains theallandvaluesfunctions. - The
osmodule now uses unicode to encode/decode environment variables. This fixes an issue when non-latin characters are present in environment. - The
resultmodule gains thevaluesfunction. - All modules now use the new
#(a, b, ...)tuple syntax.
- The
list.split_whilefunction's second argument now has the labelsatisfyingto match the other_whilefunctions inlistanditerator. - The
dynamicmodule gains thetuple3,tuple4,tuple5,tuple6functions and their typed equivalentstyped_tuple3,typed_tuple4,typed_tuple5,typed_tuple6. - The
listmodule gains thecombinations,combination_pairs,drop_while,map_fold,take_while,reduce,chunk,sized_chunk,lastandscanfunctions. - The
iteratormodule gains theindex,iterate,zip,scan,last,take_while,drop_while,chunk,sized_chunk,intersperse,interleave,reduce,any,all,empty,onceandsinglefunctions. - Breaking change in
iterator.take. Now it returns an iterator instead of a list. - The
stringmodule gains thecropfunction.
- The
listmodules gains thefold_until,window, andwindow_by_2functions. - The
intmodule gains theclampfunction. - The
floatmodule gains theclampfunction. - The
iomodule gains theget_linefunction.
- The
intmodule gains theabsolute_value,sumandproductfunctions. - The
floatmodule gains thesumandproductfunctions. - The
resultmodule gains thelazy_or,lazy_unwrap, andreplace_errorfunctions. - The
boolmodule gains thenand,nor,exclusive_nor, andexclusive_orfunctions. - The
bit_buildermodule gains thefrom_string_builderfunction. - The
listmodules gains theindex_fold,permutations, andtry_foldfunctions. - Breaking change in
queue.from_list. The head element in the list becomes the first element in the queue. - Fix
queue.pop_backandqueue.pop_front
- The
functionmodule gainscurry2tocurry6. - The
listmodule gains theeach, andpartitionfunctions. - The
intandfloatmodules gain thenegatefunction. - The
intmodule gains theto_floatfunction. - The
resultmodule gains theallfunction. - The
dynamicmodule gains theoption,resultandtyped_resultfunctions. - The
urimodule gains thepercent_encodeandpercent_decodefunctions. - The
osmodule gains theerlang_timestampfunction. - The
iteratormodule gains theappend,flatten,flat_map,step, andfindfunctions.
- Fix
uri.parse_queryto handle the case where query parameters are present without a value. - The types for
list.find_maphave been relaxed. - The
dynamic.typed_listargument label has changed fromcontainingtoof. - The
dynamicmodule gains theanyfunction. - The
bit_buildermodule gains thefrom_stringfunction. - The
listmodule gains thekey_setandunzipfunction. - The
functionmodule gains therescuefunction. - The
floatmodule gains thepower,square_root, andabsolute_valuefunctions.
- Fix
dynamic.stringto check that binary contains only utf8 characters.
bit_stringmodule created withfrom_string,byte_size,append,part,to_string,is_utf8,int_to_u32andint_from_u32functions.- The
bit_buildermodule has been introduced withprepend,append,prepend_builder,append_builder,prepend_string,append_string,concat,from_bit_string,to_bit_string, andbyte_sizefunctions. - The
iodatamodule has been renamed tostring_builder. osmodule created withget_env,insert_env,delete_envandsystem_time.- The
stringmodule gains thesplit_onceandutf_codepointfunctions. - The
dynamicmodule gains thebit_stringfunction. - The
urimodule gains theoriginandmergefunction. - The
io.debugfunction returns the printed term. - The
dynamic.listfunction has been renamed todynamic.typed_list. - The
dynamic.opaque_listfunction has been renamed todynamic.list. - The
dynamic.tuple2_offunction has been renamed todynamic.typed_tuple2. - The
list.traversefunction has been renamed tolist.try_map. - The
list.traversefirst argument gains the labelover. - The
optionmodule gains the themap,flatten,thenandorfunctions. - The
resultmodule gains the theorfunction. - Created the
regexmodule with thefrom_string,compile,check,splitandscanfunctions. - The
listmodule gains the thepop,pop_mapandkey_popfunctions. basemodule created withencode64,decode64,url_encode64andurl_decode64.
- Created the
iteratormodule with theunfold,repeatedly,repeat,from_list,fold,run,to_list,take,drop,map,filter,cycle, andrangefunctions. - Created the
setmodule with thenew,insert,delete,to_list,from_list,fold,take,union,intersection, andcontainsfunctions. - Created the
iomodule with theprint,println, anddebugfunctions. - Created the
queuemodule with thenew,from_list,to_list,is_empty,length,push_back,push_front,pop_back,pop_front,reverse,is_logically_equal, andis_equalfunctions. - Created the
optionmodule containing theOptiontype and theis_someandis_nonefunctions. - Created the
optionmodule containing theOptiontype and theis_some,is_none,to_result,from_resultandunwrapfunctions. - Removed the
Optionalias and thenonefunction from theresultmodule. - The
resultmodule gains thenil_errorfunction. - The
stringmodule gainstrim,trim_left,trim_right,starts_with,ends_with,slice,pad_left,pad_rightdrop_left,drop_right,pop_graphemeandto_graphemesfunctions. urimodule created withparse,parse_query,path_segments,query_to_stringandto_string.- The
dynamicmodule gains themap,opaque_list,tuple2, andtuple2_offunctions. - The
listmodule gains thefilter_mapfunction. - The
list.containslabelhashas been changed toany. - The
list.sortlabelsort_byhas been changed toby. - The
list.fold's first argument gained the labelover. - The
map.fold's first argument gained the labelover. - The
map.take'sdropargument has been changed tokeeping.
- The error type for
atom.from_stringhas been renamed toFromStringError. - The
stringmodule gainscontainsandrepeatfunctions. - The
expectmodule has been renamed toshould. Functions in the module starting withis_have been changed tobe_. - The
string.replaceandiodata.replaceallargument label has been changed toeach. - The
stringmodule gainsis_empty,joinandconcatfunctions. - The
intmodule gainsis_evenandis_oddfunctions. - The
list.lengthfunction now accepts a labelled argument. - The
list.lengthfunction now accepts a labelled argument. - The the second argument of
bool.compare,float.compare,int.compare, andorder.comparenow have the labelwith. - The
dynamic.unsafe_coercefunction now only accepts Dynamic data. - The
dynamicdecoder functions no longer print the entire value in their error messages, to avoid large errors.
- The
resultmodule gains anOptiontype alias. - The
functionmodule has been created withidentity,compose, andflipfunctions. - The error type of
list.find_mapis nowNil. - The labels for
list.splitare nowsplit(list: _, at: _).
- Syntax has been updated for Gleam v0.6.0.
- The
dynamicmodule gains anelementfor decoding tuples.
- Syntax has been updated for Gleam v0.5.
- Labels have been added to functions throughout the stdlib.
map.fetchhas been renamed tomap.getandmap.puttomap.insert.list.findhas been renamedlist.find_mapand a newlist.findhas been introduced.- The
pairmodule gains themap_first, andmap_secondfunctions. - The
pair.Pairtype has been replaced with a 2 element anonymous struct. - The
triplemodule has been removed. - The
stringmodule gains thecomparefunction. - The
floatmodule gains themax, andminfunctions. - The
intmodule gains themax, andminfunctions. - The
Anytype and module have been renamed toDynamic.
- Syntax has been updated for Gleam v0.4.
- The
map_dictmodule has been renamed tomap. list:sortnow requires a compare function as comparison operators now only work on Ints.list:sort's performance has been slightly optimised.- The
floatmodule gains acomparefunction. any.tuplehas been renamedany.pair.- The
tuplemodule has been renamed topairand has aPairtype. pair.fetchhas been replaced withlist.key_find.triplemodule has been created with typeTriple.- The error type for
float.parse,int.parse,list.head,list.tail,list.find,list.at,map.fetch, andmap.updateis nowNil.
result:map_errorhas been relaxed to allow mapping to a different error type.
- The
map_dictmodule gains afoldfunction. - All modules moved under the
stdnamespace. - The
httpmodule has been split out into thegleam_httppackage.
- Library renamed to
gleam_stdlib. - The
map_dictmodule gainsupdate,mergeanddeletefunctions. - The
boolmodule gains acomparefunction. - The
intmodule gains acomparefunction. - The
listmodule gainsrange,repeat,split,split_whileandstrict_zipfunctions.
- The
listmodule gainsat,all,any,index_map,intersperse,sort,unique, andzipfunctions. map_dict:Maprenamed tomap_dict:MapDict.- The
map_dictmodule gainsdrop, andtakefunctions. - The
strmodule gainsappendfunction and losesfrom_int,parse_int,from_float,parse_float, andbase_from_int. intmodule created withparse,to_string, andto_base_string.floatmodule created withceiling,floor,round,truncate,parse, andto_string.
- Included missing gleam.toml in hex package.
- Initial release!