There is a theory of grammar that maps sentences onto logical functions,
but this theory has trouble handling quantifiers like "everyone",
"someone", and "only". If I want to parse "Matt spoke", I can treat
"Matt" as an individual and treat "spoke" as a function that maps an
individual onto a truth value (given X, did X speak?). But if I use the
same system to parse "Everyone spoke", "everyone" is not an individual
but a function in itself (given an individual X and an action Y, did X
do Y?). Furthermore, if we turn to the sentence "Matt spoke to
everyone", it seems like we need to interpret "everyone" as a function
of another type.