1. 26 Sep, 2012 1 commit
  2. 05 Sep, 2012 1 commit
    • Iustin Pop's avatar
      Further hlint fixes · 5b11f8db
      Iustin Pop authored
      Commit 2cdaf225, “Re-enable standard hlint warnings”, got it almost
      right. The only problem is that (confusingly) the default set of hints
      is not in HLint.Default, but in HLint.HLint (it includes Default and
      some built-ins).
      After changing the lint file to correctly include the defaults, we had
      another 128 suggestions:
        - Error: Eta reduce (2)
        - Error: Redundant bracket (4)
        - Error: Redundant do (17)
        - Error: Redundant lambda (7)
        - Error: Redundant return (1)
        - Warning: Avoid lambda (2)
        - Warning: Redundant $ (42)
        - Warning: Redundant bracket (35)
        - Warning: Use : (1)
        - Warning: Use String (4)
        - Warning: Use camelCase (10)
        - Warning: Use section (3)
      which are fixed by the current patch. Note that the 10 "Use camelCase"
      were all due to hlint not “knowing” the idiom of ‘case_’ (it does for
      ‘prop_’), for which I filled
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
  3. 04 Sep, 2012 1 commit
  4. 03 Sep, 2012 2 commits
    • Iustin Pop's avatar
      Add more node-related data types and functions · da45c352
      Iustin Pop authored
      This is a simple type declaration for NodeRole, a NdParamObject type
      class, and a few related helper functions for nodes and node groups.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
    • Iustin Pop's avatar
      Expand Objects.hs definitions · b09cce64
      Iustin Pop authored
      This patch adds the missing parameters in the cluster/group objects,
      for now as simple maps (dictionaries), without type safety. The
      rationale for adding them as such is:
      - we need something to enable query functionality
      - since we don't modify the values, we don't risk introducing bugs
      - we can improve the types later, once we find a good way to declare
      Also, I renamed a few of the parameters, dropping capitalisation of
      acronyms (NIC → Nic, etc.).
      At this point, I believe that the definitions are complete, with any
      missing items being just oversight, and not intentionally removed (due
      to lack of types, etc.).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
  5. 28 Aug, 2012 3 commits
    • Iustin Pop's avatar
      Config.hs: Add a function to lookup group · 4cd428db
      Iustin Pop authored
      Like in the python code, this is a bit more complex since groups are
      indexed by UUID, so we must fallback to lookup via the name (slow; but
      the number of groups should be small).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
    • Iustin Pop's avatar
      Re-enable standard hlint warnings · 2cdaf225
      Iustin Pop authored
      Commit 5a1e31b4
       (Add infrastructure for, and two extra hlint rules)
      was intended to add two *extra* hlint rules, but I didn't realise at
      that time that "--hint" when first used overrides the built-in
      lints. As such, since then we were basically running with just those
      two rules, which resulted in many uncaught warnings/errors.
      This patch fixes that (by importing the standard lint rules in our
      custom hints file), and then goes to fix all the warnings that a
      current hlint gives me. Compared to our current style, we have just a
      few additions:
      - zipWithM instead of map foo . zip …
      - 'exitSuccess' instead of 'exitWith ExitSuccess'
      - more uses of '.'
      Additionally, we have to silence a case where hlint doesn't realise
      why we are using '\e -> const (return False (e :: IOError)' instead of
      just '\e -> return False' or even 'const (return False').
      One warning that is generated by hlint ("Use void") can't be fixed
      until we deprecate GHC 6.x, as only GHC 7 has the 'void' function in
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
    • Iustin Pop's avatar
      Improve the TH 'Container' type · 84835174
      Iustin Pop authored
      This is the first part of the changes related to the 'Container' type.
      We currently handle this type as follows: it's a simple type alias
      over the Data.Map type, which means:
      - it's easy to use the Data.Map functions to change the type
      - however, since Data.Map already has a JSON instance, we have to very
        carefully always use custom show/read routines to handle this type
      The second point leads to potential bugs which are not caught by the
      type system, so let's improve the situation by making it a proper
      newtype, which can have its own JSON instance (with our desired
      behaviour). Once we do this change, accessing the type requires an
      extra function call, but it's as safe as before. On the positive side,
      we can use the implicit read/show JSON, which means we can remove (in
      the next patch) the "container" special casing.
      The patch also moves the type to outside of THH, since not all users
      of this will want to import that (as opposed to JSON.hs, which is
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
  6. 19 Jul, 2012 3 commits
  7. 13 Mar, 2012 1 commit