c_stanto writes:
> [...]
> Error after type deriving/checking:
> Type error type clash between Prelude.2 and Prelude.[]
> when trying to apply function at 24:31 to its 2:nd argument at 24:34.
> [...]
>
> type Entry = (String, String)
> type HashTable = Array Int Entry
>
> [...]
>
> insertEntry :: HashTable -> Entry -> HashTable
Or, expanding the type synonyms, that's
insertEntry :: Array Int (String, String) -> (String, String) -> Array Int (String,
String)
> insertEntry table ent = table // [(1,"Hello")]
According to the Array module
(//) :: Ix a => Array a b -> [(a,b)] -> Array a b
Question 1: In your case, what types do a and b represent?
Question 2: Why doesn't your [(a,b)] match the type of [(1,"Hello")]?
Question 3: Now, what did the compiler mean by Prelude.2 and Prelude.[]?
I hope that helps, but not *too* much. ;-)
Tom