[Haskell-cafe] Data creation pattern?

Stephen Tetley stephen.tetley at gmail.com
Thu May 13 11:43:26 EDT 2010


Hi Eugene

You don't need to supply all the arguments to a constructor at once:

makeWithOne :: String -> (String -> String -> Object)
makeWithOne s1 = \s2 s3 -> Object s1 s2 s3

-- or even:
-- makeWithOne s1 = Object s1

This builds a higher-order function that can be applied later to two
Strings to finally make the Object.

Best wishes

Stephen


More information about the Haskell-Cafe mailing list