You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modulehello.HelloWorldwheretypeOmegas=ssdataConsab=ConsabtypeStreama=Omega (Consa)
--infinite :: a -> Stream a--infinite x = Cons x (infinite x)dataConstab=Const{getConst::a}
although, Omega type should clearly produce a "cyclic kind" error.
If we uncomment the infinite function, then compiler complains on Stream type.
GHC will yell on the Omega itself, which is the best behaviour for me.
The text was updated successfully, but these errors were encountered:
Yes, currently the compiler only checks that the type definitions don't construct cycles. As long as you don't use them, you can write utter nonsense on the RHS.
The next code compiles fine:
although,
Omega
type should clearly produce a "cyclic kind" error.If we uncomment the
infinite
function, then compiler complains onStream
type.GHC will yell on the
Omega
itself, which is the best behaviour for me.The text was updated successfully, but these errors were encountered: