7 people like it.

High precedence, right associative backward pipe

High precedence, right associative backward pipe

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
let inline (^<|) f a = f a

module AssociativityComparison =
    let forward_pipe = 
        {1..10} |> Seq.map (fun x -> x + 3) |> Seq.toList
    
    let normal_backward_pipe = 
        Seq.toList <| (Seq.map (fun x -> x + 3) <| {1..10})
    
    let high_prec_right_assoc_backward_pipe = 
        Seq.toList ^<| Seq.map (fun x -> x + 3) ^<| {1..10}

module PrecedenceComparison =
    let normal_backward_pipe  = 
        {1..10} |> (Seq.map <| (fun x -> x + 3))
   
    let high_prec_right_assoc_backward_pipe = 
        {1..10} |> Seq.map ^<| fun x -> x + 3
val f : ('a -> 'b)
val a : 'a
val forward_pipe : int list

Full name: Script.AssociativityComparison.forward_pipe
module Seq

from Microsoft.FSharp.Collections
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>

Full name: Microsoft.FSharp.Collections.Seq.map
val x : int
val toList : source:seq<'T> -> 'T list

Full name: Microsoft.FSharp.Collections.Seq.toList
val normal_backward_pipe : int list

Full name: Script.AssociativityComparison.normal_backward_pipe
val high_prec_right_assoc_backward_pipe : int list

Full name: Script.AssociativityComparison.high_prec_right_assoc_backward_pipe
module PrecedenceComparison

from Script
val normal_backward_pipe : seq<int>

Full name: Script.PrecedenceComparison.normal_backward_pipe
val high_prec_right_assoc_backward_pipe : seq<int>

Full name: Script.PrecedenceComparison.high_prec_right_assoc_backward_pipe
Raw view Test code New version

More information

Link:http://fssnip.net/4o
Posted:13 years ago
Author:Stephen Swensen
Tags: operator