Implement QuantifiedConstraints
[ghc.git] / testsuite / tests / quantified-constraints / T2893a.hs
1 {-# LANGUAGE
2 GADTs
3 , FlexibleContexts
4 , RankNTypes
5 , ScopedTypeVariables
6 , QuantifiedConstraints #-}
7
8 module T2893a where
9
10 import Control.Monad.ST
11 import Data.Array.ST
12
13 sortM
14 :: forall a s.
15 (Ord a, MArray (STUArray s) a (ST s))
16 => [a]
17 -> ST s [a]
18 sortM xs = do
19 arr <- newListArray (1, length xs) xs
20 :: ST s (STUArray s Int a)
21 -- do some in-place sorting here
22 getElems arr
23
24 sortP_3
25 :: (Ord a, forall s. MArray (STUArray s) a (ST s))
26 => [a] -> [a]
27 sortP_3 xs = runST (sortM xs)