"Peter Alexander" <[email protected]> wrote in message
news:[email protected]...
>
> For example, in Haskell, map (correctly) has the signature:
>
> map :: (a -> b) -> [a] -> [b]
>
> but in D, std.map has the signature (expressed in some Haskell/D
> pseudocode)
>
> map :: (a -> b) -> [a] -> Map!((a -> b), [a])
>
That actually brings up something I've found kind of interesting about D's
map and other similar functions. They return a type that's specially-tasked
as "the return type for function {whatever}". So, in a way, it seems almost
like saying:
ReturnTypeOf!(foo) foo()
{...}
Ie, "The return type of this function is defined to be the type this
function returns."
Of course, I realize that's not actually what's going on.