<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>It sounds like you're doing something quite like the defunctionalization trick I've used for partially applied type families: <a href="https://typesandkinds.wordpress.com/2013/04/01/defunctionalization-for-the-win/">https://typesandkinds.wordpress.com/2013/04/01/defunctionalization-for-the-win/</a></div><div><br></div><div>That blog post eventually became an implementation and paper (co-authored with Jan Stolarek). The implementation is in the `singletons` package; the paper is <a href="http://www.cis.upenn.edu/~eir/papers/2014/promotion/promotion.pdf">http://www.cis.upenn.edu/~eir/papers/2014/promotion/promotion.pdf</a></div><div><br></div><div>I have some ideas (written toward the end of that paper) about how to get this into GHC proper, but it's years away, so don't hold your breath!</div><div><br></div><div>Richard</div><br><div><div>On Jan 13, 2015, at 11:24 AM, magesh b <<a href="mailto:magesh85@gmail.com">magesh85@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Thanks Richard. Basically I was storing the type family and its arguments in the data type, so that I can transform its arguments before it gets applied to stored typefamily (via. another closed type function). Is this even possible to do by any chance in 7.8.4 & later?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 8:32 PM, Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hello Magesh,</div><div><br></div><div>The bug is in 7.8.3, which should never have allowed your `Test1`. Haskell type families may not be partially applied -- the type system and type inference just don't know how to handle such things. In 7.8.3, the check was accidentally turned off, as discussed in #9433, as you found. 7.8.3 allows you to do a few limited things with partially applied families, but you'll get very strange errors if you continue down that road, as GHC quickly gets horribly confused.</div><div><br></div><div>I'm afraid you'll have to find a different way to express what you want.</div><div><br></div><div>Richard</div><br><div><div><div class="h5"><div>On Jan 13, 2015, at 9:49 AM, magesh b <<a href="mailto:magesh85@gmail.com" target="_blank">magesh85@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">Hi,<div><br></div><div><div>{-# LANGUAGE TypeFamilies, ConstraintKinds #-}</div><div><br></div><div>import GHC.Exts</div><div><br></div><div>type family TyFun a</div><div><br></div><div>data DictC (c :: * -> Constraint)</div><div><br></div><div>data DictTF (tf :: * -> *)</div><div><br></div><div>type Test1 = DictTF TyFun -- Fails here in 7.8.4</div><div><br></div><div>type Test2 = DictC Show</div></div><div><br></div><div>When I compile the above code, I'm getting the following error in 7.8.4 and the same code works in 7.8.3. </div><div><br></div><div><div>Test.hs:11:1:</div><div>    Type synonym ‘TyFun’ should have 1 argument, but has been given none</div><div>    In the type declaration for ‘Test1’</div></div><div><br></div><div>Is this a bug or a expected behavior? </div><div>For reference, I could find two fixes to type family related bug in this release.</div><div><a href="https://ghc.haskell.org/trac/ghc/ticket/9433" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/9433</a><br></div><div><a href="https://ghc.haskell.org/trac/ghc/ticket/9316" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/9316</a><br></div><div><br></div><div><br></div><div>Thanks & Regards,</div><div>Magesh B</div><div><br></div><div><br></div></div></div></div>
_______________________________________________<br>ghc-devs mailing list<br><a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br></blockquote></div><br></div></blockquote></div><br></div>
</blockquote></div><br></body></html>