
14 Jan
2010
14 Jan
'10
8:31 a.m.
Ozgur Akgun
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?
E.g, 'const' is useful when you need something to feed to a higher order function: -- an element <=3 starts a new group *Main> groupBy (const (>3)) [1,2,3,4,1,5,6] [[1],[2],[3,4],[1,5,6]] Not the best example, perhaps, but the existence of const allows you to easily reuse existing framework. There's also 'par', although it's raison d'ĂȘtre is to have an effect on the second parameter, so it is arguably "using" it. -k -- If I haven't seen further, it is by standing in the footprints of giants