
7 Oct
2004
7 Oct
'04
6:38 a.m.
Keith Wansbrough
Instead, you should pass around data items that contain both the function and its name - either just pairs, [...] or proper data types
...or both, using records: data NamedFunc a b = NamedFunc { nameOf :: String, apply :: (a->b) } f = NamedFunc "successor" (\x -> x+1) apply f 4 => 5 nameOf f => "successor" -kzm -- If I haven't seen further, it is by standing in the footprints of giants