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 | 5136 reads
|
Browse archivesActive forum topics |
Recent comments
11 hours 56 min ago
2 weeks 8 hours ago
6 weeks 1 day ago
6 weeks 6 days ago
6 weeks 6 days ago
8 weeks 5 days ago
8 weeks 5 days ago
9 weeks 1 day ago
9 weeks 1 day ago
10 weeks 1 day ago