Re: [racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread 'John Clements' via Racket Users
Oh! of course. Makes sense. If I make a pull request, does that mean I get a pass for wasting my time doing advent of code? John > On Dec 15, 2019, at 18:41, Sam Tobin-Hochstadt wrote: > > Yes, this is because the contract enforces parametericity, which > doesn't allow `index-of` to work the

Re: [racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread Sam Tobin-Hochstadt
Yes, this is because the contract enforces parametericity, which doesn't allow `index-of` to work the way you'd want. Instantiating things doesn't help because the contract is based on the `require/typed`, not on the use site. Here's a few suggestions: 1. Submit a pull-request to TR to add `inde

[racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread 'John Clements' via Racket Users
It looks like my quick attempt at importing index-of into TR is running into a problem. Here’s the program I ran: #lang typed/racket (require/typed racket/list [index-of (All (T) ((Listof T) T -> (U False Natural)))]) (index-of '(n s e w) 'n) ;; returns... #f? In typed/racket/no