1. 19 Feb, 2013 1 commit
  2. 11 Feb, 2013 1 commit
  3. 24 Dec, 2012 1 commit
  4. 19 Dec, 2012 1 commit
  5. 17 Dec, 2012 4 commits
  6. 07 Dec, 2012 1 commit
  7. 04 Dec, 2012 3 commits
  8. 30 Nov, 2012 10 commits
  9. 21 Nov, 2012 2 commits
  10. 20 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Split OpCode.hs and add module for opcode parameters · 92f51573
      Iustin Pop authored
      Due to TemplateHaskell stage restrictions, we can't define parameters
      in the same module as we're using them for TH, so we have to define
      all module parameters in a separate module.
      This patch therefore splits OpCodes.hs in two, adding that module and
      moves most code there (types, parameters, etc.). The remaining parts
      in OpCodes.hs, the actual opcode definitions, now use more parameters
      instead of direct field definitions (more will come later)
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
  11. 15 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Cleanup THH function use from built module namespace · 32a569fe
      Iustin Pop authored
      Currently, THH.hs "injects" into the built code names of library
      functions like Text.JSON.makeObj, Ganeti.JSON.fromObj, etc. built
      directly from strings, via (e.g.)
        varE (mkName "makeObj")
      This means that the "makeObj" name must exist in the target module,
      i.o.w. must be imported there. This leads to the strange case of
      having to have imports that do not appear at all in the used
      (template) code, but are needed to satisfy this "hidden" dependency;
      look at Ganeti/Jobs.hs before this patch, for example.
      This is also not very obvious, because we usually import Text.JSON
      anyway; I only stumbled upon it while doing some cleanup work.
      So to clean this up, the current patch changes the THH.hs to use not
      string-derived, but identifier-derived names («'identifier» versus
      «mkName "identifier"»); this is better, as the names must be
      resolvable when compiling THH itself (once), and not when compiling
      the multiple derived modules. As you can see, this allows removal of
      extraneous imports from various modules.
      Background information: an `mkName "foo"` results in a name of flavour
      NameS (“An unqualified name; dynamically bound”) or alternatively to a
      qualified name, but still dynamically bound. Whereas what we want is a
      statically bound name: `'foo` results in a NameG flavour, “Global name
      bound outside of the TH AST: An original name”.
      One more explanation: the change is similar to going from 'x = eval
      "map"' to 'x = map'; the name is no longer dynamically evaluated, but
      statically when the module is compiled. In our case, previously names
      were bound at target module compile time, now they are bound at THH.hs
      compile time.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
  12. 12 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Convert tag objects to a safer type · d8e7c45e
      Iustin Pop authored
      Currently, we keep information about the "target" of a tag operation
      in a data type similar to (TagKind, Maybe String). This is unsafe, as
      nothing (at the type level) prevents us from accidentally having
      (TagCluster, Just "instance1.example.com"), or (TagInstance, Nothing).
      To fix this problem, we rename the current TagObject type to TagType
      (an internal utility type), and create TagObject as a better/safer
      data type (see the definition), which doesn't allow such possibilities
      in the future.
      The downside is that, since at encoding level (both opcode and luxi)
      this is done in an ugly way (type elements spread at the same level as
      level as other value), we have to add custom encoders/decoders. The
      encoder is shared between the OpCode and Luxi usage, the decoder is
      different however as Luxi uses custom decoding.
      This also fixes the recent breakage in confd w.r.t. QueryTags.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  13. 08 Nov, 2012 2 commits
  14. 04 Sep, 2012 1 commit
  15. 28 Aug, 2012 2 commits
  16. 13 Jan, 2012 1 commit
  17. 07 Dec, 2011 1 commit
  18. 17 Nov, 2011 1 commit
  19. 03 Oct, 2011 3 commits
  20. 22 Jul, 2011 1 commit
  21. 13 Jul, 2011 1 commit