Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Haskell ie floor 1.7 で floor を使用すると、1 が返され、型が Int になると想定しましたが、そうではないかのようにエラー メッセージが表示され続けますか?
私にとってはうまくいきます:
ghci > floor 1.7 1 ghci > :t floor floor :: (Integral b, RealFrac a) => a -> b
Intタイプを明示的に言及することで、強制的にタイプにすることができます。
Int
ghci > floor 1.7 :: Int 1
または、必要に応じてInteger、
Integer
ghci > floor 1.7 :: Integer 1