Last active
August 29, 2015 14:01
-
-
Save banshee/2c5042b667b5ee496e81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.restphone.scalaztalk | |
import scalaz._ | |
import Scalaz._ | |
object Samples { | |
val wrapWithParens = (x: String) => s"( $x )" //> wrapWithParens : String => String = <function1> | |
val wrapWithSquareBrackets = (x: Int) => s"[ $x ]" | |
//> wrapWithSquareBrackets : Int => String = <function1> | |
val wrapWithBoth: Int => String = wrapWithParens compose wrapWithSquareBrackets | |
//> wrapWithBoth : Int => String = <function1> | |
wrapWithBoth(3) //> res0: String = ( [ 3 ] ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment