pietervdvn / Lang

Yet another programming language
1 stars 1 forks source link

Pattern syntax: use "." instead of "_" #88

Closed pietervdvn closed 9 years ago

pietervdvn commented 9 years ago

In the type signatures, . will be used to denote the Any-type. It will be used partially as a typeholder for "I do not care about it's type", e.g. in const

const :: a -> . -> a

It would be neat if the same went on for pattern matches:

a . = a

Instead of

a _ = a

(This is bikeshedding, keep that in mind)

pietervdvn commented 9 years ago

Pietervdvn: pro (consistency) Destro: pro (regex wildcard) Iasoon: neutral/against (clashing names with function composition)

pietervdvn commented 9 years ago

A real Dontcare has been added, as (a -> b) -> Mappable (.:a) -> Mappable b does not work, whereas `Mappable (_:a) -> Mappable b``does work