豊福です。
WinHugs で
Prelude> Nothing
すると
ERROR - Cannot find "show" function for:
*** Expression : Nothing
*** Of type : Maybe a
というエラーになります。
maybeToList :: Maybe a -> [a]
maybeToList Nothing = []
maybeToList (Just a) = [a]
Main> maybeToList Nothing
すると
ERROR - Cannot find "show" function for:
*** Expression : maybeToList Nothing
*** Of type : [a]
というエラーになります。
isJust :: Maybe a -> Bool
isJust (Just a) = True
isJust Nothing = False
Main> isJust Nothing
ではエラーにならず False が返ってきます。
上二つがエラーになるのはどうしてなんでしょうか。
それと maybeToList や isJust などは Prelude に入ってないん
でしょうか。
---
豊福
nobu_toyofuku / nifty.com
--
ML: haskell-jp / quickml.com
使い方: http://QuickML.com/