[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [MirageOS-devel] CoHTTP Design: Polymorphic Variants
The biggest reason is that it makes doing any monadic Result.t work possible. Consider: foo () >>= fun () -> bar () >>= fun () -> Cohttp.something () >>= function | Ok ... -> | Error ... -> If every one of those functions returned a regular variant, you would not be able to compose them like that. Trevor Smith <trevorsummerssmith@xxxxxxxxx> writes: > Hello, > > I am curious to hear the design tradeoffs that were considered in choosing > polymorphic variants vs variants in the code.mli types. I haven't really > wrapped my head around why that decision was made, and am eager to learn > more about real world use of polymorphic variants. > > Thank you. > > Trevor > _______________________________________________ > MirageOS-devel mailing list > MirageOS-devel@xxxxxxxxxxxxxxxxxxxx > http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel _______________________________________________ MirageOS-devel mailing list MirageOS-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |