Standard
A portable standard library enhancement for Reason and OCaml.
Standard provides an easy-to-use, comprehensive and safe standard library that has the same API for the OCaml and Bucklescript compilers.
open Standard;String.toList("Standard")|> List.filterMap(~f=character =>Char.toCode(character)|> Int.add(1)|> Char.ofCode)|> String.ofList/* "Tuboebse" */
Portable
Works with either the Reason or OCaml syntax, targeting the Bucklescript, Native orjs_of_ocaml
compilersSafe
Banish runtime errors and work effectively with Options and ResultsAdvanced
Index operators for Arrays, Maps, Sets and Strings plus binding operators for Options & Results mean your code is concise and expressiveopen Standardlet nameToSpecies = Map.String.ofList [("Alan", "Ant");("Bertie", "Badger");] inlet nameToSpecies =nameToSpecies.Map.?{"Delilah"} <- "Duck" inlet hybrid = Option.(let+ delilahSpecies =nameToSpecies.Map.?{"Delilah"} inand+ frankSpecies =nameToSpecies.Map.?{"Frank"} |? "Cat" indelilahSpecies ^ frankSpecies) inhybrid = Some "DuckCat"