다음을 통해 공유


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

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

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

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

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

// Usage:
func2 << func1

매개 변수

  • func2
    형식: 'T2 -> 'T3

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

  • func1
    형식: 'T1 -> 'T2

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

반환 값

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

설명

이 연산자는 뒤로 또는 역방향 컴퍼지션 연산자라고 합니다.

예제

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

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

// Reverse composition of two functions.
let appendBothReverse = append1 << append2
printfn "%s" (appendBothReverse "abc")

// Reverse composition of three functions.
let append3 string1 = string1 + ".append3"
printfn "%s" ((append1 << append2 << append3) "abc")

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

let appendFileExtension extension =
    appendString extension << appendString "." 
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#)