Skip to content

Instantly share code, notes, and snippets.

@jeffmurphy
jeffmurphy / basic-list-functions.sml
Created September 14, 2017 02:51 — forked from edalorzo/basic-list-functions.sml
Learning SML - Basic List Functions
(* Returns the head of a list. *)
fun head(xs) =
case xs of
[] => raise List.Empty
| (x::_) => x
(* Returns the tail of a list. *)
fun tail(xs) =
case xs of
[] => raise List.Empty