6 people like it.
Like the snippet!
Spreadsheet
Spreadsheet script runnable inside http://tryfsharp.org includes a custom DataGrid and a parser for simple formulas e.g.:
=1+1
=SUM(A1,A2)
Add your own functions to the evaluate function.
For a more comprehensive implementation check out http://cellz.codeplex.com
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
|
#if INTERACTIVE
#else
module Spreadsheet
#endif
open System
open System.Collections
open System.ComponentModel
open System.Windows
open System.Windows.Controls
open System.Windows.Data
open System.Windows.Input
open System.Windows.Media
let rec toRef (s:string) =
let col = int s.[0] - int 'A'
let row = s.Substring 1 |> int
col, row-1
type token =
| WhiteSpace
| Symbol of char
| OpToken of string
| RefToken of int * int
| FunToken of string
| NumToken of decimal
let (|Match|_|) pattern input =
let m = System.Text.RegularExpressions.Regex.Match(input, pattern)
if m.Success then Some m.Value else None
let matchToken = function
| Match @"^\s+" s -> s, WhiteSpace
| Match @"^\+" s -> s, OpToken s
| Match @"^\-" s -> s, OpToken s
| Match @"^\*" s -> s, OpToken s
| Match @"^\/" s -> s, OpToken s
| Match @"^\(|^\)|^\," s -> s, Symbol s.[0]
| Match @"^[A-Z]\d+" s -> s, s |> toRef |> RefToken
| Match @"^[A-Za-z]+" s -> s, FunToken s
| Match @"^\d+(\.\d+)?|\.\d+" s -> s, s |> decimal |> NumToken
| _ -> invalidOp ""
let tokenize s =
let rec tokenize' index (s:string) =
if index = s.Length then []
else
let next = s.Substring index
let text, token = matchToken next
token :: tokenize' (index + text.Length) s
tokenize' 0 s
|> List.choose (function WhiteSpace -> None | t -> Some t)
type operator = Add | Sub | Mul | Div
type expr =
| Neg of expr
| Op of expr * operator * expr
| Num of decimal
| Ref of int * int
| Fun of string * expr list
let rec (|Term|_|) = function
| Factor(e1, t) ->
let rec aux e1 = function
| Sum op::Factor(e2, t) -> aux (Op(e1,op,e2)) t
| t -> Some(e1, t)
aux e1 t
| _ -> None
and (|Sum|_|) = function
| OpToken "+" -> Some Add
| OpToken "-" -> Some Sub
| _ -> None
and (|Factor|_|) = function
| OpToken "-"::Factor(e, t) -> Some(Neg(e), t)
| Atom(e1, Product op::Factor(e2, t)) ->
Some(Op(e1,op,e2), t)
| Atom(e, t) -> Some(e, t)
| _ -> None
and (|Product|_|) = function
| OpToken "*" -> Some Mul
| OpToken "/" -> Some Div
| _ -> None
and (|Atom|_|) = function
| NumToken(n)::t -> Some(Num(n), t)
| RefToken(x,y)::t -> Some(Ref(x,y), t)
| Symbol '('::Term(e, Symbol ')'::t) -> Some(e, t)
| FunToken(s)::Tuple(ps, t) -> Some(Fun(s,ps),t)
| _ -> None
and (|Tuple|_|) = function
| Symbol '('::Params(ps, Symbol ')'::t) -> Some(ps, t)
| _ -> None
and (|Params|_|) = function
| Term(e1, t) ->
let rec aux es = function
| Symbol ','::Term(e2, t) -> aux (es@[e2]) t
| t -> es, t
Some(aux [e1] t)
| t -> Some ([],t)
let parse s =
tokenize s |> function
| Term(e,[]) -> e
| _ -> failwith "Failed to parse formula"
let evaluate valueAt s =
let rec eval = function
| Neg e -> - (eval e)
| Op(e1,Add,e2) -> eval e1 + eval e2
| Op(e1,Sub,e2) -> eval e1 - eval e2
| Op(e1,Mul,e2) -> eval e1 * eval e2
| Op(e1,Div,e2) -> eval e1 / eval e2
| Num d -> d
| Ref(x,y) -> valueAt(x,y) |> decimal
| Fun("SUM",ps) -> ps |> List.map eval |> List.sum
| Fun(_,_) -> failwith "Unknown function"
eval s
let references s =
let rec traverse = function
| Ref(x,y) -> [x,y]
| Fun(_,ps) -> ps |> List.collect traverse
| Op(e1,_,e2) -> traverse e1 @ traverse e2
| _ -> []
traverse s
type Sheet (colCount,rowCount) as sheet =
let cols = Array.init colCount (fun i -> string (int 'A' + i |> char))
let rows = Array.init rowCount (fun index -> Row(index+1,colCount,sheet))
member sheet.Columns = cols
member sheet.Rows = rows
member sheet.MaxGeneration = 1000
and Row (index,colCount,sheet) =
let cells = Array.init colCount (fun i -> Cell(sheet))
member row.Cells = cells
member row.Index = index
and Cell (sheet:Sheet) as cell =
inherit ObservableObject()
let mutable value = ""
let mutable data = ""
let mutable expr : expr option = None
let updated = Event<_>()
let mutable subscriptions : System.IDisposable list = []
let cellAt(x,y) =
let (row : Row) = Array.get sheet.Rows y
let (cell : Cell) = Array.get row.Cells x
cell
let valueAt address = (cellAt address).Value
let eval expr =
try (evaluate valueAt expr).ToString()
with _ -> "N/A"
let parseFormula (text:string) =
if text.StartsWith "="
then
try true, parse (text.Substring 1) |> Some
with _ -> true, None
else false, None
let update newValue generation =
if newValue <> value then
value <- newValue
updated.Trigger generation
cell.Notify "Value"
let unsubscribe () =
subscriptions |> List.iter (fun d -> d.Dispose())
subscriptions <- []
let subscribe expr addresses =
let remember x = subscriptions <- x :: subscriptions
for address in addresses do
let cell' : Cell = cellAt address
cell'.Updated
|> Observable.subscribe (fun generation ->
if generation < sheet.MaxGeneration then
let newValue = eval expr
update newValue (generation+1)
) |> remember
member cell.Data
with get () = data
and set (text:string) =
data <- text
cell.Notify "Data"
let isFormula, newExpr = parseFormula text
expr <- newExpr
unsubscribe()
expr |> Option.iter (fun expr -> references expr |> subscribe expr)
let newValue =
match isFormula, expr with
| _, Some expr -> eval expr
| true, _ -> "N/A"
| _, None -> text
update newValue 0
member cell.Value = value
member cell.Updated = updated.Publish
and ObservableObject() =
let propertyChanged =
Event<PropertyChangedEventHandler,PropertyChangedEventArgs>()
member this.Notify name =
propertyChanged.Trigger(this,PropertyChangedEventArgs name)
interface INotifyPropertyChanged with
[<CLIEvent>]
member this.PropertyChanged = propertyChanged.Publish
type DataGrid(headings:seq<_>, items:IEnumerable, cellFactory:int*int->FrameworkElement) as grid =
inherit Grid()
do grid.ShowGridLines <- true
let createHeader heading horizontalAlignment =
let header = TextBlock(Text=heading)
header.HorizontalAlignment <- horizontalAlignment
header.VerticalAlignment <- VerticalAlignment.Center
let container = Grid(Background=SolidColorBrush Colors.Gray)
container.Children.Add header |> ignore
container
do ColumnDefinition(Width=GridLength(24.0)) |> grid.ColumnDefinitions.Add
do headings |> Seq.iteri (fun i heading ->
let width = GridLength(64.0)
ColumnDefinition(Width=width) |> grid.ColumnDefinitions.Add
let header = createHeader heading HorizontalAlignment.Center
grid.Children.Add header |> ignore
Grid.SetColumn(header,i+1)
)
do let height = GridLength(24.0)
RowDefinition(Height=height) |> grid.RowDefinitions.Add
let mutable y = 1
for item in items do
RowDefinition(Height=height) |> grid.RowDefinitions.Add
let header = createHeader (y.ToString()) HorizontalAlignment.Right
grid.Children.Add header |> ignore
Grid.SetRow(header,y)
for x=1 to Seq.length headings do
let cell = cellFactory (x-1,y-1)
cell.DataContext <- item
grid.Children.Add cell |> ignore
Grid.SetColumn(cell,x)
Grid.SetRow(cell,y)
y <- y + 1
type View() =
inherit UserControl()
let sheet = Sheet(26,50)
let remember = ignore
let cellFactory (x,y) =
let binding = Binding(sprintf "Cells.[%d].Data" x)
binding.Mode <- BindingMode.TwoWay
let edit = TextBox()
edit.SetBinding(TextBox.TextProperty,binding) |> ignore
edit.Visibility <- Visibility.Collapsed
let view = Button(Background=SolidColorBrush Colors.White)
view.BorderBrush <- null
view.Style <- null
let binding = Binding(sprintf "Cells.[%d].Value" x)
let block = TextBlock()
block.SetBinding(TextBlock.TextProperty, binding) |> ignore
view.Content <- block
view.HorizontalContentAlignment <- HorizontalAlignment.Left
view.VerticalContentAlignment <- VerticalAlignment.Center
let setEditMode _ =
edit.Visibility <- Visibility.Visible
view.Visibility <- Visibility.Collapsed
edit.Focus() |> ignore
let setViewMode _ =
edit.Visibility <- Visibility.Collapsed
view.Visibility <- Visibility.Visible
view.Click |> Observable.subscribe setEditMode |> remember
edit.LostFocus |> Observable.subscribe setViewMode |> remember
let enterKeyDown = edit.KeyDown |> Observable.filter (fun e -> e.Key = Key.Enter)
enterKeyDown |> Observable.subscribe setViewMode |> remember
let container = Grid()
container.Children.Add view |> ignore
container.Children.Add edit |> ignore
container :> FrameworkElement
let viewer = ScrollViewer(HorizontalScrollBarVisibility=ScrollBarVisibility.Auto)
do viewer.Content <- DataGrid(sheet.Columns,sheet.Rows,cellFactory)
do base.Content <- viewer
#if INTERACTIVE
open Microsoft.TryFSharp
App.Dispatch (fun() ->
App.Console.ClearCanvas()
new View() |> App.Console.Canvas.Children.Add
App.Console.CanvasPosition <- CanvasPosition.Right
)
#endif
|
namespace System
namespace System.Collections
namespace System.ComponentModel
namespace System.Windows
Multiple items
namespace System.Data
--------------------
namespace Microsoft.FSharp.Data
namespace System.Media
val toRef : s:string -> int * int
Full name: Script.toRef
val s : string
Multiple items
val string : value:'T -> string
Full name: Microsoft.FSharp.Core.Operators.string
--------------------
type string = String
Full name: Microsoft.FSharp.Core.string
val col : 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 row : int
String.Substring(startIndex: int) : string
String.Substring(startIndex: int, length: int) : string
type token =
| WhiteSpace
| Symbol of char
| OpToken of string
| RefToken of int * int
| FunToken of string
| NumToken of decimal
Full name: Script.token
union case token.WhiteSpace: token
union case token.Symbol: char -> token
Multiple items
val char : value:'T -> char (requires member op_Explicit)
Full name: Microsoft.FSharp.Core.Operators.char
--------------------
type char = Char
Full name: Microsoft.FSharp.Core.char
union case token.OpToken: string -> token
union case token.RefToken: int * int -> token
union case token.FunToken: string -> token
union case token.NumToken: decimal -> token
Multiple items
val decimal : value:'T -> decimal (requires member op_Explicit)
Full name: Microsoft.FSharp.Core.Operators.decimal
--------------------
type decimal = Decimal
Full name: Microsoft.FSharp.Core.decimal
--------------------
type decimal<'Measure> = decimal
Full name: Microsoft.FSharp.Core.decimal<_>
val pattern : string
val input : string
val m : Text.RegularExpressions.Match
namespace System.Text
namespace System.Text.RegularExpressions
Multiple items
type Regex =
new : pattern:string -> Regex + 1 overload
member GetGroupNames : unit -> string[]
member GetGroupNumbers : unit -> int[]
member GroupNameFromNumber : i:int -> string
member GroupNumberFromName : name:string -> int
member IsMatch : input:string -> bool + 1 overload
member Match : input:string -> Match + 2 overloads
member Matches : input:string -> MatchCollection + 1 overload
member Options : RegexOptions
member Replace : input:string * replacement:string -> string + 5 overloads
...
Full name: System.Text.RegularExpressions.Regex
--------------------
Text.RegularExpressions.Regex(pattern: string) : unit
Text.RegularExpressions.Regex(pattern: string, options: Text.RegularExpressions.RegexOptions) : unit
Text.RegularExpressions.Regex.Match(input: string, pattern: string) : Text.RegularExpressions.Match
Text.RegularExpressions.Regex.Match(input: string, pattern: string, options: Text.RegularExpressions.RegexOptions) : Text.RegularExpressions.Match
property Text.RegularExpressions.Group.Success: bool
union case Option.Some: Value: 'T -> Option<'T>
property Text.RegularExpressions.Capture.Value: string
union case Option.None: Option<'T>
val matchToken : _arg1:string -> string * token
Full name: Script.matchToken
active recognizer Match: string -> string -> string option
Full name: Script.( |Match|_| )
val invalidOp : message:string -> 'T
Full name: Microsoft.FSharp.Core.Operators.invalidOp
val tokenize : s:string -> token list
Full name: Script.tokenize
val tokenize' : (int -> string -> token list)
val index : int
property String.Length: int
val next : string
val text : string
Multiple items
val token : token
--------------------
type token =
| WhiteSpace
| Symbol of char
| OpToken of string
| RefToken of int * int
| FunToken of string
| NumToken of decimal
Full name: Script.token
Multiple items
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IEnumerable
interface IEnumerable<'T>
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
static member Cons : head:'T * tail:'T list -> 'T list
static member Empty : 'T list
Full name: Microsoft.FSharp.Collections.List<_>
val choose : chooser:('T -> 'U option) -> list:'T list -> 'U list
Full name: Microsoft.FSharp.Collections.List.choose
val t : token
type operator =
| Add
| Sub
| Mul
| Div
Full name: Script.operator
union case operator.Add: operator
union case operator.Sub: operator
union case operator.Mul: operator
union case operator.Div: operator
type expr =
| Neg of expr
| Op of expr * operator * expr
| Num of decimal
| Ref of int * int
| Fun of string * expr list
Full name: Script.expr
union case expr.Neg: expr -> expr
union case expr.Op: expr * operator * expr -> expr
union case expr.Num: decimal -> expr
union case expr.Ref: int * int -> expr
union case expr.Fun: string * expr list -> expr
type 'T list = List<'T>
Full name: Microsoft.FSharp.Collections.list<_>
active recognizer Factor: token list -> (expr * token list) option
Full name: Script.( |Factor|_| )
val e1 : expr
val t : token list
val aux : (expr -> token list -> (expr * token list) option)
active recognizer Sum: token -> operator option
Full name: Script.( |Sum|_| )
val op : operator
val e2 : expr
val e : expr
active recognizer Atom: token list -> (expr * token list) option
Full name: Script.( |Atom|_| )
active recognizer Product: token -> operator option
Full name: Script.( |Product|_| )
val n : decimal
val x : int
val y : int
active recognizer Term: token list -> (expr * token list) option
Full name: Script.( |Term|_| )
Multiple items
active recognizer Tuple: token list -> (expr list * token list) option
Full name: Script.( |Tuple|_| )
--------------------
type Tuple =
static member Create<'T1> : item1:'T1 -> Tuple<'T1> + 7 overloads
Full name: System.Tuple
--------------------
type Tuple<'T1> =
new : item1:'T1 -> Tuple<'T1>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member ToString : unit -> string
Full name: System.Tuple<_>
--------------------
type Tuple<'T1,'T2> =
new : item1:'T1 * item2:'T2 -> Tuple<'T1, 'T2>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member ToString : unit -> string
Full name: System.Tuple<_,_>
--------------------
type Tuple<'T1,'T2,'T3> =
new : item1:'T1 * item2:'T2 * item3:'T3 -> Tuple<'T1, 'T2, 'T3>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member ToString : unit -> string
Full name: System.Tuple<_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 -> Tuple<'T1, 'T2, 'T3, 'T4>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6,'T7> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 * item7:'T7 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member Item7 : 'T7
...
Full name: System.Tuple<_,_,_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6,'T7,'TRest> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 * item7:'T7 * rest:'TRest -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'TRest>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member Item7 : 'T7
...
Full name: System.Tuple<_,_,_,_,_,_,_,_>
--------------------
Tuple(item1: 'T1) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6, item7: 'T7) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6, item7: 'T7, rest: 'TRest) : unit
val ps : expr list
Multiple items
type Tuple =
static member Create<'T1> : item1:'T1 -> Tuple<'T1> + 7 overloads
Full name: System.Tuple
--------------------
type Tuple<'T1> =
new : item1:'T1 -> Tuple<'T1>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member ToString : unit -> string
Full name: System.Tuple<_>
--------------------
type Tuple<'T1,'T2> =
new : item1:'T1 * item2:'T2 -> Tuple<'T1, 'T2>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member ToString : unit -> string
Full name: System.Tuple<_,_>
--------------------
type Tuple<'T1,'T2,'T3> =
new : item1:'T1 * item2:'T2 * item3:'T3 -> Tuple<'T1, 'T2, 'T3>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member ToString : unit -> string
Full name: System.Tuple<_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 -> Tuple<'T1, 'T2, 'T3, 'T4>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member ToString : unit -> string
Full name: System.Tuple<_,_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6,'T7> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 * item7:'T7 -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member Item7 : 'T7
...
Full name: System.Tuple<_,_,_,_,_,_,_>
--------------------
type Tuple<'T1,'T2,'T3,'T4,'T5,'T6,'T7,'TRest> =
new : item1:'T1 * item2:'T2 * item3:'T3 * item4:'T4 * item5:'T5 * item6:'T6 * item7:'T7 * rest:'TRest -> Tuple<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'TRest>
member Equals : obj:obj -> bool
member GetHashCode : unit -> int
member Item1 : 'T1
member Item2 : 'T2
member Item3 : 'T3
member Item4 : 'T4
member Item5 : 'T5
member Item6 : 'T6
member Item7 : 'T7
...
Full name: System.Tuple<_,_,_,_,_,_,_,_>
--------------------
Tuple(item1: 'T1) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6, item7: 'T7) : unit
--------------------
Tuple(item1: 'T1, item2: 'T2, item3: 'T3, item4: 'T4, item5: 'T5, item6: 'T6, item7: 'T7, rest: 'TRest) : unit
active recognizer Params: token list -> (expr list * token list) option
Full name: Script.( |Params|_| )
val aux : (expr list -> token list -> expr list * token list)
val es : expr list
val parse : s:string -> expr
Full name: Script.parse
val failwith : message:string -> 'T
Full name: Microsoft.FSharp.Core.Operators.failwith
val evaluate : valueAt:(int * int -> string) -> s:expr -> decimal
Full name: Script.evaluate
val valueAt : (int * int -> string)
val s : expr
val eval : (expr -> decimal)
val d : decimal
val map : mapping:('T -> 'U) -> list:'T list -> 'U list
Full name: Microsoft.FSharp.Collections.List.map
val sum : list:'T list -> 'T (requires member ( + ) and member get_Zero)
Full name: Microsoft.FSharp.Collections.List.sum
val references : s:expr -> (int * int) list
Full name: Script.references
val traverse : (expr -> (int * int) list)
val collect : mapping:('T -> 'U list) -> list:'T list -> 'U list
Full name: Microsoft.FSharp.Collections.List.collect
Multiple items
type Sheet =
new : colCount:int * rowCount:int -> Sheet
member Columns : string []
member MaxGeneration : int
member Rows : Row []
Full name: Script.Sheet
--------------------
new : colCount:int * rowCount:int -> Sheet
val colCount : int
val rowCount : int
val sheet : Sheet
val cols : string []
type Array =
member Clone : unit -> obj
member CopyTo : array:Array * index:int -> unit + 1 overload
member GetEnumerator : unit -> IEnumerator
member GetLength : dimension:int -> int
member GetLongLength : dimension:int -> int64
member GetLowerBound : dimension:int -> int
member GetUpperBound : dimension:int -> int
member GetValue : [<ParamArray>] indices:int[] -> obj + 7 overloads
member Initialize : unit -> unit
member IsFixedSize : bool
...
Full name: System.Array
val init : count:int -> initializer:(int -> 'T) -> 'T []
Full name: Microsoft.FSharp.Collections.Array.init
val i : int
val rows : Row []
Multiple items
type Row =
new : index:int * colCount:int * sheet:Sheet -> Row
member Cells : Cell []
member Index : int
Full name: Script.Row
--------------------
new : index:int * colCount:int * sheet:Sheet -> Row
member Sheet.Columns : string []
Full name: Script.Sheet.Columns
member Sheet.Rows : Row []
Full name: Script.Sheet.Rows
member Sheet.MaxGeneration : int
Full name: Script.Sheet.MaxGeneration
val cells : Cell []
Multiple items
type Cell =
inherit ObservableObject
new : sheet:Sheet -> Cell
member Data : string
member Updated : IEvent<int>
member Value : string
member Data : string with set
Full name: Script.Cell
--------------------
new : sheet:Sheet -> Cell
val row : Row
member Row.Cells : Cell []
Full name: Script.Row.Cells
member Row.Index : int
Full name: Script.Row.Index
val cell : Cell
Multiple items
type ObservableObject =
interface INotifyPropertyChanged
new : unit -> ObservableObject
member Notify : name:string -> unit
Full name: Script.ObservableObject
--------------------
new : unit -> ObservableObject
val mutable value : string
val mutable data : string
Multiple items
val mutable expr : expr option
--------------------
type expr =
| Neg of expr
| Op of expr * operator * expr
| Num of decimal
| Ref of int * int
| Fun of string * expr list
Full name: Script.expr
type 'T option = Option<'T>
Full name: Microsoft.FSharp.Core.option<_>
val updated : Event<int>
Multiple items
module Event
from Microsoft.FSharp.Control
--------------------
type Event<'T> =
new : unit -> Event<'T>
member Trigger : arg:'T -> unit
member Publish : IEvent<'T>
Full name: Microsoft.FSharp.Control.Event<_>
--------------------
type Event<'Delegate,'Args (requires delegate and 'Delegate :> Delegate)> =
new : unit -> Event<'Delegate,'Args>
member Trigger : sender:obj * args:'Args -> unit
member Publish : IEvent<'Delegate,'Args>
Full name: Microsoft.FSharp.Control.Event<_,_>
--------------------
new : unit -> Event<'T>
--------------------
new : unit -> Event<'Delegate,'Args>
val mutable subscriptions : IDisposable list
type IDisposable =
member Dispose : unit -> unit
Full name: System.IDisposable
val cellAt : (int * int -> Cell)
val get : array:'T [] -> index:int -> 'T
Full name: Microsoft.FSharp.Collections.Array.get
property Sheet.Rows: Row []
property Row.Cells: Cell []
val address : int * int
val eval : (expr -> string)
Multiple items
val expr : expr
--------------------
type expr =
| Neg of expr
| Op of expr * operator * expr
| Num of decimal
| Ref of int * int
| Fun of string * expr list
Full name: Script.expr
val parseFormula : (string -> bool * expr option)
String.StartsWith(value: string) : bool
String.StartsWith(value: string, comparisonType: StringComparison) : bool
String.StartsWith(value: string, ignoreCase: bool, culture: Globalization.CultureInfo) : bool
val update : (string -> int -> unit)
val newValue : string
val generation : int
member Event.Trigger : arg:'T -> unit
member ObservableObject.Notify : name:string -> unit
val unsubscribe : (unit -> unit)
val iter : action:('T -> unit) -> list:'T list -> unit
Full name: Microsoft.FSharp.Collections.List.iter
val d : IDisposable
IDisposable.Dispose() : unit
val subscribe : (expr -> seq<int * int> -> unit)
val addresses : seq<int * int>
val remember : (IDisposable -> unit)
val x : IDisposable
val cell' : Cell
property Cell.Updated: IEvent<int>
module Observable
from Microsoft.FSharp.Control
val subscribe : callback:('T -> unit) -> source:IObservable<'T> -> IDisposable
Full name: Microsoft.FSharp.Control.Observable.subscribe
property Sheet.MaxGeneration: int
Multiple items
member Cell.Data : string with set
Full name: Script.Cell.Data
--------------------
namespace System.Data
--------------------
namespace Microsoft.FSharp.Data
val set : elements:seq<'T> -> Set<'T> (requires comparison)
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.set
val isFormula : bool
val newExpr : expr option
module Option
from Microsoft.FSharp.Core
val iter : action:('T -> unit) -> option:'T option -> unit
Full name: Microsoft.FSharp.Core.Option.iter
member Cell.Value : string
Full name: Script.Cell.Value
member Cell.Updated : IEvent<int>
Full name: Script.Cell.Updated
property Event.Publish: IEvent<int>
val propertyChanged : Event<PropertyChangedEventHandler,PropertyChangedEventArgs>
type PropertyChangedEventHandler =
delegate of obj * PropertyChangedEventArgs -> unit
Full name: System.ComponentModel.PropertyChangedEventHandler
Multiple items
type PropertyChangedEventArgs =
inherit EventArgs
new : propertyName:string -> PropertyChangedEventArgs
member PropertyName : string
Full name: System.ComponentModel.PropertyChangedEventArgs
--------------------
PropertyChangedEventArgs(propertyName: string) : unit
val this : ObservableObject
member ObservableObject.Notify : name:string -> unit
Full name: Script.ObservableObject.Notify
val name : string
member Event.Trigger : sender:obj * args:'Args -> unit
type INotifyPropertyChanged =
event PropertyChanged : PropertyChangedEventHandler
Full name: System.ComponentModel.INotifyPropertyChanged
Multiple items
type CLIEventAttribute =
inherit Attribute
new : unit -> CLIEventAttribute
Full name: Microsoft.FSharp.Core.CLIEventAttribute
--------------------
new : unit -> CLIEventAttribute
override ObservableObject.PropertyChanged : IEvent<PropertyChangedEventHandler,PropertyChangedEventArgs>
Full name: Script.ObservableObject.PropertyChanged
property Event.Publish: IEvent<PropertyChangedEventHandler,PropertyChangedEventArgs>
Multiple items
type DataGrid =
inherit obj
new : headings:seq<'a> * items:IEnumerable * cellFactory:(int * int -> 'b) -> DataGrid
Full name: Script.DataGrid
--------------------
new : headings:seq<'a> * items:IEnumerable * cellFactory:(int * int -> 'b) -> DataGrid
val headings : seq<'a>
Multiple items
val seq : sequence:seq<'T> -> seq<'T>
Full name: Microsoft.FSharp.Core.Operators.seq
--------------------
type seq<'T> = Generic.IEnumerable<'T>
Full name: Microsoft.FSharp.Collections.seq<_>
val items : IEnumerable
type IEnumerable =
member GetEnumerator : unit -> IEnumerator
Full name: System.Collections.IEnumerable
val cellFactory : (int * int -> 'a)
val grid : DataGrid
val ignore : value:'T -> unit
Full name: Microsoft.FSharp.Core.Operators.ignore
module Seq
from Microsoft.FSharp.Collections
val iteri : action:(int -> 'T -> unit) -> source:seq<'T> -> unit
Full name: Microsoft.FSharp.Collections.Seq.iteri
val length : source:seq<'T> -> int
Full name: Microsoft.FSharp.Collections.Seq.length
Multiple items
type View =
inherit obj
new : unit -> View
Full name: Script.View
--------------------
new : unit -> View
val sprintf : format:Printf.StringFormat<'T> -> 'T
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
val filter : predicate:('T -> bool) -> source:IObservable<'T> -> IObservable<'T>
Full name: Microsoft.FSharp.Control.Observable.filter
More information