summaryrefslogtreecommitdiff
path: root/doc/todo/type_level_port_conflict_detection.mdwn
diff options
context:
space:
mode:
authorJoey Hess2016-04-12 13:03:50 -0400
committerJoey Hess2016-04-12 13:03:50 -0400
commitd6fe7d30971bb401d5ebbb749bbcaea802948842 (patch)
tree239c1f4fdf07e599c4ea26483c2fdfae561c2d36 /doc/todo/type_level_port_conflict_detection.mdwn
parent868e2c473ac43f8e6432b1672f57bbdcb1872174 (diff)
update
Diffstat (limited to 'doc/todo/type_level_port_conflict_detection.mdwn')
-rw-r--r--doc/todo/type_level_port_conflict_detection.mdwn31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/todo/type_level_port_conflict_detection.mdwn b/doc/todo/type_level_port_conflict_detection.mdwn
index b89ad239..67f63e03 100644
--- a/doc/todo/type_level_port_conflict_detection.mdwn
+++ b/doc/todo/type_level_port_conflict_detection.mdwn
@@ -33,3 +33,34 @@ but it is not yet integrated into the Property types. --[[Joey]]
> port. Don't allow combining `UsingPort 80 Apache` with `UsingPort 80 Ngnix`
>
> --[[Joey]]
+
+> > Also, it's not clear how to parameterize properties that support
+> > running a service on different ports. One way might be to
+> > declare the ports in the type signatures; the property code
+> > can then use `usedPorts (getMetaTypes self)` to get a port list.
+> >
+> > So, we'd start with a property definition that does not use any ports:
+> >
+> > virtualHost :: Domain -> WebRoot -> RevertableProperty DebianLike DebianLike
+> > virtualHost domain docroot =
+> > let self = property "vhost" (go (usedPorts (getMetaTypes self)))
+> > in self
+> > where
+> > go [] = error "No ports specified"
+> > go ports = ...
+> >
+> > And then to use it:
+> >
+> > & virtualHost "example.com" "/var/www" :: RevertableProperty (UsingPort 80 + DebianLike) DebianLike
+> >
+> > But, this seems like a mouthful to write!
+> >
+> > Maybe make a `using` that changes the metatypes of a property,
+> > adding a resource. That shortens what needs to be written some:
+> >
+> > & virtualHost "example.com" "/var/www" `using` (port :: Port 80)
+> >
+> > (`port` here is just an alias for `sing`, possibly constrained to only
+> > construct port singletons.)
+> >
+> > --[[Joey]]