08.01.2015 Views

Ronald Garcia - Program-Transformation.Org

Ronald Garcia - Program-Transformation.Org

Ronald Garcia - Program-Transformation.Org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

f ≡ (λx : Int. if 0 < x then Dyn ⇐ Bool<br />

Higher-Order Casts<br />

Higher-order casts are checked when the function is<br />

applied.<br />

else Dyn ⇐ Int2)<br />

...Int →Int ⇐ Int → Dyn f ...<br />

• Solution: delay checking and perform blame<br />

(Findler and Felleisen 2002, Wadler and Find<br />

& 2009).<br />

f ≡ (λx : Int. if 0 < x then Dyn ⇐ BoolTrue<br />

else Dyn ⇐ Int2)<br />

(λg. g 1) (Int →Int ⇐ Int →Dynf )<br />

−→ (Int →Int ⇐ Int →Dynf ) 1<br />

−→<br />

Int ⇐ Dyn(f Int ⇐ Int1)<br />

−→ Int ⇐ Dyn(f 1)<br />

Jeremy Siek, <strong>Ronald</strong> <strong>Garcia</strong>, Walid Taha<br />

−→ ∗<br />

Higher-Order Casts<br />

Int ⇐ DynDyn ⇐ BoolTrue<br />

Findler and Felleisen, 2002<br />

Friday, December 7, 2012

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!