We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pure . length的类型是CardStack -> State CardStack Int 此处应为
pure . length
CardStack -> State CardStack Int
countCards :: State CardStack Int countCards = State $ length >>= (,)
The text was updated successfully, but these errors were encountered:
同意。 此外,也可以朴素地 countCards = State $ \s -> (length s, s),也可以用后面定义的
countCards = State $ \s -> (length s, s)
gets :: (s -> a) -> State s a gets f = State $ \s -> (f s, s)
来写成 countCards = gets length 。
countCards = gets length
Sorry, something went wrong.
看起来修正版的计划得赶紧提上日程啦
No branches or pull requests
pure . length
的类型是CardStack -> State CardStack Int
此处应为
The text was updated successfully, but these errors were encountered: