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 contextclass 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