Hey,
I am trying to write a monad for monax
(
https://github.com/sledorze/monax) that uses the tink_core "Surprise"
class.
It all works well, when I assume a fixed type for the Failure (in my
case, String). But I want it to be more flexible, variating the Failure
type with a type parameter.
Now, the "Failure" type of the Surprises is passed as a type Parameter
for the MonadSurprise. So the code starts like this:
class MonadSurprise<F> {
public static function monad<T>(f : Surprise<T, F>) return
MonadSurprise<F>;
...
}
But that does not work, I get this error:
Unexpected ;
Why? Can I not use it this way? Or am I syntacticly doing something
wrong? The function is returning a class, can that not be done with
type-parametrized classes?
Thanks!
Nathan