cyp icon indicating copy to clipboard operation
cyp copied to clipboard

theory syntax should allow type declarations

Open jwaldmann opened this issue 7 years ago • 6 comments

Not a bug. But I'd appreciate hints on how this feature could be implemented (relative to the current code base) most easily.

I want to write

inorder :: Tree a -> List a

right next to the actual definitions (current parser simply rejects this). For my own sanity, for documentation, and because I recommend this coding style to my students.

jwaldmann avatar Mar 23 '17 15:03 jwaldmann

Do you want the type signatures to be actually checked? Or do they merely have documentation status?

larsrh avatar Mar 23 '17 15:03 larsrh

Checked. Cyp does type inference anyway?

jwaldmann avatar Mar 23 '17 15:03 jwaldmann

No. Cyp is completely untyped.

larsrh avatar Mar 23 '17 15:03 larsrh

Ah, I see.

jwaldmann avatar Mar 23 '17 15:03 jwaldmann

I just found this: haskell-tc. So it could be implemented. But I don't see myself having the time to do it 😦

larsrh avatar Mar 23 '17 15:03 larsrh

Sure. I was not implying that you should to it. Also, we don't need full Haskell typing here, plain Hindley-Milner will do.

jwaldmann avatar Mar 23 '17 16:03 jwaldmann