
5 Nov
2009
5 Nov
'09
3:28 a.m.
In "type Parser" Parser is a type synonym. In GenParser, Parser is a data constructor; they live in separate namespaces. Yes, I admit, it's confusing. zaxis wrote:
type Parser a = GenParser Char () a newtype GenParser tok st a = Parser (State tok st -> Consumed (Reply tok st a))
As i know, the Parser type is just an alias of GenParser. Then can the second line be replaced as below?
newtype GenParser tok st a = GenParser Char () (State tok st -> Consumed (Reply tok st a))
If it can , then what is the new type ?
Sincerely!
----- fac n = foldr (*) 1 [1..n]