Drup / furl

Formatted url
MIT License
49 stars 3 forks source link

Figure out atoms properly #6

Open Drup opened 9 years ago

Drup commented 9 years ago

Currently, atom has a phantom type to force List to be at top level.

type 'a component =
  | Opt : 'a atom -> 'a option component
  | One : 'a atom -> 'a component
  | List : 'a atom -> 'a list component
  | List1 : 'a atom -> ('a * 'a list) component

The good point is that it gives a clearer semantic: only the components have special semantic for path and query, atoms are only regexps. The meh point is that it adds another type layer. That could be avoided with the syntax extension and maybe mitigated with good choice of constructors (but value restriction ...).