{"comment":{"position":1,"created_at":"2011-11-25T18:20:08Z","commit_id":"513160f1faae169361a8d7a85af4942391e90145","updated_at":"2011-11-25T18:20:08Z","user":{"gravatar_id":"b0dcaf0f709216492c505d3ec167003c","id":147281,"url":"https://api.github.com/users/jckarter","login":"jckarter","avatar_url":"https://secure.gravatar.com/avatar/b0dcaf0f709216492c505d3ec167003c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"This looks a lot like what I had in mind for typeclasses in Clay. Will you be able to handle functional dependencies? You want to be able to compactly represent, for example, the relationship between a sequence type and its element type. What I had in mind for Clay was this pattern syntax:\n\n```\n// given a concept [T] Sequence[T]\n[S:Sequence] // S is a Sequence[_] for any type\n[S:Sequence[Int]] // S is a Sequence[Int]\n[T, S:Sequence[T]] // S is a Sequence[T] for any T, which will be unified with T\n[T:Numeric, S:Sequence[T]] // Sequence[T] for some Numeric T\n```\n\nIn my mind `:` binds tighter than `,`, so `(U, V):Convertible` seems more readable for multi-parameter classes.\n","id":746696,"path":"syntax.txt","line":1,"html_url":"https://github.com/flyingmutant/k2/commit/513160f1fa#commitcomment-746696","url":"https://api.github.com/repos/flyingmutant/k2/comments/746696"}}