signature BASICS = sig (*functions*) val |> : 'a * ('a -> 'b) -> 'b val |-> : ('c * 'a) * ('c -> 'a -> 'b) -> 'b val |>> : ('a * 'c) * ('a -> 'b) -> 'b * 'c val || : ('c a ' >') - c* 'b val ||>> Author: Florian Haftmann java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*'- ')>' >'java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 val' - c*)*' >b>'d -'- 'java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
v tap' >')> >'java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 ' ->'*' 'b d >>' d val ## a list >list
:b>' b-> ' val tap: :'> 'a -
:' >' >' val is_some: 'a option -> bool val is_none: 'a option -> bool valthe > val these join_options '*a>')>' * aoption ->a java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
v the_default'-> option> java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
:java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
:a >'a - 'a java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 val join_options: ('a * 'a -> 'a) -> 'a option * 'a option -> 'a option val eq_option: ('a * 'b -> bool) -> 'a option * 'b option -> bool
(*partiality*) valtry: ('a -> 'b) -> 'a -> 'b option val can: ('a -> 'b) -> 'a -> bool
(*lists*) val cons: 'a -> 'a list -> 'a list val append: 'a list -> 'a list -> 'a list val fold: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b val fold_rev: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b val fold_map: ('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b val fold_maps: ('a -> 'b -> 'c list * 'b) -> 'a list -> 'b -> 'c list * 'b end;
structure Basics: BASICS = struct
(* functions *)
(*application and structured results*) fun x |> f = f x; fun (x, y) |-> f = f x y; fun (x, y) |>> f = (f x, y); fun (x, y) ||> f = (x, f y); fun (x, y) ||>> f = letval (z, y') = f y in ((x, z), y') end;
(*composition and structured results*) fun (f #> g) x = x |> f |> g; fun (f #-> g) x = x |> f |-> g; fun (f #>> g) x = x |> f |>> g; fun (f ##> g) x = x |> f ||> g; fun (f ##>> g) x = x |> f ||>> g;
(*result views*) fun `f = fn x => (f x, x); fun tap f = fn x => (f x; x);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.