ollef / Earley

Parsing all context-free grammars using Earley's algorithm in Haskell.
BSD 3-Clause "New" or "Revised" License
361 stars 24 forks source link

list = listLike? #32

Closed tomjaguarpaw closed 7 years ago

tomjaguarpaw commented 7 years ago

Wouldn't it be nicer to have list = listLike?

https://github.com/ollef/Earley/blob/master/Text/Earley/Derived.hs#L29

ollef commented 7 years ago

You're right, it probably would!

Can we think of any situations where this would lead to bad type inference?

phadej commented 7 years ago

@ollef no, it's about changing the definition of list, the type-signature would stay the same (i.e. specific). IIRC we left list especially for the case where some ListLike was produced, to avoid annotating the intermediate type in show . read like situations.

ollef commented 7 years ago

Ah, then I misunderstood. Making this change without changing the type signature is uncontroversial. :)