<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes, I’ve looked through this file, but it seems to me that I can't use anything there in my function.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">22 мая 2018 г., в 18:52, Nicolas Frisby <<a href="mailto:nicolas.frisby@gmail.com" class="">nicolas.frisby@gmail.com</a>> написал(а):</div><br class="Apple-interchange-newline"><div class="">Hi Alice.<div class=""><br class=""></div><div class="">I'm having trouble following your question -- I'm not familiar with the internals of fingerprint generation.</div><div class=""><br class=""></div><div class="">But, have you scoured the compiler/typecheck/TcTypeable.hs file? It seems likely to have similar logic to what you seem to be seeking.</div><div class=""><br class=""></div><div class="">HTH. -Nick<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, May 22, 2018, 06:38 alice <<a href="mailto:alicekoroleva239@gmail.com" class="">alicekoroleva239@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">Hello again. I’m trying to make a function in a type-checking plugin that takes TyCoRep#Type and makes its fingerprint that matches `typeRepFingerprint (typeRep :: TypeRep (type))`. As I understood the type’s fingerprint is made in DsBinds#dsEvTypeable by generating a code that makes the fingerprint, so I can’t reuse functions which are already written.</div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69);min-height:14px" class=""><br class=""></div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">My goal is to write a function that makes fingerprints of types which are not type variables such as Int, Maybe Int, ‘[Int] etc. So I tried to follow `mkTrCon` and `mkTrApp` style, and I think I managed to process simple types like Int, Maybe Int — right now I’m processing TyConApp only. But when I tried to make promoted data fingerprint like ‘[Int] I faced some problems. </div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69);min-height:14px" class=""><br class=""></div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">For example, for making `’Just Int` fingerprint first I have to compute 'Just fingerprint by computing  'Just tyCon’s and * fingerprints, then combining them into one fingerprint. Then I have to apply ‘Just to Int. But when I try to do something like that while type checking I cannot separate two cases that match runtime’s`TypeRep (a b)` (a representation for a type application) and `TypeRep a` (a representation for a type constructor) because they are represented by TyConApp. Also I can’t separate tyCon kinds and types for type application because they are merged into one list which is stored in `TyConApp _ [KindOrType]`. [KindOrType] list for `’Just Int` is `[*, Int]`. Is there any way to separate this two cases and kinds/types?</div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69);min-height:14px" class=""><br class=""></div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">Probably there is an easier way to make this function? If not, does type fingerprint function seem possible to make?</div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69);min-height:14px" class=""><br class=""></div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">Any help would be appreciated,</div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69);min-height:14px" class=""><br class=""></div><div style="margin:0px;line-height:normal;font-family:'Helvetica Neue';color:rgb(69,69,69)" class="">Alice.</div></div>_______________________________________________<br class="">
ghc-devs mailing list<br class="">
<a href="mailto:ghc-devs@haskell.org" target="_blank" class="">ghc-devs@haskell.org</a><br class="">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></div></body></html>