16 Matching Annotations
  1. Oct 2020
    1. abstracted interfaces, where the implementations can be changed and multiple implementations could be created and polymorphically substituted for each other.
    1. Be aware that compilers typically, but not always, return string. Some compilers, such as the one configured with rehype-react, return other values (in this case, a React tree).
  2. Sep 2020
    1. This would be a component that is meant to be styled by its parents, and it would make no logical sense to have every possible type of style available inside the Link component. If I wanted to turn one of these anchor tags into a button, another into a nav-link, and another into a footer link, I should be able to. There's no reason that there shouldn't be a feature to treat a component like a normal HTML element.
  3. Aug 2020
    1. Commonly the above definition is called the identity function. But in fact we should think of it as a whole family of functions. We should really say that id is an identity function for all types a. In other words, for every type T you might come up with, there is an identity function called id, which is of type T -> T. This is the type-checker’s view anyway, and by turning on the RankNTypes extension we can be explicit about that in our code: {-# LANGUAGE RankNTypes #-} id :: forall a. a -> a id x = x

      This is such a nice description of forall. It should be combined with forall is the type-level "lambda" (also saved it here).

    2. In other words you cannot choose the definition of a value based on its type (for now).

      What does this mean?

  4. Jul 2020
    1. Sapoval, N., Mahmoud, M., Jochum, M. D., Liu, Y., Elworth, R. A. L., Wang, Q., Albin, D., Ogilvie, H., Lee, M. D., Villapol, S., Hernandez, K., Berry, I. M., Foox, J., Beheshti, A., Ternus, K., Aagaard, K. M., Posada, D., Mason, C., Sedlazeck, F. J., & Treangen, T. J. (2020). Hidden genomic diversity of SARS-CoV-2: Implications for qRT-PCR diagnostics and transmission. BioRxiv, 2020.07.02.184481. https://doi.org/10.1101/2020.07.02.184481

  5. Apr 2020
    1. the Add functions seem to work generically over various types when looking at the invocations, but are considered to be two entirely distinct functions by the compiler for all intents and purposes
    2. chose the term ad hoc polymorphism to refer to polymorphic functions that can be applied to arguments of different types, but that behave differently depending on the type of the argument to which they are applied (also known as function overloading or operator overloading)
    1. A language that features polymorphism allows developers to program in the general rather than program in the specific. $(document).ready(function() { recordAdModuleData(2964, "impressions","Dictionary Ad"); });
    2. polymorphism cuts down the work of the developer because he can now create a sort of general class with all the attributes and behaviors that he envisions for it. When the time comes for the developer to create more specific subclasses with certain unique attributes and behaviors, the developer can simply alter code in the specific portions where the behaviors differ. All other portions of the code can be left as is.
  6. Aug 2019
    1. export function assignForwardedRefs(forwardedRef, refToAssign) { if (forwardedRef) { if (typeof forwardedRef === 'function') { forwardedRef(refToAssign) } else { forwardedRef.current = refToAssign } } }

      I don't fully understand when you might need this, but it could come in handy.

      I assumed you could forward refs the same whether they are callbacks or Ref objects, but maybe not??

  7. Jul 2019
  8. Jan 2018
  9. Aug 2016
    1. Here the method subtypePolymorphic() has no type parameters, so it’s parametrically monomorphic. Nevertheless, it can be applied to values of more than one type as long as those types stand in a subtype relationship to the fixed Base type which is specified in the method signature — in other words, this method is both parametrically monomorphic and subtype polymorphic.