Skip to content

Instantly share code, notes, and snippets.

@banshee
Last active August 29, 2015 14:01
Show Gist options
  • Save banshee/2c5042b667b5ee496e81 to your computer and use it in GitHub Desktop.
Save banshee/2c5042b667b5ee496e81 to your computer and use it in GitHub Desktop.
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