4 people like it.

F# quine

A cool F# quine

1: 
2: 
3: 
4: 
5: 
[|32; 124; 62; 32; 40; 102; 117; 110; 32; 120; 45; 62; 32; 112; 114; 105; 110;
  116; 102; 110; 32; 34; 37; 65; 37; 115; 34; 32; 120; 32; 60; 124; 32; 83; 121;
  115; 116; 101; 109; 46; 83; 116; 114; 105; 110; 103; 46; 74; 111; 105; 110; 40;
  34; 34; 44; 32; 65; 114; 114; 97; 121; 46; 109; 97; 112; 32; 99; 104; 97; 114;
  32; 120; 41; 41|] |> (fun x-> printfn "%A%s" x <| System.String.Join("", Array.map char x))
val x : int []
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
namespace System
Multiple items
type String =
  new : value:char -> string + 7 overloads
  member Chars : int -> char
  member Clone : unit -> obj
  member CompareTo : value:obj -> int + 1 overload
  member Contains : value:string -> bool
  member CopyTo : sourceIndex:int * destination:char[] * destinationIndex:int * count:int -> unit
  member EndsWith : value:string -> bool + 2 overloads
  member Equals : obj:obj -> bool + 2 overloads
  member GetEnumerator : unit -> CharEnumerator
  member GetHashCode : unit -> int
  ...

Full name: System.String

--------------------
System.String(value: nativeptr<char>) : unit
System.String(value: nativeptr<sbyte>) : unit
System.String(value: char []) : unit
System.String(c: char, count: int) : unit
System.String(value: nativeptr<char>, startIndex: int, length: int) : unit
System.String(value: nativeptr<sbyte>, startIndex: int, length: int) : unit
System.String(value: char [], startIndex: int, length: int) : unit
System.String(value: nativeptr<sbyte>, startIndex: int, length: int, enc: System.Text.Encoding) : unit
System.String.Join(separator: string, values: System.Collections.Generic.IEnumerable<string>) : string
System.String.Join<'T>(separator: string, values: System.Collections.Generic.IEnumerable<'T>) : string
System.String.Join(separator: string, [<System.ParamArray>] values: obj []) : string
System.String.Join(separator: string, [<System.ParamArray>] value: string []) : string
System.String.Join(separator: string, value: string [], startIndex: int, count: int) : string
module Array

from Microsoft.FSharp.Collections
val map : mapping:('T -> 'U) -> array:'T [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.map
Multiple items
val char : value:'T -> char (requires member op_Explicit)

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

--------------------
type char = System.Char

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

More information

Link:http://fssnip.net/iQ
Posted:11 years ago
Author:Rijnard van Tonder
Tags: quine