haskell-te: cdbe94abafa6addda4cc8a6ae54ba025c258434b

     1: From: Chris Warburton
     2: Date: Thu, 27 Jul 2017 13:43:17 +0100
     3: State: resolved
     4: Subject: No variables available for parameterised types
     5: Message-Id: <d7b518eda6e0cc84-0-artemis@nixos>
     6: resolution: fixed
     7: 
     8: For example, exploring a theory of lists, with `length`, `reverse`,
     9: etc. we find things like:
    10: 
    11:   append [] [x] = [x]
    12: 
    13: We would expect to find the following, more general, theorem, since its
    14: syntax tree is shallower:
    15: 
    16:   append [] y = y
    17: 
    18: The reason we don't is that we can't generate Arbitrary instances for
    19: lists, and hence we don't get any list variables (like `y`). We can get
    20: Arbitrary instances for non-parameterised types, like Nat, and hence
    21: they get variables.
    22: 
    23: It looks like our parameterised types do have an instance, thanks to
    24: TIP's translation, but it has an `Enumerable` constraint. Since we're
    25: monomorphising everything to `Integer`, maybe we don't have an
    26: `Enumerable` instance for `Integer`, and that's why we don't get an
    27: Arbitrary instance?
    28: 
    29: Alternatively, it may be that ifcxt isn't choosing an instance because
    30: it's not following the chain of constraints. Our patches to ifcxt should
    31: have fixed this, but maybe we need to include something like
    32: `mkIfCxtInstances ''Enumerable`?

Generated by git2html.