{"image_url":null,"type":"rich","author_name":"coffee_kabu","categories":["haskell"],"width":"100%","height":"190","version":"1.0","provider_name":"Hatena Blog","blog_title":"Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0","author_url":"https://blog.hatena.ne.jp/coffee_kabu/","url":"https://coffee-guhaw.hateblo.jp/entry/2025/03/31/000000","blog_url":"https://coffee-guhaw.hateblo.jp/","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F03%2F31%2F000000\" title=\"\u3010Haskell\u3011maybe\u306e\u51e6\u7406 - Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2025-03-31 00:00:00","title":"\u3010Haskell\u3011maybe\u306e\u51e6\u7406","description":"(\u904e\u53bb\u8a18\u4e8b\u306e\u30b3\u30d4\u30da\u306a\u306e\u3067\u5185\u5bb9\u304c\u53e4\u3044\u304b\u3082\u77e5\u308c\u307e\u305b\u3093) (Haskell\u95a2\u9023\u306e\u8a18\u4e8b\u306f\u3053\u308c\u3067\u6700\u5f8c\u306b\u306a\u308b\u4e88\u5b9a)\u305f\u3060\u306e\u30e1\u30e2\u3067\u3059\u666e\u901amaybe\u578b\u306e\u51e6\u7406\u306f\u3001 let hoge = case hogemaybe of Nothing -> error $ \"There is no hoge.\" _ -> fromJust hogemayby \u307f\u305f\u3044\u306b\u3057\u3066\u3084\u308b\u3053\u306ehoge\u304c[maybe a]\u30ea\u30b9\u30c8\u306a\u3093\u304b\u306b\u306a\u3063\u3066\u3044\u305f\u3068\u304d\u306f import Data.Maybe \u306b\u5165\u3063\u3066\u3044\u308bcatMaybes\u304c\u4fbf\u5229 \u30ea\u30b9\u30c8\u306e\u3046\u3061\u3001Nothing\u4ee5\u5916\u306e\u3082\u306e\u3060\u3051\u3092\u6b8b\u3057\u3066\u304f\u308c\u308b\u3089\u3057\u3044"}