I have this Haskell function that uses "case of", but I am trying to figure out if it's possible to rewrite this function using guards("|") and not "case of". Is it possible ? Any suggestion would be helpful.
lefQ :: Ord a => LOL a -> Lang a -> Lang a
lefQ (LOL i xs) [] = []
lefQ (LOL i xs) (LOL j y:ys) = case stripPrefix xs y of
Nothing -> leftq (LOL i xs) ys
Just zs -> (LOL (j-i) zs):lefQ (LOL i xs) ys