This is a minimal example taken from Reflection-0.5.
{-
In GHCi, I get the following:
>:t Zero Zero :: Zero -> Zero
This makes sense: I am asking for a constructor type that takes zero and returns zero.
>:t reflectNum reflectNum :: (ReifiesNum s, Num a) => proxy s -> a
It makes sense that I could write something like
>let x = Just (undefined::Zero) >reflectNum x
because the Just Zero type corresponds to the proxy server of type variables.
Finally, the confusing part:
>:t (reflectNum Zero) (reflectNum Zero) :: Num a => a
I donβt understand how the constructor type Zero :: Zero β Zero seems to correspond to the proxy server of variable types s, but apparently this is because the type (reflectNum Zero) is just "a".
I would appreciate understanding of this example, as well as links to related concepts.
thanks
source share