[clean-list] unboxed spine strict lists and list comprehensions

John van Groningen johnvg@cs.kun.nl
Fri, 12 Sep 2003 11:47:47 +0200


Isaac Gouy wrote:

>Is there a way to use unboxed spine strict lists in
>list comprehensions?
>
>module test
>import StdEnv, StdOverloadedList, StdStrictLists
>
>Start = Length b
>	where
>	a = [# x \\ x <- [1..5] !]
>	b = [# x+1 \\ x <- a !]
>
>Type error [test.icl,6,comprehension]: cannot unify
>[Int] with [#v3!]

Yes, use <|- (for an overloaded list) instead of <- (for a lazy list):

	b = [# x+1 \\ x <|- a !]

Regards,

John van Groningen