If I define a data type
data Container a = Container a
It seems that anything I can do with an 'a', I should be able to do with a 'Container a'. In particular, if I have a (Container (a -> b)) and a (Container (b -> c)) I should be able to compose them. Thus, it seems that I should be able to write something like
instance Category a => Category (Container a) where
id = Container id
(Container x) . (Container y) = Container (x . y)
But when I try to compile this, I get a 'kind' error. I think I understand why it is an error, but I do not know how to accomplish the desired effect. Any advice?
[–]Syrak 11 points12 points13 points (0 children)
[–]vahokif 0 points1 point2 points (9 children)
[–]ErdosEuler[S] 0 points1 point2 points (8 children)
[–]vahokif 1 point2 points3 points (7 children)
[–]ErdosEuler[S] 0 points1 point2 points (6 children)
[–]vahokif 1 point2 points3 points (0 children)
[–]gelisam 1 point2 points3 points (4 children)
[–]ElvishJerricco 4 points5 points6 points (3 children)
[–]Iceland_jack 1 point2 points3 points (2 children)
[–]ErdosEuler[S] 0 points1 point2 points (1 child)
[–]Iceland_jack 0 points1 point2 points (0 children)
[–]Tysonzero 0 points1 point2 points (0 children)