関数型プログラミング言語Haskell Part16
■ このスレッドは過去ログ倉庫に格納されています
0771デフォルトの名無しさん
2011/12/20(火) 23:35:56.811. listAをlistA1 ++ [x] ++ listA2にわける
2. listA1とlistBのintersectionを取って判定
f listA listB x =
if y == 0 then 1 else if y == length listB then -1 else 0
where y = length $ takeWhile (/= x) listA `intersect` listB
■ このスレッドは過去ログ倉庫に格納されています