在Haskell中,以下内容将打印" hello":putStrLn (['h', 'e', 'l', 'l', 'o'])
,但这会导致Idris中的编译错误:
48 | main = do
| ~~ ...
When checking right hand side of main with expected type
IO ()
When checking an application of function Prelude.Interactive.putStrLn:
Can't disambiguate since no name has a suitable type:
Prelude.List.::, Prelude.Stream.::
我怀疑这是因为String
是伊德里斯的内置,而不是哈斯克尔。仍然可以在Idris中使用类型类将List Char
视为String
的实例(String
是一个类型类吗?)