[Haskell-beginners] definition of combinator

Jan Jakubuv jakubuv at gmail.com
Mon Aug 24 06:23:29 EDT 2009


Hi Michael,

On Sun, Aug 23, 2009 at 05:44:27PM -0700, Michael Mossey wrote:
> "A combinator is a higher-order function that uses only function
> application and earlier defined combinators to define a result from its
> arguments."
> 
> Okay, so I believe a "higher-order function" is a function that takes 
> function(s) as its argument(s). I don't know what "uses only function 
> application" means. Application of what functions to what? 

Briefly, a combinator applies “earlier defined combinators” to “its
arguments”. But remember that a combinator's argument can be a function as
well, so it may become more complicated. Then it simply applies functions
(other combinators, combinator's arguments, library functions) to their
arguments (other combinators, combinator's arguments, library functions,
constants, ...).

Finally, I guess that the word “only” suggests that it doesn't read any
parsed text by itself but it only calls (combine) other parsers.

Sincerely,
    Jan.



-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.



More information about the Beginners mailing list