Skip to content

Instantly share code, notes, and snippets.

@smatting
Last active December 10, 2020 07:53
Show Gist options
  • Save smatting/17df76579300314c43f4bbceaefaf552 to your computer and use it in GitHub Desktop.
Save smatting/17df76579300314c43f4bbceaefaf552 to your computer and use it in GitHub Desktop.
My questions for bolt12's Article on Denotational Semantics

Questions on https://github.com/bolt12/advent-of-haskell-dd

In the the section "Calculating an implementations":

  1. I'm not sure if I undertand the paragraph under the 'IsStack' class definition. If I try to use my own words I understood it as:

    You can get Functor implementation for s for free by using using two facts

    • the Homomorhism Property for mu: mu (fmap f s) = fmap f (mu s)
    • mu and mu' are inverse

    Is that correct?

  2. I'm puzzled by this result:

-- Result:
-- fmap f []    = []
-- fmap f (h:t) = f h : t

Does this mean f would only get applied to head? Isn't that an incorrect Functor implementation for a stack?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment