All pastes #709670 Raw Edit

Mine

public text v1 · immutable
#709670 ·published 2007-09-24 21:22 UTC
rendered paste body
  18 overlap :: ([a], [a], [a]) -> ([a], [a], [a])
  19 overlap (as, bs, cs) =
  20     if bs == take (length bs) cs then (as, bs, (drop (length bs) cs))
  21     else if (length bs) > 1 then overlap (as:[head bs]) (tail bs) cs
  22     else ([], [], [])




m.hs:21:43:
    Couldn't match expected type `[a]'
           against inferred type `a' (a rigid variable)
      `a' is bound by the type signature for `overlap' at m.hs:18:13
      Expected type: [a]
      Inferred type: a
    In the expression: head bs
    In the second argument of `(:)', namely `[head bs]'
Failed, modules loaded: none.