concat :: (Eq a) => [RE a] -> RE a
concat xs = case length xs' of
  0 -> Epsilon
  1 -> head xs'
  _ -> Concat xs'
  where xs' = if any (== EmptySet) xs then []
              else filter (/= Epsilon) xs
concat :: (Eq a) => [RE a] -> RE a
concat xs = case length xs' of
  0 -> Epsilon
  1 -> head xs'
  _ -> Concat xs'
  where xs' = if any (== EmptySet) xs then []
              else filter (/= Epsilon) xs
concat xs = case length xs' of
  0 -> Epsilon
  1 -> head xs'
  _ -> Concat xs'
  where xs' = if any (== EmptySet) xs then []
              else filter (/= Epsilon) xs