<div dir="ltr"><div>In light of the mentioned patch, I prefer to freeze my activity about the unification of Nat and Natural up to the merging this patch. After that, I am going to rebase my branch and make MR. Thank you, Ben! </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 15 июн. 2020 г. в 00:32, Ben Gamari <<a href="mailto:ben@well-typed.com">ben@well-typed.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Rinat Stryungis <<a href="mailto:lazybonesxp@gmail.com" target="_blank">lazybonesxp@gmail.com</a>> writes:<br>
<br>
> Hi. I have a question about a possible way of unification of Nat and<br>
> Natural. I've almost done that, but only in case of using integer-gmp.<br>
> If I use integer-simple there is a completely different definition of<br>
> Natural.<br>
><br>
> How I construct now naturalTyCon (to make `naturalTy` to use it instead of<br>
> `typeNatKind`) :<br>
><br>
> ```naturalTyCon :: TyCon<br>
> naturalTyCon = pcTyCon naturalTyConName Nothing [] [natSDataCon,natJDataCon]<br>
><br>
> natSDataCon :: DataCon<br>
> natSDataCon = pcDataCon natSDataConName [] [wordPrimTy] naturalTyCon<br>
><br>
> etc...<br>
> ```<br>
> Now I have to check`DynFlags` in a few places to reimplement `naturalTyCon`<br>
> in case of using `integer-simple`.<br>
><br>
> Is there a way to avoid hardcoding of `naturalTy`?<br>
> My colleague said that it would be nice to get `naturalTy` from an<br>
> environment by  something like `lookupTyCon`,<br>
> but there are many functions whose don't use any environment like functions<br>
> from `typeNatTyCons` list in `GHC.Builtin.Types.Literals`.<br>
><br>
> Now I am going to use `DynFlags` checking, but it looks like an ugly way...<br>
<br>
Note that all of this will be moot in a matter of days. The ghc-bignum<br>
patch, which will ship in 8.12, removes integer-simple and uses a<br>
consistent number representation across its various supported backends.<br>
<br>
In light of this, if I were you I would probably just settle for a hack<br>
in the meantime.<br>
<br>
Cheers,<br>
<br>
- Ben<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span style="color:rgb(136,136,136)">--</span><br style="color:rgb(136,136,136)"><div dir="ltr" style="color:rgb(136,136,136)">Best regards.</div><div dir="ltr" style="color:rgb(136,136,136)">Rinat Striungis </div></div>