Ví dụ, ParsecT có nhiều biến kiểu trong định nghĩa của nó.Quy tắc của thứ tự của nhiều biến kiểu trong haskell là gì?
newtype ParsecT s u m a
= ParsecT {unParser :: forall b .
State s u
-> (a -> State s u -> ParseError -> m b)
-> (ParseError -> m b)
-> (a -> State s u -> ParseError -> m b)
-> (ParseError -> m b)
-> m b
}
Chúng ta có thể làm như thế này không?
newtype ParsecT m a s u -- Only the order of s u m a is changed to m a s u.
= ParsecT {unParser :: forall b .
State s u
-> (a -> State s u -> ParseError -> m b)
-> (ParseError -> m b)
-> (a -> State s u -> ParseError -> m b)
-> (ParseError -> m b)
-> m b
}
Tôi tự hỏi liệu có nguyên tắc hoặc nguyên tắc về thứ tự của các biến kiểu khi chúng tôi xác định loại mới hay không.
Một câu hỏi tương tự ở cấp độ giá trị là ở đây: http://stackoverflow.com/questions/5863128/ordering-of-parameters-to-make-use-of-currying – cheecheeo