<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think this is #12088. The problem is that open type family instances aren't used in kind checking in the same region of a module. The workaround is to put a top-level Template Haskell splice<div class=""><br class=""></div><div class="">> $(return [])</div><div class=""><br class=""></div><div class="">between the two type instances. This is far from optimal, but fixing it is a Major Project. See <a href="https://ghc.haskell.org/trac/ghc/ticket/12088#comment:15" class="">https://ghc.haskell.org/trac/ghc/ticket/12088#comment:15</a></div><div class=""><br class=""></div><div class="">Richard<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 12, 2018, at 7:47 PM, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" class="">iavor.diatchki@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hello,</div><div class=""><br class=""></div><div class="">I was experimenting with TypeInType and run into a problem, that can be reduced to the following example. Does anyone have any insight on what causes the error, in particular why is `IxKind` not being reduced?</div><div class=""><br class=""></div><div class="">-Iavor</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">{-# Language TypeInType, TypeFamilies #-}</div><div class=""><br class=""></div><div class="">module Help where</div><div class=""><br class=""></div><div class="">import Data.Kind</div><div class=""><br class=""></div><div class="">type family IxKind (m :: Type) :: Type</div><div class="">type family Value (m :: Type) :: IxKind m -> Type</div><div class=""><br class=""></div><div class="">data T (k :: Type) (f :: k -> Type)</div><div class=""><br class=""></div><div class="">type instance IxKind (T k f) = k</div><div class="">type instance Value (T k f) = f</div><div class=""><br class=""></div><div class="">{-</div><div class="">[1 of 1] Compiling Help ( Desktop/Help.hs, interpreted )</div><div class="">Desktop/Help.hs:13:31: error:</div><div class=""> • Expected kind ‘IxKind (T k f) -> *’, but ‘f’ has kind ‘k -> *’</div><div class=""> • In the type ‘f’</div><div class=""> In the type instance declaration for ‘Value’</div><div class=""> |</div><div class="">13 | type instance Value (T k f) = f</div><div class=""> | ^</div><div class="">Failed, no modules loaded.</div><div class="">-}</div></div>
_______________________________________________<br class="">ghc-devs mailing list<br class=""><a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br class=""></div></blockquote></div><br class=""></div></body></html>