Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signature BLAH =
- sig
- type t (* abstract data type *)
- val getX : t -> int
- val getBunny : t -> bunny
- end
- structure Blah :> BLAH =
- (* the implementation may choose it's own way of implementing getX and getBunny *)
- struct
- open Susp (* lazy evaluation library *)
- type t = {x : int, b : bunny susp} (* for implementor's convenience or just on a whim we take t to be a record. Bunny is computed lazily (don't ask) *)
- val getX = x (* I'm not sure if this compiles in SML, but it should *)
- val getBunny = force bunny (* same provision as above *)
- end
Add Comment
Please, Sign In to add comment