I understand haskell's function type declaration like,
length :: String -> Int
prefix :: Int -> String -> String
But sometimes, the types on the right side are not simple types like String
, Integer
but it contains multiple literal words, and the words that look like custom defined etc.
For example, these types defined on this post,
withLocation :: Q Exp -> Q Exp
What does Q, Exp mean?
formatLoc :: Loc -> String
What does Loc mean? Is it part of haskell library?
String
here has kind*
and yourQ
has kind* -> *
meaning: you have to giveQ
a type (something of kind*
) and it will result in something of kind*
(another type) - this is why you have to put both there - it's almost the same as with functions / partial application, ... – Random DevLoc
that Hayoo will find - if you look at the question it will be the one in Language.Haskell.TH I think - how to get emacs to work here is quite another question that depends on your emacs installation and your environment there ... this might be a lot of pain (and I usually don't care - use Hadock instead) – Random Dev