[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] wildcards for type variables?

Subject: Re: [Haskell-cafe] wildcards for type variables?
From: Ivan Lazar Miljenovic
Date: Thu, 14 Jan 2010 23:24:55 +1000
Ozgur Akgun <[email protected]> writes:

> Can someone give an example of a "reasonable" function that never uses one
> of its parameters, and justify the existence of that parameter in this case,
> please?

I would like to bring your attention to the "const" function:

,----
| const     :: a -> b -> a
| const a _ = a
`----

For justification, I often use this function when I need to provide a
function that takes two arguments by the function I want to use only
needs one; as such either const of (flip const) can let me absorb and
ignore the unneeded argument.

Satisfied? ;-)

-- 
Ivan Lazar Miljenovic
[email protected]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>