タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

ocamlとhaskellに関するtakkan_mのブックマーク (1)

  • exhaustive な switch - まめめも

    OCaml ではパターンマッチの抜けを警告してくれます。Haskell より OCaml の方が好きな点の 1 つです*1。 type t = Foo | Bar | Baz let f = function Foo -> "foo" | Bar -> "bar" $ ocamlc pat-test.ml File "pat-test.ml", line 2, characters 8-44: Warning P: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: Baz今日気がついたのですが、gcc でも enum に対して同様のチェックをしてくれるようです。 enum t { foo, bar, baz }; char *f(enum t x) { sw

    exhaustive な switch - まめめも
    takkan_m
    takkan_m 2008/04/15
  • 1