Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobynet/972b3ab94937f6af2ac2 to your computer and use it in GitHub Desktop.
Save tobynet/972b3ab94937f6af2ac2 to your computer and use it in GitHub Desktop.
The playground about functional composition and pipeline operation in F#
// Playground
// ref. http://msdn.microsoft.com/ja-jp/library/dd233229.aspx
//
// All results are... 'val it : string = "abcdef"'
//
// Bacward pipeline operators only
['a'..'f'] |> List.map string |> List.reduce (+)
// With a composition operator
['a'..'f'] |> ( List.map string >> List.reduce (+) )
// With a backward composition operator
['a'..'f'] |> ( List.reduce (+) << List.map string )
// No more backward pipline operators
( List.map string >> List.reduce (+) ) ['a'..'f']
( List.reduce (+) << List.map string ) ['a'..'f']
// Normal pipeline operators
List.reduce (+) <| List.map string ['a'..'f']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment