是getLine懶惰? 說我對輸入有很長的一行。這只是一個數字序列。我只需要總結3個第一個數字。請問getLine是否高效,只讀取該行的第一部分,或者我是否必須創建自己的函數來讀取懶線,才能逐個讀取字符? 如果我總結整條線,我的執行效率會高嗎? (是否有一個開銷由於一個讀取字符一個?) import Control.Applicative
main = do
line <- getL
我有異步端點的Spring MVC應用程序: @GetMapping
public DeferredResult<Collection<B>> get() {
DeferredResult<Collection<B>> result = new DeferredResult<>();
Executors.newSingleThreadExecutor().submit(()
// Standard pattern matching.
let Foo x =
match x with
| 1 ->
// ... lots of code, only evaluated if x == 1
| 2 ->
// ... lots of code, only evaluated if x == 2
// Standa