Skip to content

Instantly share code, notes, and snippets.

@jroesch
Last active August 29, 2015 14:13
Show Gist options
  • Save jroesch/96240584c25c54c0d2bf to your computer and use it in GitHub Desktop.
Save jroesch/96240584c25c54c0d2bf to your computer and use it in GitHub Desktop.
examples for cs290g
\<x : Banana (+) Jelly> -> \<pb : PeanutButter> ->
case x of
inl<banna> -> <banna, pb>;
inr<jelly> -> <jelly, pb>;
\<p: A (x) B> -> \<f: A -o C> -> \<g: B -o D> ->
case p of <a, b> -> <f<a>, g<b>>
\<x : (A -o B) (x) A> ->
case x of <f, b> -> f<b>
\<f : (A -o B)> -> \<x: A> ->
<f<x>, f<x>>
\<f : !(A -> B)> -> \<y : A (x) A> ->
case y of <a, b> -> <f<a>, f<b>>
@tkonolige
Copy link

\<x : (A -> B) (x) A ->
  case x of <f, b> -> f<b>

@tkonolige
Copy link

\<f : !(A -> B)> -> \<y : B (x) B> ->
  case y of <a, b> -> <f<a>, f<b>>

@tkonolige
Copy link

\<f : !(A -> B)> -> \<y : A (x) A> ->
  case f of !g -> case y of <a, b> -> <g<a>, g<b>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment