Detect operating system

Detect Linux, OSX, or Windows with a handy discriminated union