3 people like it.

Fake ternary operator for creating arrows

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let (---) (a:int) (b:string) = 
  (a, b)
let (-->) (a, b) c = 
  sprintf "%d --- %s --> %d" a b c

// Example usage
1 --- "hello" --> 2
val a : int
Multiple items
val int : value:'T -> int (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int

--------------------
type int = int32

Full name: Microsoft.FSharp.Core.int

--------------------
type int<'Measure> = int

Full name: Microsoft.FSharp.Core.int<_>
val b : string
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = System.String

Full name: Microsoft.FSharp.Core.string
val c : int
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
Raw view Test code New version

More information

Link:http://fssnip.net/a3
Posted:12 years ago
Author:
Tags: