autotaker
Haskellで型クラス実装されてなくても動くような、いわゆるSoft Constraintsの言語拡張って難しいんでしょうか?
(!) :: (Show? key, Ord key) => Map key value -> key -> value (!) m key = case lookup key m of Just value -> value Nothing -> case show? of Nothing -> error $ "no value for key" Just fshow -> error $ "no value for key: "++ fshow key >>> empty ! "hoge" Error: no value for key: "hoge" >>> newtype T = T Int deriving(Eq,Ord) >>> empty ! (T 10) Error: no value for key