purescript-contrib/purescript-routing

Generalize `Routing.Match` combinators

Closed this issue · 6 comments

I don't think any of these need to be monomorphic and can instead be defined in terms of MatchClass.

garyb commented

eitherMatch would have to be added to the class I think, or the constraint on the class would have to be strengthened.

Alternative proposal too: we get rid of the class and only have the monomorphic versions 🙂

How is eitherMatch different than either (const (fail ...)) pure? I agree that the class is unnecessary.

Same with optionalMatch. How is it different than map Just a <|> pure Nothing?

garyb commented

optionalMatch is fine, I'm not sure I understand how either fail pure works though? You need to bind, hence my comment about the constraint.

Oh I see, yes you are right. We should just remove the class. I don't see what we gain from using it.

garyb commented

Resolved in the 0.12 branch