Commit b61e7f29 authored by Klaus Aehlig's avatar Klaus Aehlig

Push return out of genericResult

...and merge with '<-' to get a pure computation
outside the monad.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 6e94c4eb
......@@ -220,10 +220,10 @@ parseNode ktg [ name, mtotal, mnode, mfree, dtotal, dfree
xsptotal <- if xexcl_stor
then lvconvert 0 "sptotal" sptotal
else convert "spindles" spindles
xspfree <- genericResult (const $ return (0 :: Int)) return
$ lvconvert 0 "spfree" spfree
-- "spfree" might be missing, if sharedfile is the only
-- supported disk template
let xspfree = genericResult (const (0 :: Int)) id
$ lvconvert 0 "spfree" spfree
-- "spfree" might be missing, if sharedfile is the only
-- supported disk template
xmtotal <- lvconvert 0.0 "mtotal" mtotal
xmnode <- lvconvert 0 "mnode" mnode
xmfree <- lvconvert 0 "mfree" mfree
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment