2010-09-13から1日間の記事一覧

haskell アドホック多相

アドホック多相の意味がわかったかも今までパラメータ多相でf x=x+1を型宣言しても以下の様にエラーが出ていた Prelude> let f::a->a ; f x=x+1 <interactive>:1:21: Could not deduce (Num a) from the context () arising from the literal `1' at <interactive>:1:21 Possible fix: </interactive></interactive>…