[clean-list] strictness annotation introduces type error

zuurb078 at planet.nl zuurb078 at planet.nl
Thu Nov 5 09:58:21 MET 2009


The following gives a type error message:
 
splitLine :: ![!Char] -> [String]
splitLine cs 
 # (frst,rest) = span (\a->a<>';') cs
 # str = {c\\c<-frst}
 = case rest of
   [] = [str]
   _ = [str:splitLine (drop 1 rest)]
 
The error messages are:
"Type error [tabellen.icl,53,splitLine]:"argument 1 of splitLine" cannot unify types:
 [!Char]
 [v20]
Type error [tabellen.icl,51,splitLine]:"argument 2 of span" cannot unify types:
 [Char]
 [!Char]
Type error [tabellen.icl,40,procFile]:"argument 1 of splitLine" cannot unify types:
 [!Char]
 [v20]"
 
When I remove the second ! in the type, the errors disappear. I thought that strictness annotations were not supposed to introduce type errors. Is this a disadvantage of the introduction, a couple of years ago, of specific treatment of strict lists, spine strict lists etc.? If so, will this disadvantage be lifted one time?
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/clean-list/attachments/20091105/dda461c8/attachment.html>


More information about the clean-list mailing list