|
definition: |
getCPUModel :: IO String
getCPUModel = do
cpuinfo <- readFile "/proc/cpuinfo"
let modelnames = filter (\ s -> take 2 (words s) == ["model","name"])
(lines cpuinfo)
return (if null modelnames
then "???"
else let (_,mname) = break (==':') (head modelnames)
in if null mname then "???"
else strip (delCRTM (tail mname)))
where
delCRTM s = case s of
[] -> []
'(':'R':')':xs -> delCRTM xs
'(':'T':'M':')':xs -> delCRTM xs
x:xs -> x : delCRTM xs
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Retrieve the model of the CPU (e.g., "Intel(R) Core(TM) i5 CPU..."). Implemented by look up the model name in /proc/cpuinfo. The copyright and trademark abbreviations are omitted. |
|
failfree: |
() |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{() |-> _}
|
|
name: |
getCPUModel |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
Prelude.IO String |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |