İşte kodum, *
yeniden tanımlamak için çalışıyor. *
önceden hided zaman sadece elde edilebilir:İçe aktarırken bir operatör nasıl gizlenir?
import Prelude hiding (*)
(*) :: Int -> Int -> Int
x * 0 = 0
x * y = x + x*(y-1)
Ama çalışmıyor:
$ ghci test.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
test.hs:1:24: error: parse error on input ‘*’
Failed, modules loaded: none.
Prelude>
ben gibi diğer fonksiyonu gizlemek olabilir:
import Prelude hiding (read)
import Prelude hiding (show)
bunun ise *
, +
,gibi operatör için çalışmıyor.
Onları nasıl gizlerim? operatör Hakkında
:t read
:t show
:
Eğer :t +
yazıyorsunuz bir fonksiyonun türü için ghci
sorgulamak nasıl