ya dosyayı ayrıştırmak için geçilen veya standart girdiden okunan ifadesinde Bağlama:Ben dosya adıyla kuyrukkakanı argüman üzerinde çalışıyorum
let formulae = fmap parseInput $ if isInputFile args then (hGetContents $ openFile (last args) ReadMode) else hGetContents stdin
ama tabii bu hata oluşur:
formula-2-bdd.hs:89:79:
Couldn't match expected type `Handle' with actual type `IO Handle'
In the second argument of `($)', namely
`openFile (last args) ReadMode'
In the expression: (hGetContents $ openFile (last args) ReadMode)
Ben GÇ ilk Kulp bağlamak ben isInputFile args `e göre karar olamaz:
handle <- openFile (last args) ReadMode
formulae = fmap parseInput $ if isInputFile args then hGetContents handle else hGetContents stdin