LoginSignup
0
0

More than 5 years have passed since last update.

ID作る系。

% runhaskell
import Data.Unique

main :: IO ()
main = do
  loop 10 $ do u <- newUnique
               print $ hashUnique u
  where loop :: Int -> IO () -> IO ()
        loop n action = if n == 0
                        then return ()
                        else action >> loop (n - 1) action

【実行結果】
1
2
3
4
5
6
7
8
9
10
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0