<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello Yorick,</div><div><br></div><div>Thanks for taking this one on!</div><div><br></div><div>First off, this kind of question/post is appropriate for putting right into the ticket itself. Posting a comment to the ticket makes it more likely that you'll get a response and saves your thoughts for posterity.</div><div><br></div><div>Now, on to your question:</div><div><br></div><div>That seems somewhat reasonable, but I think your work could go a little further. It looks like you've introduced TupleP as a new constructor for Pred. This, I believe, would work. But, I think it would be better to have a way of using *any* type as a predicate in TH, as allowed by ConstraintKinds. Perhaps one way to achieve this is to make Pred a synonym of Type, or there could be a TypeP constructor for Pred.</div><div><br></div><div>In any case, I would recommend writing a wiki page up with a proposed new TH syntax for predicates and then posting a link to the proposal on the #7021 ticket. Then, it will be easier to debate the merits of any particular approach.</div><div><br></div><div>Once again, thanks!</div><div>Richard</div><br><div><div>On Jan 3, 2014, at 6:13 PM, Yorick Laupa wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div>I try to make my way through #7021 [1]. Unfortunately, there is nothing in the ticket about what should be expected from the code given as example.</div><div><br></div><div>I came with an implementation and I would like feedback from you guys. So, considering this snippet:</div>
<div><br></div><div>--</div><div><pre class="" style="background-color:rgb(247,247,247);border:1px solid rgb(215,215,215);border-top-left-radius:0.3em;border-top-right-radius:0.3em;border-bottom-right-radius:0.3em;border-bottom-left-radius:0.3em;margin-right:1.75em;margin-left:1.75em;padding:0.25em;overflow:auto;color:rgb(0,0,0);font-size:13px">{-# LANGUAGE ConstraintKinds #-}

type IOable a = (Show a, Read a)

foo :: IOable a => a
foo = undefined</pre></div><div>-- </div><div><br></div><div>This is what I got now when pretty-printing <a href="http://TH.Info">TH.Info</a> after reify "foo" call:</div><div><br></div><div>VarI Tuple.foo (ForallT [PlainTV a_1627398594] [TupleP 2 [AppT (ConT GHC.Show.Show) (VarT a_1627398594),AppT (ConT GHC.Read.Read) (VarT a_1627398594)]] (VarT a_1627398594)) Nothing (Fixity 9 InfixL)</div>
<div> </div><div>Does that sound right to you ?</div><div><br></div><div>Thanks for your time</div><div><br></div><div>-- Yorick</div><div><br></div><div>[1] <a href="https://ghc.haskell.org/trac/ghc/ticket/7021">https://ghc.haskell.org/trac/ghc/ticket/7021</a></div>
</div>
_______________________________________________<br>ghc-devs mailing list<br><a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/ghc-devs<br></blockquote></div><br></body></html>