<commit_before>{-
 - This solution works only with ordered lists
 - which was a mistaken assumption about the input
 -}
import Data.Maybe (isJust)
import Control.Monad
import Data.List (foldl1')

isSortedSet :: Ord a => [a] -> Bool
isSortedSet =
    let maybeNext mx my = do
            x <- mx
            y <- my
            guard (x < y)
            return y
        justSorted = (foldl1' maybeNext) . (map Just)
    in isJust . justSorted
    
readSet :: IO [Int]
readSet = do
    n <- readLn
    lines <- replicateM n getLine
    return $ map (read . head . words) lines

fmtOutput True = "Yes"
fmtOutput _ = "No"

main = do
    n <- readLn
    sets <- replicateM n readSet
    let results = map isSortedSet sets
    mapM_ (print . fmtOutput) results<commit_msg>Fully successful Function or Not (hs)<commit_after>import Data.Maybe (isJust)
import Control.Monad
import Data.List (foldl')
import qualified Data.Set as Set

isSortedSet :: Ord a => [a] -> Bool
isSortedSet =
    let maybeNext ms x = do
            s <- ms
            guard (Set.notMember x s)
            return (Set.insert x s)
        justSorted = foldl' maybeNext (Just Set.empty)
    in isJust . justSorted
    
readSet :: IO [Int]
readSet = do
    n <- readLn
    lines <- replicateM n getLine
    return $ map (read . head . words) lines

fmtOutput True = "YES"
fmtOutput _ = "NO"

main = do
    n <- readLn
    sets <- replicateM n readSet
    let results = map isSortedSet sets
    mapM_ (putStrLn . fmtOutput) results
{'fraction_non_alphanumeric': 0.09230769230769231, 'fraction_numerical': 0.0013377926421404682, 'mean_word_length': 2.2879120879120878, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2061031', 'n_tokens_mistral': 497, 'n_tokens_neox': 479, 'n_words': 176}