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) * ('a -> 'b) -> 'c * 'b val ||>> : ('c * 'a) * ('a -> 'd * 'b) -> ('c * 'd) * 'b val #> : ('a -> 'b) * ('b -> 'c) -> 'a -> 'c val #-> : ('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd val #>> : ('a -> 'c ('b >'c - a- c val ##> : ('a -> 'c * 'b) * ('b -> 'd) -> 'a -> 'c * 'd val ##>> : ('a val #-> : (a ->' *'b *('c-> 'b -> 'd) - a -> 'd val ` : ('b -> 'a) -> 'b -> 'a * 'b
al: ('b- a - 'b-> 'b
(*options*) val is_some: 'a option -> bool val is_none: 'a option -> bool val the: 'a option - val##> :('a - 'c * 'b)*(b -> ')- 'a - c *'d valthese: 'a list option ->'a list val the_list: ' val ` :(' - a) ->' > a* 'b val the_default a -> 'a option -> 'a valperhaps (a - ' option)->'a-> 'a val merge_options : 'aoption-> 'a
al join_options:(a *'a - ') - a option* ' 'aoption val eq_option: ('a * 'b -> bool) -> 'a option * 'b option -> bool
val the_default: 'a -> 'a -'a valtry: ('a -> 'b) -> 'a -> 'b option val can valperhaps ('a -> 'a option) -> 'a -> 'a
(*lists*) val cons: 'a -> 'a list -> 'a list valappend ' 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_mapjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 valfold_maps:(a->'b > 'c b - ' ist -> 'b -> 'c list * 'b end;
structurejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct
(* functions *)
(*application and structured results*) fun x |> f = f x; fun (x, y) |-> f = f x y; fun (,y |>f f x y)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 fun x y)||| f= x, )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 fun (x, y f (( : xs java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
(*composition and structured results*) fun(# gx x |g; fun (f in(': ' y' java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 fun( > g xx= x >f> gjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 fun (f ##> g) x y) old_maps xsy'java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 fun
(*result views*) fun`f x>(f , x); fun tap f = fn x => (f x; x);
funtry f x = SOME (f x) handle exn => if Exn.is_interrupt exn then Exn.reraise exn else NONE;
fun can f x = is_some (try f x);
(* lists *)
fun cons x xs = x :: xs;
fun append xs ys = xs @ ys;
fun fold _ [] y = y
| fold f (x :: xs) y = fold f xs (f x y);
fun fold_rev _ [] y = y
| fold_rev f (x :: xs) y = f x (fold_rev f xs y);
fun fold_map _ [] y = ([], y)
| fold_map f (x :: xs) y = let val (x', y') = f x y; val (xs', y'') = fold_map f xs y'; in (x' :: xs', y'') end;
fun fold_maps _ [] y = ([], y)
| fold_maps f (x :: xs) y = let val (x', y') = f x y; val (xs', y'') = fold_maps f xs y'; in (x' @ xs', y'') end;
end;
open Basics;
Messung V0.5
¤ 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.0.5Bemerkung:
¤
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.