
23 Jul
2012
23 Jul
'12
5:11 a.m.
Am 21.07.2012 14:30, schrieb Twan van Laarhoven:
Would the following type work?
data Delimiter a = DelimEltPred (a -> Bool) | DelimSublistPred [a -> Bool]
You can go from the current DelimSublist to DelimSublistPred with just `map (==)`. And is the distinction between the DelimEltPred and DelimSublistPred then still needed at all?
Does it not make sense then, to reuse the DelimSublistPred variant with a singleton list for the DelimEltPred case? (I suppose empty lists must be excluded anyway). newtype Delimiter a = Delimiter [a -> Bool] C.
Twan