ghci> take 10 (buildList (\x -> x * x)) [0,1,4,9,16,25,36,49,64,81] Perhaps more frequently, this is used when we want to partially apply the second argument of a function that will be used higher-order, like in the first example: ghci> map (flip map [1, 2, 3]) [ (+ 1), (* 2)] [ [2,3,4], [2,4,6]] And because of currying you can do stuffs like this in which it takes one argument as a parameter and doesn't throw compile error: λ> let a = map (+ 3) This is part three in a series of tutorials on programming Haskell. The map function is polymorphic and its type indicates clearly that its first argument is a function; note also that the two a 's must be instantiated with the same type (likewise for the b 's). The list of integers numbers . Haskell functions can take functions as parameters and return functions as return values. map function application over a list of functions. Use the curry function (from Prelude or Data.Tuple) to convert a function that takes tuples to a function that takes two arguments. Haskell infers the types. Map module in Haskell programming language. Haskell series part 1 Function composition can be implemented using any two functions, provided the . Haskell: Types & Functions However, this argument may be a list, or the function may return another function that takes the next argument. Similarly, an expression like between 1 2 3 is the same as ((between 1) 2) 3, so passing multiple arguments to a function happens via multiple single-argument calls. Tutorials/Programming Haskell/Argument handling - HaskellWiki Haskell Answers 5: map and lter Antoni Diller 4 August 2011 (1) The type String is the same as [Char]. haskell map function with 2 arguments - helpucare.net Haskell is a functional programming language, which means that functions can be passed in as arguments and returned from functions. An identifier will be treated as an operator symbol if it is enclosed in backquotes: "`" . The number of arguments we generally talk about functions taking is actually the number of one-argument functions we get between the first argument and a final, non-functional result value. Try it: sq x = x * x main = print $ -- show (sqrt . All operators are functions. Here we call sum, our previously defined two-parameter function, with only one argument and receive a new function. Functions----- A simple function that takes two variables add a b = a + b-- Note that if you are using ghci (the Haskell interpreter)-- You'll need to use `let`, i.e.-- let add a b = a + b-- Using the function add 1 2-- 3-- You can also put the function name between the two arguments-- with backticks: 1 ` add ` 2-- 3-- You can also define . . A map is a higher-order function that requires an array and another function. Intro to Haskell Syntax - Andrew Gibiansky Previously we simply used spaces to delimit our arguments but here we call print on powerOfX with two arguments so we need to explain what function is called with what parameters. PDF Haskell Answers 5: map and - Cantab.net 2 pseq :: a −> b −> b The function par indicates to the Haskell run-time system that it may be benefi-cial to evaluate the first argument in parallel with the second argument. Here is a simple program to read and then print a character: main :: IO () main = do c <- getChar. not is a function: it takes a boolean value, and negates it.