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 | 5418 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 1 day ago
27 weeks 1 day ago
27 weeks 1 day ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago