Skip to content

Instantly share code, notes, and snippets.

@rbobillot
Last active August 29, 2015 14:24
Show Gist options
  • Save rbobillot/30b34d162a5f5dbd3931 to your computer and use it in GitHub Desktop.
Save rbobillot/30b34d162a5f5dbd3931 to your computer and use it in GitHub Desktop.
val f0 = (g0:Int=>Int, x:Int) => g0(x)
val h0 = ( x:Int ) => f0( p=>p+1, x )
println( "41 + 1 = " + h0(41) )
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
type I = Int
def f1[A,B]( g1:A=>B, x:A ) = g1(x)
val h1 = (x:I) => (x/(x/2)) * (x-(~x))
val res = f1[I,I]( h1, 10 )
println( "(10/(10/2)*(x-(~x))) = " + res )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment