I want to define a type for a function that returns its own type...

type F a = a -> (F a,a)

But the compiler gives me an error: "Cycle in type synonym declaration: ...".

Why is this a restriction?

Of course I can create a user defined type, but then I need an extra
mechanism to call the embedded function:

data F a = F (a -> (F a ,a))

call :: F a -> a -> (F a, a)
call (F f) a = f a

-Tom
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to