<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks!  Yes, that introduces the idea that requires kind
      inference.</p>
    <p>Interestingly, it contains a (kind-aware) type-inference
      algorithm, but no kind inference algorithm!</p>
    <p>Perhaps kind-inference is considered too "obvious" to require an
      algorithm.  The closest it comes is the rule:</p>
    <p>C :: k' -> k   and   C' :: k'  => C C' :: k</p>
    <p>This is helpful, but it would probably be beneficial for better
      documentation to exist SOMEWHERE.<br>
    </p>
    <p>-BenRI<br>
    </p>
    <div class="moz-cite-prefix">On 10/13/21 3:49 PM, Ingle, Apoorv N
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:582D1DA7-EBBE-4E52-8683-7444C2FE606D@uiowa.edu">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Along with what Emil suggests, 
      <div class="">Sec 4. of A system of constructor classes:
        overloading and implicit higher-order polymorphism[1] may also
        be useful.</div>
      <div class=""><br class="">
      </div>
      <div class="">— Apoorv</div>
      <div class=""><br class="">
      </div>
      <div class="">[1]:  <a
          href="http://web.cecs.pdx.edu/~mpj/pubs/fpca93.pdf"
          class="moz-txt-link-freetext" moz-do-not-send="true">http://web.cecs.pdx.edu/~mpj/pubs/fpca93.pdf</a> <br
          class="">
        <div><br class="">
        </div>
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On Oct 13, 2021, at 14:22, Emil Axelsson <<a
                href="mailto:78emil@gmail.com"
                class="moz-txt-link-freetext" moz-do-not-send="true">78emil@gmail.com</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="">
                <p class="">Maybe <a moz-do-not-send="true"
href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.134.7274&rep=rep1&type=pdf"
                    class="">
                    Typing Haskell in Haskell</a> is what you're looking
                  for?<br class="">
                </p>
                <pre class="moz-signature" cols="72">/ Emil</pre>
                <div class="moz-cite-prefix">Den 2021-10-12 kl. 21:35,
                  skrev Benjamin Redelings:<br class="">
                </div>
                <blockquote type="cite"
                  cite="mid:34939fd9-e592-315a-114b-f1f6d1fef686@gmail.com"
                  class="">
                  Hi, <br class="">
                  <br class="">
                  1. I'm looking for resources that describe how to
                  implement kind Haskell 98 checking.  Does anyone have
                  any suggestions?
                  <br class="">
                  <br class="">
                  * I've looked at the PolyKinds paper, but it doesn't
                  cover type classes. <br class="">
                  <br class="">
                  * I've looked at the source code to GHC, but it is
                  hard to follow for a variety of reasons.  It isn't
                  laid out like an algorithm description, and the
                  complexity to handle options like PolyKinds and
                  DataKinds makes the code harder to follow.
                  <br class="">
                  <br class="">
                  <br class="">
                  2. One question that came up is how to handle type
                  variables that are present in class methods, but are
                  not type class parameters. If there are multiple
                  types/classes in a single recursive group, the kind of
                  such type variables might not be fully resolved until
                  a later type-or-class is processed.  Is there a
                  recommended approach? <br class="">
                  <br class="">
                  I can see two ways to proceed: <br class="">
                  <br class="">
                  i) First determine the kinds of all the data types,
                  classes, and type synonyms.  Then perform a second
                  pass over each type or class to determine the kinds of
                  type variables (in class methods) that are not type
                  class parameters.
                  <br class="">
                  <br class="">
                  ii) Alternatively, record the kind of each type
                  variable as it is encountered -- even though such
                  kinds may contain unification kind variables.  After
                  visiting all types-or-classes in the recursive group,
                  replace any kind variables with their definition, or
                  with a * if there is no definition. <br class="">
                  <br class="">
                  I've currently implement approach i), which requires
                  doing kind inference on class methods twice.  Is this
                  the recommended approach?
                  <br class="">
                  <br class="">
                  <br class="">
                  3. Also, is Haskell 98 kind checking the same as
                  Haskell 2010 kind checking? <br class="">
                  <br class="">
                  -BenRI <br class="">
                  <br class="">
                  <br class="">
                  _______________________________________________ <br
                    class="">
                  Haskell-Cafe mailing list <br class="">
                  To (un)subscribe, modify options or view archives go
                  to: <br class="">
                  <a class="moz-txt-link-freetext"
                    href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
                    moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
                  <br class="">
                  Only members subscribed via the mailman list are
                  allowed to post.<br class="">
                </blockquote>
              </div>
              _______________________________________________<br
                class="">
              Haskell-Cafe mailing list<br class="">
              To (un)subscribe, modify options or view archives go to:<br
                class="">
              <a
                href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
                class="moz-txt-link-freetext" moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br
                class="">
              Only members subscribed via the mailman list are allowed
              to post.</div>
          </blockquote>
        </div>
        <br class="">
      </div>
    </blockquote>
  </body>
</html>