google-code-export / omega

Automatically exported from code.google.com/p/omega
Other
2 stars 0 forks source link

type annotation with :: has strange priority #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would expect that :: binds less than application, but below error message 
shows otherwise:

prompt> Ex (42,show) :: exists a.(a,a->String)
Existential expressions cannot have their type inferred:
   (Ex ((42, show)::exists a . (a ,a -> String )))

Looks like this is parenthesized as Ex ((42,show) :: exists a.(a,a->String)).

Haskell (GHCi) is different:

Prelude> length [] :: Int
0
Prelude> length [] :: [Int]

<interactive>:1:0:
    Couldn't match expected type `[Int]' against inferred type `Int'
    In the expression: length [] :: [Int]
    In the definition of `it': it = length [] :: [Int]

STRANGELY, the same thing does not parse as an Omega command:
prompt> len [] :: Int

I parsed the command:
 len []
But there was some trailing text: :: Int

Original issue reported on code.google.com by ggr...@gmail.com on 28 Jan 2011 at 1:01

GoogleCodeExporter commented 9 years ago
see r801 and r816 (trunk), these may fix this issue

Original comment by ggr...@gmail.com on 29 Aug 2011 at 4:31

GoogleCodeExporter commented 9 years ago
this is not completely resolved yet:

prompt> (Ex (42,show) :: (exists a.(a,a->String))
"keyboard input" (line 1, column 1) tabs []:
unexpected "(" at: "Ex (42,sho...", reserved word "Ex" at: " (42,show)...", or 
":" at: " (exists a..."
expecting: end of input, ":", "let", pattern, or expression

This probably worked earlier:
prompt> (Ex (42,show)) :: exists a.(a,a->String)

(42,<primfun show>) : exists a.(a,a -> [Char])

Original comment by ggr...@gmail.com on 29 Aug 2011 at 5:38

GoogleCodeExporter commented 9 years ago
r821 fixes this:
prompt> Ex (42,show) :: exists a.(a,a->String)  

(42,<primfun show>) : exists a.(a,a -> [Char])

Original comment by ggr...@gmail.com on 29 Aug 2011 at 6:16

GoogleCodeExporter commented 9 years ago
r816 with r821 and r822 finally should fix this

Original comment by ggr...@gmail.com on 29 Aug 2011 at 6:18