I could not understand where there problem is, is it the a
CodePudding user response:
Whatever weird left-arrow character you're using, it isn't one GHC understands. Just write <-
like it's the '90s again.
CodePudding user response:
You can enable the left arrow (←) by enabling the UnicodeSyntax
extension [ghc-doc]:
{-# LANGUAGE UnicodeSyntax #-}
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = smaller x : larger
where
smaller = [ a | a ← xs, a <= x ]
larger = [ a | a ← xs, a > x ]
you can transform additional arrows with:
{-# LANGUAGE UnicodeSyntax #-}
qsort ∷ Ord a ⇒ [a] → [a]
qsort [] = []
qsort (x:xs) = smaller x : larger
where
smaller = [ a | a ← xs, a <= x ]
larger = [ a | a ← xs, a > x ]