這裏是一個簡短的談話從GHCI: Prelude> :t read
read :: Read a => String -> a
Prelude> :t show
show :: Show a => a -> String
Prelude> :t show.read
show.read :: String -> String
Prelude> (show.read) "whales"
假設有一個庫模塊Foo這是不是我的控制之下: module Foo (Foo, thing) where
data Foo = Foo Int
thing :: Foo
thing = Foo 3
現在假設我有我自己的庫模塊,其中轉口thing從Foo模塊。 module Bar (Foo.thing, getBar) where
import qualified Foo
type
如果將declare a library + executable sections in a cabal file while avoiding double compilation of the library放到hs-source-dirs目錄中,那麼通常不會再使用ghci和runhaskell運行項目,特別是如果可執行文件本身具有幫助程序模塊時。 什麼是推薦項目佈局 只有建立所需要的一次