linear-types icon indicating copy to clipboard operation
linear-types copied to clipboard

(->.) is reported as problem, but ⊸ is something different

Open varosi opened this issue 6 years ago • 4 comments

I have ran tweag/linear-types latest Docker image. This program:

t :: Int ->. Int
t = undefined

without LinearTypes LANGUAGE pragma is complaining with a message:

test.hs:2:10: error: Enable LinearTypes to allow linear functions

but this program, gives different strange error:

t :: Int ⊸ Int
t = undefined

test.hs:2:10: error: Not in scope: type constructor or class ‘⊸’

I think that both should return the same error of missing LinearTypes pragma, isn't it?

varosi avatar Jun 20 '19 19:06 varosi

You need to enable UnicodeSyntax.

monoidal avatar Jun 20 '19 19:06 monoidal

Just to check consistency, are there other extensions which enable some unicode syntax? If so what error message do they give when trying to use the unicode syntax without -XUnicodeSyntax?

aspiwack avatar Jun 21 '19 07:06 aspiwack

@monoidal Thanks! But don't you think this extension should be included by default? And why not?

varosi-chaosgroup avatar Jun 21 '19 12:06 varosi-chaosgroup

It's interesting, that:

t :: Int ⊸ (Int, Int)
t a = (1, 1)

Gives that error:

Couldn't match expected multiplicity ‘'One’ of variable ‘a’ with actual multiplicity ‘'Omega’

Instead of multiplicity of Zero.

varosi-chaosgroup avatar Jun 21 '19 12:06 varosi-chaosgroup