Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created June 19, 2013 09:14
Show Gist options
  • Select an option

  • Save pasberth/5812907 to your computer and use it in GitHub Desktop.

Select an option

Save pasberth/5812907 to your computer and use it in GitHub Desktop.
class T t where
  t :: t a

instance T X where
  t = tx

instance T Y where
  t = ty
 
t' :: T t => t a
t' = t
(def t-map
  { (X a) tx
  , (Y a) ty
  })
 
(defn t [type] (t-map type))
(defn t' [type] (t type))

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