added tap;
authorwenzelm
Thu Aug 18 11:17:36 2005 +0200 (2005-08-18)
changeset 171019c0aaa50283d
parent 17100 16d044ffad19
child 17102 a83a80f1c8dd
added tap;
src/Pure/library.ML
     1.1 --- a/src/Pure/library.ML	Thu Aug 18 11:17:35 2005 +0200
     1.2 +++ b/src/Pure/library.ML	Thu Aug 18 11:17:36 2005 +0200
     1.3 @@ -31,6 +31,7 @@
     1.4    val #> : ('a -> 'b) * ('b -> 'c) -> 'a -> 'c
     1.5    val #-> : ('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd
     1.6    val ` : ('b -> 'a) -> 'b -> 'a * 'b
     1.7 +  val tap: ('b -> 'a) -> 'b -> 'b
     1.8    val oo: ('a -> 'b) * ('c -> 'd -> 'a) -> 'c -> 'd -> 'b
     1.9    val ooo: ('a -> 'b) * ('c -> 'd -> 'e -> 'a) -> 'c -> 'd -> 'e -> 'b
    1.10    val oooo: ('a -> 'b) * ('c -> 'd -> 'e -> 'f -> 'a) -> 'c -> 'd -> 'e -> 'f -> 'b
    1.11 @@ -321,6 +322,7 @@
    1.12  
    1.13  (*view results*)
    1.14  fun `f = fn x => (f x, x);
    1.15 +fun tap f x = (f x; x);
    1.16  
    1.17  (*composition with multiple args*)
    1.18  fun (f oo g) x y = f (g x y);