関数型プログラミング ..
16:デフォルトの名無しさん
04/02/15 19:03
>>15
bank accountsと一口にいわれてもよくわからないが…
こういうこと(カプセル化)でないなら、
期待しているものが載ってるURLをくれ。
ポリモルフィズムはtype class。
継承は難しい。
# OOA, OODが全てではない。
-- テストしてない
module BankAccount (
-- Do not export any constructor.
name, money, newAccount
--, query, ...etc
) where
data Account = Account String Integer
name (Account s m) = s
money (Account s m) = m
newAccount (s, m) = Account s m
-- data Database = Database [Account]
-- query (Database as) nm = filter ((== nm).name) as
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5380日前に更新/259 KB
担当:undef