List of primes

15 views
Skip to first unread message

Kishlaya Jaiswal

unread,
Nov 12, 2019, 12:50:39 PM11/12/19
to liquidhaskell
I was trying to add/fix the type signature for the function `primes` (as defined on the homepage of Haskell)

While doing so, I found that the following code doesn't typecheck:

{-@ grt2::[Nat] @-}
grt2
:: [Int]
grt2
= [2..]


It throws the following error: 

Liquid Type Mismatch

 5 | grt2 = [2..]
     ^^^^^^^^^^^^
  
   Inferred type
     VV : GHC.Types.Int
  
   not a subtype of Required type
     VV : {VV : GHC.Types.Int | VV >= 0}

Can somebody please help me how to fix this?
Reply all
Reply to author
Forward
0 new messages