다음을 통해 공유


Operators.( >> )<'T1,'T2,'T3> 함수(F#)

두 함수를 복합합니다. 왼쪽의 함수가 먼저 적용됩니다.

네임스페이스/모듈 경로: Microsoft.FSharp.Core.Operators

어셈블리: FSharp.Core(FSharp.Core.dll)

// Signature:
( >> ) : ('T1 -> 'T2) -> ('T2 -> 'T3) -> 'T1 -> 'T3

// Usage:
func1 >> func2

매개 변수

  • func1
    형식: 'T1 -> 'T2

    적용할 첫 번째 함수입니다.

  • func2
    형식: 'T2 -> 'T3

    적용할 두 번째 함수입니다.

반환 값

입력 함수를 복합한 결과입니다.

예제

다음 예제는 컴퍼지션 연산자(>>)의 사용을 보여 줍니다.

let append1 string1 = string1 + ".append1"
let append2 string1 = string1 + ".append2"

// Composition of two functions.
let appendBoth = append1 >> append2
printfn "%s" (appendBoth "abc")

// Composition of three functions.
let append3 string1 = string1 + ".append3"
printfn "%s" ((append1 >> append2 >> append3) "abc")

// Composition of functions with more than one parameter.
let appendString (string1:string) (string2:string) = string1 + string2

let appendFileExtension extension =
    appendString "." >> appendString extension
printfn "%s" (appendFileExtension "myfile" "txt")
  

플랫폼

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

버전 정보

F# 런타임

지원되는 버전: 2.0, 4.0

Silverlight

지원되는 버전: 3

참고 항목

참조

Core.Operators 모듈(F#)

Microsoft.FSharp.Core 네임스페이스(F#)