When running the command, liquid --totality MyFile.hs, I end up maxing out my RAM (8 GB) and swap drive and eventually the process is killed.
**** DONE: Parsed All Specifications ******************************************
**** DONE: Loaded Targets *****************************************************
Killed
Another file in the same project runs fine. Also, this same file was working earlier. I have narrowed the problem down to this function that I recently included-
sortElementSymbolMap :: Map ElementSymbol Int -> [(ElementSymbol, Int)]
sortElementSymbolMap m = sortBy (hillSystem fst) elementSymbolIntList
where
elementSymbolIntList = toList m
elementSymbols = fst <$> elementSymbolIntList
containsC = C `elem` elementSymbols
hillSystem f a b = case (f a, f b) of
(C, _) -> LT
(_, C) -> GT
(H, b') -> if containsC then LT else (show . elementName) H `compare` show b'
(a', H) -> if containsC then GT else show a' `compare` (show . elementName) H
(a', b') -> show a' `compare` show b'
Any ideas why this function and liquid haskell aren't getting along?