class (Foldable t) <= Unconsable t where
The only requirement for instances of this class is that
checkUnconsableLaws must return
true for all possible values.
checkUnconsableLaws t = unconsableLength t == length t :: Int
longestTail :: forall t1 t2 a b. Unconsable t1 => Unconsable t2 => t1 a -> t2 b -> Maybe (Either (t1 a) (t2 b))
If two lists have equal lengths, returns nothing.
If one of the lists is longer than the other, cuts the longer list at the
index equal to the length of the shorter list and returns the rest of it
Either, to allow passing lists of different types).
You may want to use
longestTail' instead, to avoid dealing with
longestTail   == Nothing longestTail  [1,2] == (Just (Right [1,2])) longestTail [1,2,3,4] [1,2] == (Just (Left [3,4])) longestTail [1,2,3,4,5] [1,2,3,4,5] == Nothing