Skip to content

Instantly share code, notes, and snippets.

@hodzanassredin
Created May 28, 2015 16:23
Show Gist options
  • Save hodzanassredin/077c06d0320fca3e093b to your computer and use it in GitHub Desktop.
Save hodzanassredin/077c06d0320fca3e093b to your computer and use it in GitHub Desktop.
inline shadows
open System
type Pure = Pure of unit
type Impure = Impure of unit
type M<'a,'p> = M of 'a
let purev x : M<_,Pure>= M(x)
let purev x : M<_,Impure>= M(x)
type ThingThatShows =
static member show(x: Option<Pure> ) = sprintf "pure"
static member show(x: Option<Impure>) = sprintf "impure"
let f (x:M<'a,_>, y:M<'a,_>) :M<'a,_> = match
purev |> ThingThatShows.show |> Console.WriteLine
impurev |> ThingThatShows.show |> Console.WriteLine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment