[clean-list] unique arrays in unique records

John van Groningen johnvg at cs.ru.nl
Tue Apr 4 16:34:55 MEST 2006


Diederik van Arkel wrote:

>Using a head and tail strict list for your found boards enables you to fix this
>(I would have expected head strict to have been enough here):
>
>..
>	seek s=:{board = b, wanted = w, found = f} i
>		#! found = [!{b.[i] \\ i <-: b} : f!]
>		= { s
>		  & board = { b & [i] = w }
>		  , wanted = w - 1
>		  , found = found
>		  }

Head strictness is not enough here, because observation typing requires
a fully evaluated (or polymorphic) result. If you use #! for the array
only, instead of for the list, you don't have to use a head and tail strict
list:

		#! bia = {b.[i] \\ i <-: b}
		= { s
		  & board = { b & [i] = w }
		  , wanted = w - 1
		  , found = [bia : f]
		  }

Kind regards,

John van Groningen


More information about the clean-list mailing list