Tao Yang
2016-06-04 18:13:41 UTC
Hi,
I run into a problem while trying to add type annotations to funcool/cats
<https://github.com/funcool/cats>. I started with two very basic things,
monoid and semigroup. There is a type error on this line of test
<https://github.com/kazuhiro/cats.typed/compare/master...taojang:semigrp-monoid?expand=1#diff-310f7584031fe976c61d2f632f676e70R23>
Type Error (cats/typed/core.clj:24:21)
Type mismatch:
Expected: (t/All [x] (t/Option (t/I Context (t/U (Semigroup x) (Monoid x
)))))
Actual: (t/I Context (Monoid t/Bool))
Type Error (cats/typed/core.clj:24:3)
Function cats.protocols/-get-level could not be applied to arguments:
Domains:
Context
Arguments:
(t/All [x] (t/Option (t/I Context (t/U (Monoid x) (Semigroup x)))))
Ranges:
t/Num
For me as someone with no exposure to type theory,
(I Context (Monoid Bool))
does not contradict to
(All [x] (Option (I Context (U (Monoid x) (Semigroup x)))))
However I think it's more likely that I've done something stupid. Any idea
please?
Thanks,
Tao
I run into a problem while trying to add type annotations to funcool/cats
<https://github.com/funcool/cats>. I started with two very basic things,
monoid and semigroup. There is a type error on this line of test
<https://github.com/kazuhiro/cats.typed/compare/master...taojang:semigrp-monoid?expand=1#diff-310f7584031fe976c61d2f632f676e70R23>
Type Error (cats/typed/core.clj:24:21)
Type mismatch:
Expected: (t/All [x] (t/Option (t/I Context (t/U (Semigroup x) (Monoid x
)))))
Actual: (t/I Context (Monoid t/Bool))
Type Error (cats/typed/core.clj:24:3)
Function cats.protocols/-get-level could not be applied to arguments:
Domains:
Context
Arguments:
(t/All [x] (t/Option (t/I Context (t/U (Monoid x) (Semigroup x)))))
Ranges:
t/Num
For me as someone with no exposure to type theory,
(I Context (Monoid Bool))
does not contradict to
(All [x] (Option (I Context (U (Monoid x) (Semigroup x)))))
However I think it's more likely that I've done something stupid. Any idea
please?
Thanks,
Tao