Why do we need 3 Vector3 types?
#13
I'm thinking more about the programmers interface, some concepts are really hard to translate. For example C++ and Haskell.
How do you translate this function:
Code:
template<class T...>
std::tuple<Baz<T>::type...> foo (T... x)
{
    return std::make_tuple<Baz<T>::type...>(bar(x)...)
}

Haskell has no concept of varadics, and I'm sure that working out the Haskell type constraints for this (which is required to make return type inference work) is at least equivalent to the halting problem, if not impossible.

Or another example, Haskell to C#.

Code:
class Foo a where
    bar :: int -> a

instance Foo Baz where
    bar = something

instance Foo Blah where
    bar = something

A different implementation for bar is invoked depending on the type of the returned value. I'm pretty sure you cannot express that in C#.
Reply
Thanks given by:


Messages In This Thread
Why do we need 3 Vector3 types? - by Shadowraix - 06-10-2015, 09:06 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-10-2015, 09:36 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-10-2015, 10:11 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-11-2015, 12:13 AM
RE: Why do we need 3 Vector3 types? - by worktycho - 06-16-2015, 03:58 AM



Users browsing this thread: 11 Guest(s)