User loginNavigation |
Type-Safe CastsFrom Type-Safe Casts by Stephanie Weirich
This is a Functional Pearl, which was recommended in a previous discussion here. So I'm looking at the pseudo-code example given: sig type table val empty : table val insert : \forall 'a . table -> (string * 'a) -> table val find : \forall 'a . table -> string -> 'a end and I find myself wandering why not parameterize the table type (making it a kind). Retaining pseudo-code: sig kind table['t] val empty : table[nil] val insert : \forall 'a . \forall 'b . table['b] -> (string * 'a) -> table['b | 'a]] val find : \forall 'a . table['a] -> string -> 'a end As far as I know this is theoretically sound, or am I mistaken? I am still not comfortable with Haskell syntax so I was unable to decipher the rest of the paper. Any help would be appreciated. By cdiggins at 2007-05-07 23:26 | LtU Forum | previous forum topic | next forum topic | other blogs | 5399 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 17 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago