检查数字是否按顺序排列

Edu*_*mos -3 sorting int haskell digits

我试图检查,如果有任何数字,它的数字是否有序.例:

1479 - >正确

1293 - >假

在Haskell中有没有正确的方法呢?我是这门语言的新手,现在感到非常失落.谢谢.

Red*_*edu 6

我认为@vps的方法是合适的,但只是对于某些种类,你也可以按照以下方式完成工作;

Prelude> and $ zipWith (<) <*> tail $ show 1479
True
Prelude> and $ zipWith (<) <*> tail $ show 1293
False
Run Code Online (Sandbox Code Playgroud)