From d1a442176259b6b8004b68450f28d72fccfa838f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 Apr 2016 15:52:56 -0400 Subject: further thoughts --- doc/todo/type_level_port_conflict_detection.mdwn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/todo/type_level_port_conflict_detection.mdwn') diff --git a/doc/todo/type_level_port_conflict_detection.mdwn b/doc/todo/type_level_port_conflict_detection.mdwn index 733e6e04..8209740e 100644 --- a/doc/todo/type_level_port_conflict_detection.mdwn +++ b/doc/todo/type_level_port_conflict_detection.mdwn @@ -64,3 +64,27 @@ but it is not yet integrated into the Property types. --[[Joey]] > > construct port singletons.) > > > > --[[Joey]] + +> > > A further problem with this is that it's not clear from the +> > > `virtualHost` type signature that it needs to have a port applied to +> > > it to get a usable property. So in a way, by adding this advanced +> > > type safety, we've lost the most fundamental type safety of all: +> > > Functions must have the right parameters applied! +> > > +> > > So, it would perhaps be better to have +> > > +> > > virtualHost :: Domain -> WebRoot -> RevertableProperty (UsingPort 80 + DebianLike) DebianLike +> > > +> > > And then to make it use a different port, use `using`. +> > > +> > > This too has a problem; if the property is hard-coded to use port 80, +> > > then `using` won't change it, and again the type signature doesn't +> > > tell. Perhaps the thing to do is to indicate in the type when a port +> > > can be changed: +> > > +> > > virtualHost :: Domain -> WebRoot -> RevertableProperty (Changable (UsingPort 80) + DebianLike) DebianLike +> > > +> > > And then `using` would need to only be able to be applied when it +> > > changed a resource that is marked `Changable`. +> > > +> > > --[[Joey]] -- cgit v1.2.3