Why is there no list-style infinite type error when I define something like this in Haskell (GHC)?
data Broken = Broken { title :: String,
loop :: Broken }
It compiles without a type error, but clearly it’s an unusable type: I’d have to define
foo = Broken "one" (Broken "two" (Broken "three" …
There’s nothing broken about it. It’s perfectly possible to define a value of that type:
Basically it’s the same thing as defining a list type that has no nil value (which is also perfectly legal). It’s perfectly possible to define values of that type, but all such values will have to be infinite.