例如,ParsecT在其定義中有多個類型變量。haskell中多個類型變量的順序是什麼規則?
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
}
我們可以這樣做嗎?
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
}
我想知道當我們定義一個新類型時,是否存在關於類型變量順序的規則或原則。
在價值水平的類似問題在這裏:http://stackoverflow.com/questions/5863128/ordering-of-parameters-to-make-use-of-currying – cheecheeo