Hi,

"()" is used to represent unit. It's very general and can be used in a number of situations, for example;

1
2
3
4
5
6
7
8
> let x = fun () -> ();;
val x : unit -> unit

> x;;
val it : (unit -> unit) = <fun:clo@0>

> x();;
val it : unit = ()

Cheers,

Andy

By on 5/23/2007 2:32 PM ()

thank you for the quick (and correct!) reply :)

By on 5/23/2007 2:39 PM ()

You probably want to use the ignore function to make something evealuate to the unit type.

let buttonClicked (e:System.EventArgs) =
MessageBox.Show(e.ToString()) |> ignore

I'm probably going to start sounding like a broken record, but this is covered at the beginning of chapter 4 in my book:
[link:www.amazon.com]

By on 5/23/2007 9:06 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper