-- file: ch16/HttpRequestParser.hs
p_request :: CharParser () HttpRequest
p_request = q "GET" Get (pure Nothing)
<|> q "POST" Post (Just <$> many anyChar)
where q name ctor body = liftM4 HttpRequest req url p_headers body
where req = ctor <$ string name <* char ' '
url = optional (char '/') *>
manyTill notEOL (try $ string " HTTP/1." <* oneOf "01")
<* crlf
The above snippet is meant for parsing a http request..
variable ctor is seen on the left side and the right side,
q name ctor body = liftM4 HttpRequest req url p_headers body --- ctor assigned a value
where req = ctor <$ string name <* char ' ' --- ctor used as a function
And the variable name is as well seen on LHS and RHS.
And <$> maps all list elements to a constant value. In this context,
ctor <$ string name <* char ' '
what does it return?