Jerseys X-Large
Standard ML (SML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. It is popular among compiler writers and programming language researchers, as well as in the development of theorem provers. more...
Home
All Star Game
Anaheim Angels
Arizona Diamondbacks
Atlanta Braves
Autographs-Original
Baltimore Orioles
Baseball & Softball Items
Accessories
Apparel & Footwear
Cleats
Adidas
Easton
Mizuno
Nike
Other
Reebok
Hats
Jerseys, Shirts
Jerseys
Jerseys Large
Jerseys Medium
Jerseys Other Sizes
Jerseys Small
Jerseys X-Large
Jerseys XXL
Other
Shirts
Other Apparel
Pants & Shorts
Sunglasses
Balls
Bats
Batting Gloves
Equipment Bags
Gloves & Mitts
Other Items
Protective Gear
Training Aids
Boston Red Sox
Chicago Cubs
Chicago White Sox
Cincinnati Reds
Cleveland Indians
Colorado Rockies
Defunct Teams
Detroit Tigers
Florida Marlins
Houston Astros
Kansas City Royals
Los Angeles Dodgers
Milwaukee Brewers
Minnesota Twins
Minors
Montreal Expos
Negro Leagues
New York Mets
New York Yankees
Oakland Athletics
Other
Other MLB Items
Philadelphia Phillies
Pittsburgh Pirates
Playoffs
San Diego Padres
San Francisco Giants
Seattle Mariners
St. Louis Cardinals
Tampa Bay Devil Rays
Texas Rangers
Toronto Blue Jays
Washington Nationals
World Series
SML is a modern descendant of the ML programming language used in the LCF theorem-proving project. It is distinctive among widely used languages in that it has a formal specification, given as typing rules and operational semantics in The Definition of Standard ML (1990, revised and simplified as The Definition of Standard ML (Revised) in 1997).
Language
Standard ML is a mostly functional programming language. Programs written in Standard ML mostly consist of expressions whose values are to be calculated.
Like all functional programming languages, a key feature of Standard ML is the function which is used for abstraction. For instance, the factorial function can be expressed as:
A Standard ML compiler is required to infer the static type int -> int of this function without user-supplied type annotations. I.e., it has to deduce that x is only used with integer expressions, and must therefore itself be an integer, and that all value-producing expressions within the function return integers.
The same function can be expressed with clausal function definitions where the if-then-else conditional is replaced by a sequence of templates of the factorial function evaluated for specific values, separated by '|', which are tried one by one in the order written until a match is found:
Using a local function, this function can be rewritten to use tail recursion:
The value of a let-expression is that of the expression between in and end.
Module System
Standard ML has an advanced module system, allowing programs to be decomposed into hierarchically organized structures of logically related type and value declarations. SML modules provide not only namespace control but also abstraction, in the sense that they allow programmers to define abstract data types.
Three main syntactic constructs comprise the SML module system: signatures, structures and functors. A structure is a module; it consists of a collection of types, exceptions, values and structures (called substructures) packaged together into a logical unit. A signature is an interface, usually thought of as a type for a structure: it specifies the names of all the entities provided by the structure as well as the arities of type components, the types of value components, and signatures for substructures. The definitions of type components may or may not be exported; type components whose definitions are hidden are abstract types. Finally, a functor is a function from structures to structures; that is, a functor accepts one or more arguments, which are usually structures of a given signature, and produces a structure as its result. Functors are used to implement generic data structures and algorithms.
Read more at Wikipedia.org
|