瀏覽代碼

Implement the exercice with the `do` keyword

DricomDragon 5 年之前
父節點
當前提交
3f8d0a1fa2
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      io_length.hs

+ 8 - 0
io_length.hs

@@ -0,0 +1,8 @@
+-- Slide 57
+
+ioLength::IO Int
+ioLength = do
+	x <- getLine
+	return (length x)
+
+main = ioLength >>= print