From b3789e37383255d827b6d26589dde16096771346 Mon Sep 17 00:00:00 2001 From: Denis Buzdalov Date: Tue, 26 Sep 2023 12:42:49 +0300 Subject: [PATCH] [ mcov ] Implement labelling and simple model coverage --- .gitlab-ci.yml | 1 + .pack-collection | 2 +- deptycheck.ipkg | 2 + pack.toml | 4 +- .../DepTyCheck/Gen/Core/ConsDerive.idr | 2 +- src/Deriving/DepTyCheck/Util/Alternative.idr | 5 + src/Deriving/DepTyCheck/Util/Collections.idr | 4 + src/Deriving/DepTyCheck/Util/Reflection.idr | 80 ++- src/Test/DepTyCheck/Gen.idr | 124 +++-- src/Test/DepTyCheck/Gen/Coverage.idr | 175 ++++++ src/Test/DepTyCheck/Gen/Labels.idr | 37 ++ .../infra/empty-cons print 001/expected | 7 +- .../infra/empty-cons print 002/expected | 43 +- .../infra/empty-cons print 003/expected | 22 +- .../infra/empty-cons print 004/expected | 9 +- .../infra/empty-cons print 005/expected | 7 +- .../infra/empty-cons print 006/expected | 39 +- .../infra/empty-cons print 007/expected | 22 +- .../infra/empty-cons print 008/expected | 35 +- .../infra/empty-cons print 009/expected | 24 +- .../infra/empty-cons print 010/expected | 52 +- .../infra/empty-cons print 011/expected | 52 +- .../infra/empty-cons print 012/expected | 26 +- .../infra/empty-cons print 013/expected | 30 +- .../infra/empty-cons print 014/expected | 30 +- .../print/adt/001 trivial/expected | 20 +- .../print/adt/002 noparam/expected | 48 +- .../print/adt/003 noparam/expected | 71 +-- .../print/adt/004 noparam/expected | 152 +++--- .../least-effort/print/adt/005 param/expected | 26 +- .../least-effort/print/adt/006 param/expected | 107 ++-- .../adt/007 right-to-left simple/expected | 151 +++--- .../adt/008 right-to-left simple/expected | 151 +++--- .../print/adt/009 left-to-right/expected | 147 ++--- .../adt/010 right-to-left long-dpair/expected | 171 +++--- .../adt/011 right-to-left long-dpair/expected | 191 ++++--- .../adt/012 right-to-left chained/expected | 195 ++++--- .../adt/013 right-to-left nondet/expected | 239 ++++---- .../adt/014 right-to-left nondet ext/expected | 160 +++--- .../least-effort/print/gadt/001 gadt/expected | 85 +-- .../least-effort/print/gadt/002 gadt/expected | 176 +++--- .../gadt/003 right-to-left nondet/expected | 435 ++++++++------- .../print/gadt/004 right-to-left det/expected | 455 +++++++++------- .../least-effort/print/gadt/005 gadt/expected | 290 +++++----- .../least-effort/print/gadt/006 gadt/expected | 512 +++++++++--------- .../least-effort/print/gadt/007 eq-n/expected | 107 ++-- .../least-effort/print/gadt/008 eq-n/expected | 30 +- .../least-effort/print/gadt/009 eq-n/expected | 30 +- .../least-effort/print/gadt/010 eq-n/expected | 28 +- .../print/gadt/011 eq deepcons/expected | 113 ++-- .../print/gadt/012 eq deepcons/expected | 107 ++-- .../print/gadt/013 eq deepcons/expected | 107 ++-- .../print/gadt/014 eq deepcons/expected | 95 ++-- .../regression/dependent-givens-big/expected | 137 ++--- .../dependent-givens-small-deep/expected | 28 +- .../dependent-givens-small-shallow/expected | 28 +- .../lost-deceq-four-occurences/expected | 32 +- .../lost-deceq-three-occurences/expected | 30 +- .../expected | 32 +- .../too-early-rename-multiple-simple/expected | 32 +- .../expected | 28 +- .../unification-mismatch-dependent/expected | 30 +- .../unification-name-mismatch/expected | 107 ++-- .../_common-involved-types/Infra.idr | 23 + .../_common-involved-types/inv-ty.ipkg | 7 + .../involved-types/_common-involved-types/run | 6 + .../utils/involved-types/norec-001/Infra.idr | 1 + .../norec-001/TypesAndInvolved.idr | 19 + .../utils/involved-types/norec-001/expected | 6 + .../involved-types/norec-001/inv-ty.ipkg | 1 + .../utils/involved-types/norec-001/run | 1 + .../utils/involved-types/rec-001/Infra.idr | 1 + .../rec-001/TypesAndInvolved.idr | 14 + .../utils/involved-types/rec-001/expected | 5 + .../utils/involved-types/rec-001/inv-ty.ipkg | 1 + .../utils/involved-types/rec-001/run | 1 + .../utils/involved-types/rec-002/Infra.idr | 1 + .../rec-002/TypesAndInvolved.idr | 51 ++ .../utils/involved-types/rec-002/expected | 4 + .../utils/involved-types/rec-002/inv-ty.ipkg | 1 + .../utils/involved-types/rec-002/run | 1 + .../ty-and-con-derived-001/PrintCoverage.idr | 35 ++ .../coverage/ty-and-con-derived-001/expected | 15 + tests/lib/coverage/ty-and-con-derived-001/run | 8 + .../coverage/ty-and-con-derived-001/test.ipkg | 6 + .../ty-and-con-derived-002/PrintCoverage.idr | 38 ++ .../coverage/ty-and-con-derived-002/expected | 15 + tests/lib/coverage/ty-and-con-derived-002/run | 8 + .../coverage/ty-and-con-derived-002/test.ipkg | 6 + .../ty-and-con-withCov-001/PrintCoverage.idr | 40 ++ .../coverage/ty-and-con-withCov-001/expected | 15 + tests/lib/coverage/ty-and-con-withCov-001/run | 8 + .../coverage/ty-and-con-withCov-001/test.ipkg | 6 + .../ty-and-con-withCov-002/PrintCoverage.idr | 40 ++ .../coverage/ty-and-con-withCov-002/expected | 15 + tests/lib/coverage/ty-and-con-withCov-002/run | 8 + .../coverage/ty-and-con-withCov-002/test.ipkg | 6 + .../ty-and-con-withCov-003/PrintCoverage.idr | 43 ++ .../coverage/ty-and-con-withCov-003/expected | 15 + tests/lib/coverage/ty-and-con-withCov-003/run | 8 + .../coverage/ty-and-con-withCov-003/test.ipkg | 6 + .../ty-and-con-withCov-004/PrintCoverage.idr | 53 ++ .../coverage/ty-and-con-withCov-004/expected | 31 ++ tests/lib/coverage/ty-and-con-withCov-004/run | 8 + .../coverage/ty-and-con-withCov-004/test.ipkg | 6 + .../ty-and-con-withCov-005/PrintCoverage.idr | 50 ++ .../coverage/ty-and-con-withCov-005/expected | 31 ++ tests/lib/coverage/ty-and-con-withCov-005/run | 8 + .../coverage/ty-and-con-withCov-005/test.ipkg | 6 + .../ty-and-con-withCov-006/PrintCoverage.idr | 50 ++ .../coverage/ty-and-con-withCov-006/expected | 31 ++ tests/lib/coverage/ty-and-con-withCov-006/run | 8 + .../coverage/ty-and-con-withCov-006/test.ipkg | 6 + .../ty-and-con-withCov-007/PrintCoverage.idr | 40 ++ .../coverage/ty-and-con-withCov-007/expected | 31 ++ tests/lib/coverage/ty-and-con-withCov-007/run | 8 + .../coverage/ty-and-con-withCov-007/test.ipkg | 6 + .../ty-and-con-withCov-008/PrintCoverage.idr | 28 + .../coverage/ty-and-con-withCov-008/expected | 16 + tests/lib/coverage/ty-and-con-withCov-008/run | 8 + .../coverage/ty-and-con-withCov-008/test.ipkg | 6 + .../ty-and-con-withCov-009/PrintCoverage.idr | 42 ++ .../coverage/ty-and-con-withCov-009/expected | 50 ++ tests/lib/coverage/ty-and-con-withCov-009/run | 8 + .../coverage/ty-and-con-withCov-009/test.ipkg | 6 + tests/runner/Runner.idr | 2 + 126 files changed, 4310 insertions(+), 2431 deletions(-) create mode 100644 src/Test/DepTyCheck/Gen/Coverage.idr create mode 100644 src/Test/DepTyCheck/Gen/Labels.idr create mode 100644 tests/derivation/utils/involved-types/_common-involved-types/Infra.idr create mode 100644 tests/derivation/utils/involved-types/_common-involved-types/inv-ty.ipkg create mode 100755 tests/derivation/utils/involved-types/_common-involved-types/run create mode 120000 tests/derivation/utils/involved-types/norec-001/Infra.idr create mode 100644 tests/derivation/utils/involved-types/norec-001/TypesAndInvolved.idr create mode 100644 tests/derivation/utils/involved-types/norec-001/expected create mode 120000 tests/derivation/utils/involved-types/norec-001/inv-ty.ipkg create mode 120000 tests/derivation/utils/involved-types/norec-001/run create mode 120000 tests/derivation/utils/involved-types/rec-001/Infra.idr create mode 100644 tests/derivation/utils/involved-types/rec-001/TypesAndInvolved.idr create mode 100644 tests/derivation/utils/involved-types/rec-001/expected create mode 120000 tests/derivation/utils/involved-types/rec-001/inv-ty.ipkg create mode 120000 tests/derivation/utils/involved-types/rec-001/run create mode 120000 tests/derivation/utils/involved-types/rec-002/Infra.idr create mode 100644 tests/derivation/utils/involved-types/rec-002/TypesAndInvolved.idr create mode 100644 tests/derivation/utils/involved-types/rec-002/expected create mode 120000 tests/derivation/utils/involved-types/rec-002/inv-ty.ipkg create mode 120000 tests/derivation/utils/involved-types/rec-002/run create mode 100644 tests/lib/coverage/ty-and-con-derived-001/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-derived-001/expected create mode 100755 tests/lib/coverage/ty-and-con-derived-001/run create mode 100644 tests/lib/coverage/ty-and-con-derived-001/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-derived-002/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-derived-002/expected create mode 100755 tests/lib/coverage/ty-and-con-derived-002/run create mode 100644 tests/lib/coverage/ty-and-con-derived-002/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-001/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-001/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-001/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-001/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-002/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-002/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-002/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-002/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-003/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-003/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-003/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-003/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-004/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-004/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-004/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-005/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-005/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-005/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-006/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-006/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-006/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-007/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-007/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-007/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-008/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-008/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-008/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-008/test.ipkg create mode 100644 tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr create mode 100644 tests/lib/coverage/ty-and-con-withCov-009/expected create mode 100755 tests/lib/coverage/ty-and-con-withCov-009/run create mode 100644 tests/lib/coverage/ty-and-con-withCov-009/test.ipkg diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2ad4aef3..551c013b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -93,6 +93,7 @@ deptycheck:test:derive: - utils/canonicsig/ - utils/cons-analysis/ - utils/arg-deps/ + - utils/involved-types/ - least-effort/print/adt - least-effort/print/gadt - least-effort/print/regression diff --git a/.pack-collection b/.pack-collection index be04e13ee..823aa1c15 100644 --- a/.pack-collection +++ b/.pack-collection @@ -1 +1 @@ -nightly-230910 +nightly-230923 diff --git a/deptycheck.ipkg b/deptycheck.ipkg index a50d1c879..b513bf222 100644 --- a/deptycheck.ipkg +++ b/deptycheck.ipkg @@ -28,7 +28,9 @@ modules = Data.Nat.Pos , Deriving.DepTyCheck.Util.Reflection , Deriving.DepTyCheck.Util.Syntax , Test.DepTyCheck.Gen + , Test.DepTyCheck.Gen.Coverage , Test.DepTyCheck.Gen.Emptiness + , Test.DepTyCheck.Gen.Labels depends = contrib , elab-util diff --git a/pack.toml b/pack.toml index 25862e73b..3b79d2c52 100644 --- a/pack.toml +++ b/pack.toml @@ -2,11 +2,11 @@ ### Settings ### ################ -collection = "nightly-230910" +collection = "nightly-230923" [idris2] url = "https://github.com/buzden/Idris2" -commit = "3f00baf08343acac9914717c77080bc1652041b0" +commit = "3f20e4dfd2453a5bc5400ea613efd7408c0bfab6" [install] whitelist = [ "deptycheck-tests", "pil-tests", "deptycheck-docs" ] diff --git a/src/Deriving/DepTyCheck/Gen/Core/ConsDerive.idr b/src/Deriving/DepTyCheck/Gen/Core/ConsDerive.idr index a1703d5a8..0d23d2dad 100644 --- a/src/Deriving/DepTyCheck/Gen/Core/ConsDerive.idr +++ b/src/Deriving/DepTyCheck/Gen/Core/ConsDerive.idr @@ -191,7 +191,7 @@ namespace NonObligatoryExts -- Producing the result -- -------------------------- - callOneOf "\{logPosition con} (orders)" <$> traverse genForOrder allOrders + callOneOf "\{show con.name} (orders)" <$> traverse genForOrder allOrders where diff --git a/src/Deriving/DepTyCheck/Util/Alternative.idr b/src/Deriving/DepTyCheck/Util/Alternative.idr index 29aa6c342..9ebc3095a 100644 --- a/src/Deriving/DepTyCheck/Util/Alternative.idr +++ b/src/Deriving/DepTyCheck/Util/Alternative.idr @@ -19,3 +19,8 @@ public export whenT : Alternative f => Bool -> a -> f a whenT True x = pure x whenT False _ = empty + +public export +whenTs : Alternative f => Bool -> f a -> f a +whenTs True x = x +whenTs False _ = empty diff --git a/src/Deriving/DepTyCheck/Util/Collections.idr b/src/Deriving/DepTyCheck/Util/Collections.idr index 86338e66a..0881c165b 100644 --- a/src/Deriving/DepTyCheck/Util/Collections.idr +++ b/src/Deriving/DepTyCheck/Util/Collections.idr @@ -43,6 +43,10 @@ findConsequentsWhich f xs = Nothing => [] Just tl => filter .| uncurry f .| xs `zip` tl +public export +infixOf : Eq a => List a -> List a -> Maybe (List a, List a) +infixOf = map (map snd) .: infixOfBy (\x, y => if x == y then Just () else Nothing) + public export %inline toNatList : Foldable f => f (Fin n) -> List Nat toNatList = map finToNat . toList diff --git a/src/Deriving/DepTyCheck/Util/Reflection.idr b/src/Deriving/DepTyCheck/Util/Reflection.idr index eb7504950..66f90cddd 100644 --- a/src/Deriving/DepTyCheck/Util/Reflection.idr +++ b/src/Deriving/DepTyCheck/Util/Reflection.idr @@ -33,6 +33,10 @@ export Interpolation TTImp where interpolate expr = show $ assert_total $ pretty {ann=Unit} expr +export +Interpolation Decl where + interpolate decl = show $ assert_total $ pretty {ann=Unit} decl + export SingleLogPosition Con where logPosition con = do @@ -156,16 +160,20 @@ export liftWeight1 : TTImp liftWeight1 = `(Data.Nat.Pos.one) +export +labelGen : (desc : String) -> TTImp -> TTImp +labelGen desc expr = `(Test.DepTyCheck.Gen.label (fromString ~(primVal $ Str desc)) ~expr) + export callOneOf : (desc : String) -> List TTImp -> TTImp -callOneOf _ [v] = v -callOneOf desc variants = `(Test.DepTyCheck.Gen.oneOf {description=Just ~(primVal $ Str desc)} {em=MaybeEmpty}) .$ liftList variants +callOneOf desc [v] = labelGen desc v +callOneOf desc variants = labelGen desc $ `(Test.DepTyCheck.Gen.oneOf {em=MaybeEmpty}) .$ liftList variants -- List of weights and subgenerators export callFrequency : (desc : String) -> List (TTImp, TTImp) -> TTImp callFrequency _ [(_, v)] = v -callFrequency desc variants = `(Test.DepTyCheck.Gen.frequency {description=Just ~(primVal $ Str desc)}) .$ +callFrequency desc variants = labelGen desc $ var `{Test.DepTyCheck.Gen.frequency} .$ liftList (variants <&> \(freq, subgen) => var `{Builtin.MkPair} .$ freq .$ subgen) -- TODO to think of better placement for this function; this anyway is intended to be called from the derived code. @@ -335,6 +343,30 @@ argDeps args = do Monoid a => Applicative f => Monoid (f a) where neutral = pure neutral +------------------------------------ +--- Analysis of type definitions --- +------------------------------------ + +||| Derives function `A -> B` where `A` is determined by the given `TypeInfo`, `B` is determined by `retTy` +||| +||| For each constructor of `A` the `matcher` function is applied and its result (of type `B`) is used as a result. +||| Currently, `B` must be a non-dependent type. +export +deriveMatchingCons : (retTy : TTImp) -> (matcher : Con -> TTImp) -> (funName : Name) -> TypeInfo -> List Decl +deriveMatchingCons retTy matcher funName ti = do + let claim = do + let tyApplied = reAppAny (var ti.name) $ ti.args <&> \arg => appArg arg $ var $ Arg.name arg + let sig = foldr + (pi . {count := M0, piInfo := ImplicitArg, name $= Just}) + `(~tyApplied -> ~retTy) + ti.args + private' funName sig + let body = do + let matchCon = \con => reAppAny (var con.name) $ con.args <&> flip appArg implicitTrue + def funName $ ti.cons <&> \con => + patClause (var funName .$ matchCon con) $ matcher con + [claim, body] + ------------------------------------------------- --- Syntactic analysis of `TTImp` expressions --- ------------------------------------------------- @@ -601,3 +633,45 @@ namespace UpToRenaming export [UpToRenaming] Eq TTImp where x == y = (x == y) @{UpToSubst @{empty}} + +-- Returns a list without duplications +export +allInvolvedTypes : Elaboration m => TypeInfo -> m $ List TypeInfo +allInvolvedTypes ti = toList <$> go [ti] empty where + go : (left : List TypeInfo) -> (curr : SortedMap Name TypeInfo) -> m $ SortedMap Name TypeInfo + go left curr = do + let (c::left) = filter (not . isJust . flip lookup curr . name) left + | [] => pure curr + let next = insert c.name c curr + args <- join <$> for c.args typesOfArg + cons <- join <$> for c.cons typesOfCon + assert_total $ go (args ++ cons ++ left) next + where + typesOfExpr : TTImp -> m $ List TypeInfo + typesOfExpr expr = map (mapMaybe id) $ for (allVarNames expr) $ catch . getInfo' + + typesOfArg : NamedArg -> m $ List TypeInfo + typesOfArg arg = typesOfExpr arg.type + + typesOfCon : Con -> m $ List TypeInfo + typesOfCon con = [| typesOfExpr con.type ++ (join <$> for con.args typesOfArg) |] + +||| Returns a name by the generator's type +||| +||| Say, for the `Fuel -> Gen em (n ** Fin n)` it returns name of `Data.Fin.Fin` +export +genTypeName : (0 _ : Type) -> Elab Name +genTypeName g = do + genTy <- quote g + let (_, genTy) = unPi genTy + let (lhs, args) = unAppAny genTy + let IVar _ lhsName = lhs + | _ => failAt (getFC lhs) "Generator or generator function expected" + let True = lhsName `nameConformsTo` `{Test.DepTyCheck.Gen.Gen} + | _ => failAt (getFC lhs) "Return type must be a generator of some type" + let [_, genTy] = args + | _ => failAt (getFC lhs) "Wrong number of type arguments of a generator" + let (_, genTy) = unDPair $ getExpr genTy + let (IVar _ genTy, _) = unApp genTy + | (genTy, _) => failAt (getFC genTy) "Expected a type name" + pure genTy diff --git a/src/Test/DepTyCheck/Gen.idr b/src/Test/DepTyCheck/Gen.idr index d4f644ff0..4c67c60de 100644 --- a/src/Test/DepTyCheck/Gen.idr +++ b/src/Test/DepTyCheck/Gen.idr @@ -14,6 +14,7 @@ import Data.List import Data.List.Lazy import public Data.CheckedEmpty.List.Lazy import Data.Singleton +import Data.SnocList import Data.Stream import Data.Vect @@ -22,6 +23,7 @@ import Decidable.Equality import public Language.Implicits.IfUnsolved import public Test.DepTyCheck.Gen.Emptiness +import public Test.DepTyCheck.Gen.Labels %default total @@ -47,7 +49,7 @@ transport z Refl = z record RawGen a where constructor MkRawGen - unRawGen : forall m. MonadRandom m => m a + unRawGen : forall m. MonadRandom m => CanManageLabels m => m a record OneOfAlternatives (0 em : Emptiness) (0 a : Type) @@ -68,9 +70,10 @@ data Gen : Emptiness -> Type -> Type where (0 _ : BindToOuter biem em) => RawGen c -> (c -> Gen biem a) -> Gen em a + Labelled : Label -> Gen em a -> Gen em a + record OneOfAlternatives (0 em : Emptiness) (0 a : Type) where constructor MkOneOf - desc : Maybe String gens : LazyLst1 (PosNat, Lazy (Gen em a)) totalWeight : Lazy (Singleton $ foldl1 (+) (gens <&> \x => fst x)) @@ -86,6 +89,27 @@ public export %inline Gen0 : Type -> Type Gen0 = Gen MaybeEmpty +----------------------------- +--- Very basic generators --- +----------------------------- + +export +chooseAny : Random a => (0 _ : IfUnsolved ne NonEmpty) => Gen ne a +chooseAny = Raw $ MkRawGen getRandom + +export +choose : Random a => (0 _ : IfUnsolved ne NonEmpty) => (a, a) -> Gen ne a +choose bounds = Raw $ MkRawGen $ getRandomR bounds + +export %inline +empty : Gen0 a +empty = Empty + +export +label : Label -> Gen em a -> Gen em a +label _ Empty = Empty +label l g = Labelled l g + ---------------------------- --- Equivalence relation --- ---------------------------- @@ -97,7 +121,7 @@ data Equiv : Gen lem a -> Gen rem a -> Type where EE : Empty `Equiv` Empty EP : Pure x `Equiv` Pure x ER : Raw x `Equiv` Raw x - EO : lgs `AltsEquiv` rgs => OneOf @{lalemem} @{lalemcd} (MkOneOf _ lgs _) `Equiv` OneOf @{ralemem} @{ralemcd} (MkOneOf _ rgs _) + EO : lgs `AltsEquiv` rgs => OneOf @{lalemem} @{lalemcd} (MkOneOf lgs _) `Equiv` OneOf @{ralemem} @{ralemcd} (MkOneOf rgs _) EB : Bind @{lbo} x g `Equiv` Bind @{rbo} x g data AltsEquiv : LazyLst lne (PosNat, Lazy (Gen lem a)) -> LazyLst rne (PosNat, Lazy (Gen lem a)) -> Type where @@ -120,7 +144,7 @@ mapTaggedLazy : (a -> b) -> LazyLst ne (tag, Lazy a) -> LazyLst ne (tag, Lazy b) mapTaggedLazy = map . mapSnd . wrapLazy mapOneOf : OneOfAlternatives iem a -> (Gen iem a -> Gen em b) -> OneOfAlternatives em b -mapOneOf (MkOneOf desc gs tw) f = MkOneOf desc (mapTaggedLazy f gs) $ do +mapOneOf (MkOneOf gs tw) f = MkOneOf (mapTaggedLazy f gs) $ do rewrite mapFusion (Builtin.fst) (mapSnd $ wrapLazy f) gs transport tw $ cong (Lazy.foldl1 (+)) $ mapExt gs $ \(_, _) => Refl @@ -137,9 +161,9 @@ trMTaggedLazy = traverseMaybe . m . wrapLazy where -- TODO to make the proof properly trMOneOf : OneOfAlternatives iem a -> (Gen iem a -> Maybe $ Gen em b) -> Maybe $ OneOfAlternatives em b -trMOneOf (MkOneOf desc gs tw) f with (trMTaggedLazy f gs) proof trm +trMOneOf (MkOneOf gs tw) f with (trMTaggedLazy f gs) proof trm _ | Nothing = Nothing - _ | Just gs' = Just $ MkOneOf desc gs' $ believe_me tw + _ | Just gs' = Just $ MkOneOf gs' $ believe_me tw ----------------------------- --- Emptiness tweakenings --- @@ -155,6 +179,7 @@ relax $ Pure x = Pure x relax $ Raw x = Raw x relax $ OneOf @{wo} x = OneOf @{transitive' wo %search} x relax $ Bind @{bo} x f = Bind @{bindToOuterRelax bo %search} x f +relax $ Labelled l x = label l $ relax x --export --strengthen' : {em : _} -> (gw : Gen iem a) -> Dec (gs : Gen em a ** gs `Equiv` gw) @@ -178,34 +203,18 @@ strengthen $ Bind {biem} x f with (decCanBeEmpty em) NonEmpty => Just $ Bind x f _ => Nothing +strengthen $ Labelled l x = label l <$> strengthen x + -------------------- --- More utility --- -------------------- mkOneOf : alem `NoWeaker` em => NotImmediatelyEmpty alem => - (desc : Maybe String) -> (gens : LazyLst1 (PosNat, Lazy (Gen alem a))) -> Gen em a -mkOneOf desc gens = OneOf $ MkOneOf desc gens $ Val _ +mkOneOf gens = OneOf $ MkOneOf gens $ Val _ -- TODO to make elimination of a single element --- TODO to think whether to propagate description deeper in the case of elimination - ------------------------------ ---- Very basic generators --- ------------------------------ - -export -chooseAny : Random a => (0 _ : IfUnsolved ne NonEmpty) => Gen ne a -chooseAny = Raw $ MkRawGen getRandom - -export -choose : Random a => (0 _ : IfUnsolved ne NonEmpty) => (a, a) -> Gen ne a -choose bounds = Raw $ MkRawGen $ getRandomR bounds - -export %inline -empty : Gen0 a -empty = Empty -------------------------- --- Running generators --- @@ -214,11 +223,12 @@ empty = Empty --- Non-empty generators --- export -unGen1 : MonadRandom m => Gen1 a -> m a +unGen1 : MonadRandom m => CanManageLabels m => Gen1 a -> m a unGen1 $ Pure x = pure x unGen1 $ Raw sf = sf.unRawGen unGen1 $ OneOf @{NN} oo = assert_total unGen1 . force . pickWeighted oo.gens . finToNat =<< randomFin oo.totalWeight.unVal unGen1 $ Bind @{bo} x f = case extractNE bo of Refl => x.unRawGen >>= unGen1 . f +unGen1 $ Labelled l x = manageLabel l $ unGen1 x export unGenAll' : RandomGen g => (seed : g) -> Gen1 a -> Stream (g, a) @@ -233,15 +243,16 @@ unGenAll = map snd .: unGenAll' --- Possibly empty generators --- export -unGen : MonadRandom m => MonadError () m => Gen em a -> m a -unGen $ Empty = throwError () -unGen $ Pure x = pure x -unGen $ Raw sf = sf.unRawGen -unGen $ OneOf oo = assert_total unGen . force . pickWeighted oo.gens . finToNat =<< randomFin oo.totalWeight.unVal -unGen $ Bind x f = x.unRawGen >>= unGen . f +unGen : MonadRandom m => MonadError () m => CanManageLabels m => Gen em a -> m a +unGen $ Empty = throwError () +unGen $ Pure x = pure x +unGen $ Raw sf = sf.unRawGen +unGen $ OneOf oo = assert_total unGen . force . pickWeighted oo.gens . finToNat =<< randomFin oo.totalWeight.unVal +unGen $ Bind x f = x.unRawGen >>= unGen . f +unGen $ Labelled l x = manageLabel l $ unGen x export %inline -unGen' : MonadRandom m => Gen em a -> m $ Maybe a +unGen' : MonadRandom m => CanManageLabels m => Gen em a -> m $ Maybe a unGen' = runMaybeT . unGen {m=MaybeT m} export @@ -281,11 +292,12 @@ Applicative RawGen where export Functor (Gen em) where - map f $ Empty = Empty - map f $ Pure x = Pure $ f x - map f $ Raw sf = Raw $ f <$> sf - map f $ OneOf oo = OneOf $ mapOneOf oo $ assert_total $ map f - map f $ Bind x g = Bind x $ assert_total map f . g + map f $ Empty = Empty + map f $ Pure x = Pure $ f x + map f $ Raw sf = Raw $ f <$> sf + map f $ OneOf oo = OneOf $ mapOneOf oo $ assert_total $ map f + map f $ Bind x g = Bind x $ assert_total map f . g + map f $ Labelled l x = label l $ map f x export {em : _} -> Applicative (Gen em) where @@ -300,6 +312,9 @@ export Raw sfl <*> Raw sfr = Raw $ sfl <*> sfr + Labelled l x <*> y = label l $ x <*> y + x <*> Labelled l y = label l $ x <*> y + OneOf @{ao} @{au} {alem} oo <*> g = case canBeNotImmediatelyEmpty em of Right _ => OneOf {em} $ mapOneOf oo $ \x => assert_total $ relax x <*> g Left Refl => maybe Empty (\g => OneOf $ mapOneOf oo $ \x => assert_total $ relax x <*> g) $ strengthen {em=MaybeEmptyDeep} g @@ -321,11 +336,12 @@ export Raw g >>= nf = Bind @{reflexive} g nf (OneOf @{ao} oo >>= nf) {em=NonEmpty} with (ao) _ | NN = OneOf $ mapOneOf oo $ assert_total (>>= nf) (OneOf @{ao} oo >>= nf) {em=MaybeEmptyDeep} = OneOf $ mapOneOf oo $ assert_total (>>= nf) . relax @{ao} - (OneOf {alem} (MkOneOf desc gs _) >>= nf) {em=MaybeEmpty} = maybe Empty (mkOneOf {alem=MaybeEmptyDeep} desc) $ + (OneOf {alem} (MkOneOf gs _) >>= nf) {em=MaybeEmpty} = maybe Empty (mkOneOf {alem=MaybeEmptyDeep}) $ strengthen $ flip mapMaybe gs $ traverse $ map delay . strengthen . assert_total (>>= nf) . relax . force Bind {biem} x f >>= nf with (order {rel=NoWeaker} biem em) _ | Left _ = Bind x $ \x => assert_total $ relax (f x) >>= nf _ | Right _ = Bind {biem} x $ \x => assert_total $ relax (f x) >>= relax . nf + Labelled l x >>= nf = label l $ x >>= nf ----------------------------------------- --- Detour: special list of lazy gens --- @@ -446,17 +462,16 @@ namespace OneOf ||| All the given generators are treated as independent, i.e. `oneOf [oneOf [a, b], c]` is not the same as `oneOf [a, b, c]`. ||| In this example case, generator `oneOf [a, b]` and generator `c` will have the same probability in the resulting generator. export -oneOf : {default Nothing description : Maybe String} -> - {em : _} -> +oneOf : {em : _} -> alem `NoWeaker` em => AltsNonEmpty altsNe em => (0 _ : IfUnsolved alem em) => (0 _ : IfUnsolved altsNe $ em /= MaybeEmpty) => GenAlternatives altsNe alem a -> Gen em a -oneOf {em=NonEmpty} @{NN} @{NT} $ MkGenAlternatives xs = mkOneOf description xs -oneOf {em=MaybeEmptyDeep} @{_} @{DT} x = case x of MkGenAlternatives xs => mkOneOf description xs +oneOf {em=NonEmpty} @{NN} @{NT} $ MkGenAlternatives xs = mkOneOf xs +oneOf {em=MaybeEmptyDeep} @{_} @{DT} x = case x of MkGenAlternatives xs => mkOneOf xs oneOf {em=MaybeEmpty} x = case x of MkGenAlternatives xs => do - maybe Empty (mkOneOf description) $ strengthen $ flip mapMaybe xs $ + maybe Empty mkOneOf $ strengthen $ flip mapMaybe xs $ \wg => (fst wg,) . delay <$> Gen.strengthen {em=MaybeEmptyDeep} (snd wg) ||| Choose one of the given generators with probability proportional to the given value, treating all source generators independently. @@ -466,33 +481,30 @@ oneOf {em=MaybeEmpty} x = case x of MkGenAlternatives xs => do ||| If generator `g1` has the frequency `n1` and generator `g2` has the frequency `n2`, than `g1` will be used `n1/n2` times ||| more frequently than `g2` in the resulting generator (in case when `g1` and `g2` always generate some value). export -frequency : {default Nothing description : Maybe String} -> - {em : _} -> +frequency : {em : _} -> alem `NoWeaker` em => AltsNonEmpty altsNe em => (0 _ : IfUnsolved alem em) => (0 _ : IfUnsolved altsNe $ em /= MaybeEmpty) => LazyLst altsNe (PosNat, Lazy (Gen alem a)) -> Gen em a -frequency = oneOf {description} . MkGenAlternatives +frequency = oneOf . MkGenAlternatives ||| Choose one of the given values uniformly. ||| ||| This function is equivalent to `oneOf` applied to list of `pure` generators per each value. export -elements : {default Nothing description : Maybe String} -> - {em : _} -> +elements : {em : _} -> AltsNonEmpty altsNe em => (0 _ : IfUnsolved em NonEmpty) => (0 _ : IfUnsolved altsNe $ em /= MaybeEmpty) => LazyLst altsNe a -> Gen em a -elements = oneOf {alem=NonEmpty} {description} . altsFromList +elements = oneOf {alem=NonEmpty} . altsFromList export %inline elements' : Foldable f => (0 _ : IfUnsolved f List) => - {default Nothing description : Maybe String} -> f a -> Gen0 a -elements' xs = elements {description} $ relaxF $ fromList $ toList xs +elements' xs = elements $ relaxF $ fromList $ toList xs ------------------------------ --- Analysis of generators --- @@ -500,8 +512,9 @@ elements' xs = elements {description} $ relaxF $ fromList $ toList xs export alternativesOf : {em : _} -> Gen em a -> GenAlternatives True em a -alternativesOf $ OneOf oo = MkGenAlternatives $ gens $ mapOneOf oo relax -alternativesOf g = [g] +alternativesOf $ OneOf oo = MkGenAlternatives $ gens $ mapOneOf oo relax +alternativesOf $ Labelled l x = processAlternatives (label l) $ alternativesOf x +alternativesOf g = [g] ||| Any depth alternatives fetching. ||| @@ -527,8 +540,9 @@ forgetAlternatives g@(OneOf {}) = case canBeNotImmediatelyEmpty em of Left Refl => maybe Empty single $ strengthen {em=MaybeEmptyDeep} g where %inline single : iem `NoWeaker` MaybeEmptyDeep => iem `NoWeaker` em => Gen iem a -> Gen em a - single g = OneOf $ MkOneOf (Just "forgetAlternatives") [(1, g)] $ Val _ + single g = label "forgetAlternatives" $ OneOf $ MkOneOf [(1, g)] $ Val _ -- `mkOneOf` is not used here intentionally, since if `mkOneOf` is changed to eliminate single-element `MkOneOf`'s, we still want such behaviour here. +forgetAlternatives (Labelled l x) = label l $ forgetAlternatives x forgetAlternatives g = g ||| Returns generator with internal structure hidden to anything, including combinators, diff --git a/src/Test/DepTyCheck/Gen/Coverage.idr b/src/Test/DepTyCheck/Gen/Coverage.idr new file mode 100644 index 000000000..cf0ccd062 --- /dev/null +++ b/src/Test/DepTyCheck/Gen/Coverage.idr @@ -0,0 +1,175 @@ +||| Definitions and functions for working with model coverage of a bunch of generated values. +||| +||| Model coverage means a coverage in terms of the original data structure that is being generated, +||| e.g. involved types and their constructors. +module Test.DepTyCheck.Gen.Coverage + +import Control.ANSI + +import Control.Monad.Maybe +import Control.Monad.Random +import Control.Monad.Writer + +import Data.List +import Data.Singleton +import Data.SortedMap + +import public Deriving.DepTyCheck.Util.Logging +import public Deriving.DepTyCheck.Util.Reflection + +import public Language.Reflection +import public Language.Reflection.Types +import public Language.Reflection.Syntax + +import Test.DepTyCheck.Gen + +%default total + +export +record ModelCoverage where + constructor MkModelCoverage + unModelCoverage : SortedSet Label + +export +Semigroup ModelCoverage where + (<+>) = MkModelCoverage .: (<+>) `on` unModelCoverage + +export +Monoid ModelCoverage where + neutral = MkModelCoverage neutral + +MonadWriter ModelCoverage m => CanManageLabels m where + manageLabel l x = tell (MkModelCoverage $ singleton l) >> x + +export +unGenTryAllD : RandomGen g => (seed : g) -> Gen em a -> Stream $ Maybe (ModelCoverage, a) +unGenTryAllD seed gen = do + let (seed, sv) = runRandom seed $ runMaybeT $ runWriterT $ unGen {m=WriterT ModelCoverage $ MaybeT Rand} gen + map swap sv :: unGenTryAllD seed gen + +export +unGenTryND : RandomGen g => (n : Nat) -> g -> Gen em a -> LazyList (ModelCoverage, a) +unGenTryND n = mapMaybe id .: take (limit n) .: unGenTryAllD + +export +record CoverageGenInfo (0 g : k) where + constructor MkCoverageGenInfo + types : SortedMap String TypeInfo + constructors : SortedMap String (TypeInfo, Con) + coverageInfo : SortedMap TypeInfo (Bool, SortedMap Con Bool) + +coverageGenInfo : Name -> Elab $ CoverageGenInfo x +coverageGenInfo genTy = do + involvedTypes <- allInvolvedTypes =<< getInfo' genTy + let cov = fromList $ involvedTypes <&> \ty => (ty, False, fromList $ ty.cons <&> (, False)) + let tys = fromList $ involvedTypes <&> \ty => (show ty.name, ty) + let cons = fromList $ (involvedTypes >>= \ty => (ty,) <$> ty.cons) <&> \(ty, co) => (show co.name, ty, co) + pure $ MkCoverageGenInfo tys cons cov + + where + Eq TypeInfo where + (==) = (==) `on` name + + Ord TypeInfo where + compare = comparing name + + Eq Con where + (==) = (==) `on` name + + Ord Con where + compare = comparing name + +export %macro +initCoverageInfo' : (n : Name) -> Elab $ CoverageGenInfo n +initCoverageInfo' n = coverageGenInfo n + +export %macro +initCoverageInfo : (0 x : g) -> Elab $ CoverageGenInfo x +initCoverageInfo _ = genTypeName g >>= coverageGenInfo + +||| Adds labelling of types and constructors to a given generator +||| +||| Added labelling is not deep, i.e. it adds labels only for the returned type of a generator. +||| If returned type is a dependent pair, the rightmost type is taken into the account. +export %macro +withCoverage : {em : _} -> (gen : Gen em a) -> Elab $ Gen em a +withCoverage gen = do + tyExpr <- quote a + let (dpairLefts, tyRExpr) = unDPair tyExpr + let (IVar _ tyName, _) = unApp tyRExpr + | (genTy, _) => failAt (getFC genTy) "Expected a normal type name" + tyInfo <- getInfo' tyName + let matchDPair = \expr => foldr (\_, r => var "Builtin.DPair.MkDPair" .$ implicitTrue .$ r) expr dpairLefts + let tyLabelStr = "\{show tyName}[?]" + let labelledValName = UN $ Basic "^val^" + let labellingFunName = UN $ Basic "^labelling^" + let undpairedVal = "^undpaired^" + let consLabellingFun = deriveMatchingCons + `(Test.DepTyCheck.Gen.Labels.Label) + (\con => var "fromString" .$ primVal (Str $ "\{show con.name} (user-defined)")) + labellingFunName tyInfo + labeller <- check $ lam (lambdaArg labelledValName) $ + local consLabellingFun $ + `(Test.DepTyCheck.Gen.label + ~(iCase (var labelledValName) implicitTrue $ pure $ + patClause + (matchDPair $ bindVar undpairedVal) + (var labellingFunName .$ varStr undpairedVal)) + (pure ~(var labelledValName))) + pure $ label (fromString tyLabelStr) $ gen >>= labeller + +c : (colourful : Bool) -> Color -> String -> String +c False _ = id +c True col = show . colored col + +||| Boldens the rightmost name after the last dot, if coloured +showType : (colourful : Bool) -> TypeInfo -> String +showType False ti = show ti.name +showType True ti = joinBy "." $ forget $ uncurry lappend $ map (singleton . show . bolden) $ unsnoc $ split (== '.') $ show ti.name + +toString : (colourful : Bool) -> CoverageGenInfo g -> String +toString col cgi = joinBy "\n\n" $ mapMaybe (\ti => lookup ti cgi.coverageInfo <&> (ti,)) (SortedMap.values cgi.types) <&> \(ti, tyCov, cons) => do + let conCovs = values cons + let anyCons = not $ null conCovs + let allConsCovered = all (== True) conCovs + let noConsCovered = all (== False) conCovs + + let c = c col + let tyCovStr = joinBy ", " $ + (if tyCov && noConsCovered then [c BrightYellow "mentioned"] + else if not tyCov && (not anyCons || not noConsCovered) then [c BrightYellow "not menioned"] + else []) ++ + (if not anyCons then [c Cyan "no constructors"] + else if allConsCovered then [c BrightGreen "covered fully"] + else if noConsCovered then [c BrightRed "not covered"] + else [c BrightYellow "covered partially"] + ) + joinBy "\n" $ (::) "\{showType col ti} \{tyCovStr}" $ whenTs anyCons $ map (" - " ++) $ + SortedMap.toList cons <&> \(co, coCov) => do + let status : String := if coCov then c BrightGreen "covered" else c BrightRed "not covered" + "\{logPosition co}: \{status}" + +export +Show (CoverageGenInfo g) where show = toString False + +export +[Colourful] Show (CoverageGenInfo g) where show = toString True + +export +registerCoverage : ModelCoverage -> CoverageGenInfo g -> CoverageGenInfo g +registerCoverage mc cgi = foldr registerCoverage1 cgi mc.unModelCoverage where + registerCoverage1 : Label -> CoverageGenInfo g -> CoverageGenInfo g + registerCoverage1 str cgi = do + let str = show str + let str' = fastUnpack str + -- Try type + let ty = maybe str (fastPack . fst) $ fastUnpack "[" `infixOf` str' + let tyMod = case lookup ty cgi.types of + Just ti => { coverageInfo $= updateExisting (mapFst $ const True) ti } + Nothing => id + -- Try constructor + let co = maybe str (fastPack . fst) $ fastUnpack " " `infixOf` str' + let coMod : (_ -> CoverageGenInfo g) := case lookup co cgi.constructors of + Just (ti, co) => { coverageInfo $= updateExisting (mapSnd $ insert co True) ti } + Nothing => id + tyMod $ coMod $ cgi diff --git a/src/Test/DepTyCheck/Gen/Labels.idr b/src/Test/DepTyCheck/Gen/Labels.idr new file mode 100644 index 000000000..04927618c --- /dev/null +++ b/src/Test/DepTyCheck/Gen/Labels.idr @@ -0,0 +1,37 @@ +module Test.DepTyCheck.Gen.Labels + +%default total + +----------------- +--- Labelling --- +----------------- + +export +data Label : Type where + StringLabel : String -> Label + +export %inline +FromString Label where + fromString = StringLabel + +export %inline +Show Label where + show (StringLabel x) = x + +export +Eq Label where + StringLabel x == StringLabel y = x == y + +export +Ord Label where + compare = comparing $ \(StringLabel x) => x + +public export +interface CanManageLabels (0 m : Type -> Type) where + manageLabel : Label -> m a -> m a + +export %defaulthint +IgnoreLabels : CanManageLabels m +IgnoreLabels = I where + [I] CanManageLabels m where + manageLabel _ = id diff --git a/tests/derivation/infra/empty-cons print 001/expected b/tests/derivation/infra/empty-cons print 001/expected index bd4c1a202..0dca6f76b 100644 --- a/tests/derivation/infra/empty-cons print 001/expected +++ b/tests/derivation/infra/empty-cons print 001/expected @@ -15,8 +15,11 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Unit))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Builtin.Unit[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 002/expected b/tests/derivation/infra/empty-cons print 002/expected index cb3c63ab5..8d526c259 100644 --- a/tests/derivation/infra/empty-cons print 002/expected +++ b/tests/derivation/infra/empty-cons print 002/expected @@ -30,32 +30,35 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^ - $ IVar inter^) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[0, 1] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^ + $ IVar inter^)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Data.Vect.Vect[0, 1] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^ - $ IVar inter^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[0, 1] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^ $ IVar inter^)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^ + $ IVar inter^)) + $ IVar Nil)))) ])) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 003/expected b/tests/derivation/infra/empty-cons print 003/expected index 86128f7c5..dfd0a1ad5 100644 --- a/tests/derivation/infra/empty-cons print 003/expected +++ b/tests/derivation/infra/empty-cons print 003/expected @@ -20,19 +20,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal Prelude.Basics.Bool[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.Bool[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 004/expected b/tests/derivation/infra/empty-cons print 004/expected index d27103d99..9041291da 100644 --- a/tests/derivation/infra/empty-cons print 004/expected +++ b/tests/derivation/infra/empty-cons print 004/expected @@ -22,9 +22,12 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 005/expected b/tests/derivation/infra/empty-cons print 005/expected index a9e54d6ac..5055cd844 100644 --- a/tests/derivation/infra/empty-cons print 005/expected +++ b/tests/derivation/infra/empty-cons print 005/expected @@ -19,8 +19,11 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar {arg:3630})))))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 006/expected b/tests/derivation/infra/empty-cons print 006/expected index 5ec155e6a..e125be75e 100644 --- a/tests/derivation/infra/empty-cons print 006/expected +++ b/tests/derivation/infra/empty-cons print 006/expected @@ -29,29 +29,32 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[1] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Data.Vect.Vect[1] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[1] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^)) + $ IVar Nil)))) ])) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 007/expected b/tests/derivation/infra/empty-cons print 007/expected index 67bc54e4a..87d2be7ab 100644 --- a/tests/derivation/infra/empty-cons print 007/expected +++ b/tests/derivation/infra/empty-cons print 007/expected @@ -23,19 +23,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar {arg:3633})))))))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 008/expected b/tests/derivation/infra/empty-cons print 008/expected index dcbff0956..a22edbacb 100644 --- a/tests/derivation/infra/empty-cons print 008/expected +++ b/tests/derivation/infra/empty-cons print 008/expected @@ -26,26 +26,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Data.Vect.Vect[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Vect.Vect[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 009/expected b/tests/derivation/infra/empty-cons print 009/expected index 7bb924795..286429f1a 100644 --- a/tests/derivation/infra/empty-cons print 009/expected +++ b/tests/derivation/infra/empty-cons print 009/expected @@ -15,22 +15,22 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar DerivedGen.X))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil))))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil)))))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 010/expected b/tests/derivation/infra/empty-cons print 010/expected index 6636a5f78..b49aa5c4f 100644 --- a/tests/derivation/infra/empty-cons print 010/expected +++ b/tests/derivation/infra/empty-cons print 010/expected @@ -18,42 +18,42 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (dry fuel))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (dry fuel)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar Data.Fuel.Dry) - $ IVar Nil))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry) + $ IVar Nil)))) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil)))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil))))) ])) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 011/expected b/tests/derivation/infra/empty-cons print 011/expected index 36f482ef5..6540a05c9 100644 --- a/tests/derivation/infra/empty-cons print 011/expected +++ b/tests/derivation/infra/empty-cons print 011/expected @@ -22,42 +22,42 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (dry fuel))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (dry fuel)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar Data.Fuel.Dry) - $ IVar Nil))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry) + $ IVar Nil)))) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil)))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil))))) ])) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 012/expected b/tests/derivation/infra/empty-cons print 012/expected index 3b13b9159..b4897a56b 100644 --- a/tests/derivation/infra/empty-cons print 012/expected +++ b/tests/derivation/infra/empty-cons print 012/expected @@ -27,23 +27,23 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}> $ IBindVar inter^<{arg:3633}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[0, 1] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}> $ IVar inter^<{arg:3633}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}>) + $ IVar Nil))))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 013/expected b/tests/derivation/infra/empty-cons print 013/expected index 400714ff2..28e47e455 100644 --- a/tests/derivation/infra/empty-cons print 013/expected +++ b/tests/derivation/infra/empty-cons print 013/expected @@ -37,27 +37,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar inter^<{arg:3633}> $ IBindVar inter^<{arg:3636}> $ IBindVar inter^<{arg:3639}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[0, 1, 2, 3] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}> - $ IVar inter^<{arg:3636}> - $ IVar inter^<{arg:3639}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1, 2, 3] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}> $ IVar inter^<{arg:3633}> $ IVar inter^<{arg:3636}> $ IVar inter^<{arg:3639}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}> + $ IVar inter^<{arg:3636}> + $ IVar inter^<{arg:3639}>) + $ IVar Nil))))) IClaim MW Export [] diff --git a/tests/derivation/infra/empty-cons print 014/expected b/tests/derivation/infra/empty-cons print 014/expected index 82411946a..c0dcaddad 100644 --- a/tests/derivation/infra/empty-cons print 014/expected +++ b/tests/derivation/infra/empty-cons print 014/expected @@ -41,27 +41,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar inter^<{arg:3633}> $ IBindVar inter^<{arg:3636}> $ IBindVar inter^<{arg:3639}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[0, 1, 2, 3] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}> - $ IVar inter^<{arg:3636}> - $ IVar inter^<{arg:3639}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1, 2, 3] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}> $ IVar inter^<{arg:3633}> $ IVar inter^<{arg:3636}> $ IVar inter^<{arg:3639}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}> + $ IVar inter^<{arg:3636}> + $ IVar inter^<{arg:3639}>) + $ IVar Nil))))) IClaim MW Export [] diff --git a/tests/derivation/least-effort/print/adt/001 trivial/expected b/tests/derivation/least-effort/print/adt/001 trivial/expected index eff54898c..d20489774 100644 --- a/tests/derivation/least-effort/print/adt/001 trivial/expected +++ b/tests/derivation/least-effort/print/adt/001 trivial/expected @@ -15,8 +15,11 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Unit))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Builtin.Unit[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -28,8 +31,11 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Builtin.MkUnit) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Builtin.MkUnit (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Builtin.MkUnit)) ] ] diff --git a/tests/derivation/least-effort/print/adt/002 noparam/expected b/tests/derivation/least-effort/print/adt/002 noparam/expected index 986757805..7f54a2bc5 100644 --- a/tests/derivation/least-effort/print/adt/002 noparam/expected +++ b/tests/derivation/least-effort/print/adt/002 noparam/expected @@ -16,19 +16,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal Prelude.Basics.Bool[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.Bool[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -48,16 +48,22 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.False) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.False (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.False)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.True) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.True (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.True)) ] ] diff --git a/tests/derivation/least-effort/print/adt/003 noparam/expected b/tests/derivation/least-effort/print/adt/003 noparam/expected index ae5ad081f..fb206c881 100644 --- a/tests/derivation/least-effort/print/adt/003 noparam/expected +++ b/tests/derivation/least-effort/print/adt/003 noparam/expected @@ -19,26 +19,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -58,21 +61,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] diff --git a/tests/derivation/least-effort/print/adt/004 noparam/expected b/tests/derivation/least-effort/print/adt/004 noparam/expected index 28231cf0d..4d54ad886 100644 --- a/tests/derivation/least-effort/print/adt/004 noparam/expected +++ b/tests/derivation/least-effort/print/adt/004 noparam/expected @@ -27,26 +27,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -66,49 +69,58 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -128,26 +140,32 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar DerivedGen.E) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.E (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar DerivedGen.E)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3633} : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar DerivedGen.R - $ IVar ^bnd^{arg:3633} - $ IVar ^bnd^{arg:3636})))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.R (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3633} : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar DerivedGen.R + $ IVar ^bnd^{arg:3633} + $ IVar ^bnd^{arg:3636}))))))) ] ] diff --git a/tests/derivation/least-effort/print/adt/005 param/expected b/tests/derivation/least-effort/print/adt/005 param/expected index 8e19d662b..7e73c4057 100644 --- a/tests/derivation/least-effort/print/adt/005 param/expected +++ b/tests/derivation/least-effort/print/adt/005 param/expected @@ -22,9 +22,12 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] @@ -39,10 +42,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n))) ] ] diff --git a/tests/derivation/least-effort/print/adt/006 param/expected b/tests/derivation/least-effort/print/adt/006 param/expected index 810ee32d8..d148fbb94 100644 --- a/tests/derivation/least-effort/print/adt/006 param/expected +++ b/tests/derivation/least-effort/print/adt/006 param/expected @@ -31,26 +31,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -70,28 +73,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -107,16 +119,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n)))))) ] ] diff --git a/tests/derivation/least-effort/print/adt/007 right-to-left simple/expected b/tests/derivation/least-effort/print/adt/007 right-to-left simple/expected index 25ce31afe..9569e0406 100644 --- a/tests/derivation/least-effort/print/adt/007 right-to-left simple/expected +++ b/tests/derivation/least-effort/print/adt/007 right-to-left simple/expected @@ -39,26 +39,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -78,28 +81,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -115,23 +127,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -143,20 +161,23 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ IBindVar ^bnd^{arg:3642}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.MkY) - n - (IVar n) - $ IVar ^bnd^{arg:3642})) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ IBindVar ^bnd^{arg:3642}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.MkY) + n + (IVar n) + $ IVar ^bnd^{arg:3642})) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/008 right-to-left simple/expected b/tests/derivation/least-effort/print/adt/008 right-to-left simple/expected index 06b94def6..e2dd7e83c 100644 --- a/tests/derivation/least-effort/print/adt/008 right-to-left simple/expected +++ b/tests/derivation/least-effort/print/adt/008 right-to-left simple/expected @@ -39,26 +39,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -78,28 +81,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -115,23 +127,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -143,20 +161,23 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ IBindVar ^bnd^{arg:3643}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.MkY) - n - (IVar n) - $ IVar ^bnd^{arg:3643})) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ IBindVar ^bnd^{arg:3643}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.MkY) + n + (IVar n) + $ IVar ^bnd^{arg:3643})) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/009 left-to-right/expected b/tests/derivation/least-effort/print/adt/009 left-to-right/expected index 2c2ab7198..c0398bc9c 100644 --- a/tests/derivation/least-effort/print/adt/009 left-to-right/expected +++ b/tests/derivation/least-effort/print/adt/009 left-to-right/expected @@ -37,26 +37,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -76,31 +79,40 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] @@ -115,17 +127,23 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -137,24 +155,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ (IApp. IVar Prelude.Types.mult - $ IVar n - $ (IApp. IVar Prelude.Types.S + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ (IApp. IVar Prelude.Types.mult + $ IVar n $ (IApp. IVar Prelude.Types.S - $ IVar Prelude.Types.Z)))) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3646} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.MkY) - n - (IVar n) - $ IVar ^bnd^{arg:3646})))))) ] ] + $ (IApp. IVar Prelude.Types.S + $ IVar Prelude.Types.Z)))) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3646} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.MkY) + n + (IVar n) + $ IVar ^bnd^{arg:3646}))))))) ] ] diff --git a/tests/derivation/least-effort/print/adt/010 right-to-left long-dpair/expected b/tests/derivation/least-effort/print/adt/010 right-to-left long-dpair/expected index 459882ae0..90e2e9506 100644 --- a/tests/derivation/least-effort/print/adt/010 right-to-left long-dpair/expected +++ b/tests/derivation/least-effort/print/adt/010 right-to-left long-dpair/expected @@ -43,26 +43,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -82,28 +85,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -123,31 +135,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) - m - (IVar m)))))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (INamedApp (IVar DerivedGen.MkX) + n + (IVar n)) + m + (IVar m))))))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -159,24 +177,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3651})) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.MkY) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3651})) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3651})) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.MkY) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3651})) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/011 right-to-left long-dpair/expected b/tests/derivation/least-effort/print/adt/011 right-to-left long-dpair/expected index 503419714..694b02c56 100644 --- a/tests/derivation/least-effort/print/adt/011 right-to-left long-dpair/expected +++ b/tests/derivation/least-effort/print/adt/011 right-to-left long-dpair/expected @@ -51,26 +51,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -90,28 +93,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Builtin.Unit[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -123,15 +135,21 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Builtin.MkUnit) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Builtin.MkUnit (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Builtin.MkUnit)) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -151,31 +169,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) - m - (IVar m)))))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (INamedApp (IVar DerivedGen.MkX) + n + (IVar n)) + m + (IVar m))))))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -187,24 +211,27 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3651})) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.MkY) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3651})) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3651})) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.MkY) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3651})) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/012 right-to-left chained/expected b/tests/derivation/least-effort/print/adt/012 right-to-left chained/expected index 9b5729c5e..b0300d521 100644 --- a/tests/derivation/least-effort/print/adt/012 right-to-left chained/expected +++ b/tests/derivation/least-effort/print/adt/012 right-to-left chained/expected @@ -51,26 +51,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -90,28 +93,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X1[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -127,22 +139,28 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.MkX1 - $ IVar n))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX1 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX1 + $ IVar n)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X2[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -158,28 +176,34 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ IBindVar ^bnd^{arg:3650}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.MkX2 - $ IVar n - $ IVar ^bnd^{arg:3650}))) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX2 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ IBindVar ^bnd^{arg:3650}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX2 + $ IVar n + $ IVar ^bnd^{arg:3650}))) ]))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -191,20 +215,23 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ IBindVar ^bnd^{arg:3658}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.MkY) - n - (IVar n) - $ IVar ^bnd^{arg:3658})) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ IBindVar ^bnd^{arg:3658}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.MkY) + n + (IVar n) + $ IVar ^bnd^{arg:3658})) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/013 right-to-left nondet/expected b/tests/derivation/least-effort/print/adt/013 right-to-left nondet/expected index a1bcb815f..d4b2a23b6 100644 --- a/tests/derivation/least-effort/print/adt/013 right-to-left nondet/expected +++ b/tests/derivation/least-effort/print/adt/013 right-to-left nondet/expected @@ -57,26 +57,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -96,28 +99,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -137,34 +149,40 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) - m - (IVar m)))))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (INamedApp (IVar DerivedGen.MkX) + n + (IVar n)) + m + (IVar m))))))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] @@ -183,25 +201,31 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) - m - (IVar m))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (INamedApp (IVar DerivedGen.MkX) + n + (IVar n)) + m + (IVar m)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -213,37 +237,40 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3654})) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ IVar n) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3651}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3651} - $ IVar ^bnd^{arg:3654})) ])) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3654})) + (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ IVar n) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3651}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3651} + $ IVar ^bnd^{arg:3654})) ])) ]))) ] ] diff --git a/tests/derivation/least-effort/print/adt/014 right-to-left nondet ext/expected b/tests/derivation/least-effort/print/adt/014 right-to-left nondet ext/expected index 993e26a03..e94b8cb97 100644 --- a/tests/derivation/least-effort/print/adt/014 right-to-left nondet ext/expected +++ b/tests/derivation/least-effort/print/adt/014 right-to-left nondet ext/expected @@ -53,8 +53,11 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar DerivedGen.Y))) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -74,32 +77,38 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar m)))))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar m))))))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] @@ -118,23 +127,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar m))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar m)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -146,37 +161,40 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3654})) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ IVar n) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3651}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3651} - $ IVar ^bnd^{arg:3654})) ])) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3654})) + (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ IVar n) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3651}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3651} + $ IVar ^bnd^{arg:3654})) ])) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/001 gadt/expected b/tests/derivation/least-effort/print/gadt/001 gadt/expected index 02d2297e9..273dcc401 100644 --- a/tests/derivation/least-effort/print/gadt/001 gadt/expected +++ b/tests/derivation/least-effort/print/gadt/001 gadt/expected @@ -24,29 +24,32 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.Fin[0] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Data.Fin.Fin[0] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.Fin[0] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -72,13 +75,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^cons_fuel^ $ (IApp. IVar Prelude.Types.S $ IBindVar k)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar Data.Fin.FZ) - k - (IVar k)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.FZ (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar Data.Fin.FZ) + k + (IVar k))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -88,19 +94,22 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^cons_fuel^ $ (IApp. IVar Prelude.Types.S $ IBindVar k)) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^cons_fuel^ - $ IVar k) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3095} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar Data.Fin.FS) - k - (IVar k) - $ IVar ^bnd^{arg:3095})))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.FS (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^cons_fuel^ + $ IVar k) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3095} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar Data.Fin.FS) + k + (IVar k) + $ IVar ^bnd^{arg:3095}))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) diff --git a/tests/derivation/least-effort/print/gadt/002 gadt/expected b/tests/derivation/least-effort/print/gadt/002 gadt/expected index 2bf8dd29b..ae16683fa 100644 --- a/tests/derivation/least-effort/print/gadt/002 gadt/expected +++ b/tests/derivation/least-effort/print/gadt/002 gadt/expected @@ -31,26 +31,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -70,49 +73,58 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.Fin[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Data.Fin.Fin[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.Fin[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -140,38 +152,44 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg k : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar Data.Fin.FZ) - k - (IVar k))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.FZ (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg k : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar Data.Fin.FZ) + k + (IVar k)))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3095}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar Data.Fin.FS) - k - (IVar k) - $ IVar ^bnd^{arg:3095}))) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Data.Fin.FS (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3095}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar Data.Fin.FS) + k + (IVar k) + $ IVar ^bnd^{arg:3095}))) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/003 right-to-left nondet/expected b/tests/derivation/least-effort/print/gadt/003 right-to-left nondet/expected index f45dd6b5f..30740b78e 100644 --- a/tests/derivation/least-effort/print/gadt/003 right-to-left nondet/expected +++ b/tests/derivation/least-effort/print/gadt/003 right-to-left nondet/expected @@ -71,26 +71,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -110,40 +113,46 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X_GADT[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_GADT[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -179,52 +188,58 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_4 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ IVar DerivedGen.MkXG_4))) ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ IVar DerivedGen.MkXG_4)))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_5 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (IVar DerivedGen.MkXG_5) - m - (IVar m)))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkXG_5) + m + (IVar m))))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X_GADT[0] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_GADT[0] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>) + $ IVar Nil))))) IClaim MW Export [] @@ -261,13 +276,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IVar Prelude.Types.Z))))) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ IVar DerivedGen.MkXG_4)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_4 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ IVar DerivedGen.MkXG_4))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -281,19 +299,22 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IVar Prelude.Types.Z)))))) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkXG_5) - m - (IVar m))))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_5 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkXG_5) + m + (IVar m)))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -302,21 +323,21 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar [1] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3633}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X_GADT[1] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3633}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_GADT[1] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3633}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3633}>) + $ IVar Nil))))) IClaim MW Export [] @@ -354,13 +375,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IVar Prelude.Types.Z)))))) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ IVar DerivedGen.MkXG_4)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_4 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ IVar DerivedGen.MkXG_4))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -369,30 +393,33 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar m) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkXG_5) - m - (IVar m))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_5 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkXG_5) + m + (IVar m)))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.Y[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -412,74 +439,80 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3660})) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ IVar n) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3657}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY1) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3657} - $ IVar ^bnd^{arg:3660})) ])) ])) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY1 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3660})) + (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ IVar n) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3657}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY1) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3657} + $ IVar ^bnd^{arg:3660})) ])) ]))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3669})) - (IApp. IVar >>= - $ (IApp. IVar [1] - $ IVar ^outmost-fuel^ - $ IVar m) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ IBindVar ^bnd^{arg:3666}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY2) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3666} - $ IVar ^bnd^{arg:3669})) ])) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY2 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3669})) + (IApp. IVar >>= + $ (IApp. IVar [1] + $ IVar ^outmost-fuel^ + $ IVar m) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ IBindVar ^bnd^{arg:3666}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY2) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3666} + $ IVar ^bnd^{arg:3669})) ])) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/004 right-to-left det/expected b/tests/derivation/least-effort/print/gadt/004 right-to-left det/expected index 9f75e66b8..9d69955f6 100644 --- a/tests/derivation/least-effort/print/gadt/004 right-to-left det/expected +++ b/tests/derivation/least-effort/print/gadt/004 right-to-left det/expected @@ -87,26 +87,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -126,29 +129,38 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_ADT[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -168,44 +180,47 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg n : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg n : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar m)))))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar m))))))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X_GADT[0] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_GADT[0] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}>) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>) + $ IVar Nil))))) IClaim MW Export [] @@ -242,13 +257,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IVar Prelude.Types.Z))))) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ IVar DerivedGen.MkXG_4)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_4 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ IVar DerivedGen.MkXG_4))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -262,19 +280,22 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IVar Prelude.Types.Z)))))) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.MkXG_5) - m - (IVar m))))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_5 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkXG_5) + m + (IVar m)))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -282,19 +303,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.X_GADT[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_GADT[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -330,40 +351,49 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_4 (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ IVar DerivedGen.MkXG_4))) ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ IVar DerivedGen.MkXG_4)))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkXG_5 (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (IVar DerivedGen.MkXG_5) - m - (IVar m)))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.MkXG_5) + m + (IVar m))))))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3651}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3651}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X_ADT[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3651}>))) IClaim MW Export [] @@ -382,34 +412,37 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg m : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar m))))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg m : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar m)))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.Y[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -429,74 +462,80 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3675})) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ IVar n) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3672}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY_LR) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3672} - $ IVar ^bnd^{arg:3675})) ])) ])) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY_LR (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3675})) + (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ IVar n) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3672}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY_LR) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3672} + $ IVar ^bnd^{arg:3675})) ])) ]))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar n - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar k - $ IBindVar ^bnd^{arg:3684})) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^outmost-fuel^ - $ IVar n) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar m - $ IBindVar ^bnd^{arg:3681}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY_RL) - k - (IVar k)) - m - (IVar m)) - n - (IVar n) - $ IVar ^bnd^{arg:3681} - $ IVar ^bnd^{arg:3684})) ])) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkY_RL (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar n + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar k + $ IBindVar ^bnd^{arg:3684})) + (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^outmost-fuel^ + $ IVar n) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar m + $ IBindVar ^bnd^{arg:3681}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (IVar DerivedGen.MkY_RL) + k + (IVar k)) + m + (IVar m)) + n + (IVar n) + $ IVar ^bnd^{arg:3681} + $ IVar ^bnd^{arg:3684})) ])) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/005 gadt/expected b/tests/derivation/least-effort/print/gadt/005 gadt/expected index 865c53632..6b18d750c 100644 --- a/tests/derivation/least-effort/print/gadt/005 gadt/expected +++ b/tests/derivation/least-effort/print/gadt/005 gadt/expected @@ -36,19 +36,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal Prelude.Basics.Bool[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.Bool[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -68,66 +68,72 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.False) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.False (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.False)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.True) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.True (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.True)) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[] (dry fuel))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[] (dry fuel)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar Data.Fuel.Dry) - $ IVar Nil))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry) + $ IVar Nil)))) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))))) ])) IClaim MW Export [] @@ -179,95 +185,107 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg b : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.JJ) - b - (IVar b) - $ IVar ^bnd^{arg:3636} - $ IVar ^bnd^{arg:3639}))))))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.JJ (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg b : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.JJ) + b + (IVar b) + $ IVar ^bnd^{arg:3636} + $ IVar ^bnd^{arg:3639})))))))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3648}) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.FN) - b - (IVar b) - $ IVar ^bnd^{arg:3645} - $ IVar ^bnd^{arg:3648}))))) ])) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.FN (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3648}) + (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.FN) + b + (IVar b) + $ IVar ^bnd^{arg:3645} + $ IVar ^bnd^{arg:3648}))))) ]))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.TL - $ IVar ^bnd^{arg:3654}))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TL (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.TL + $ IVar ^bnd^{arg:3654})))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3662}) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.TR) - b - (IVar b) - $ IVar ^bnd^{arg:3659} - $ IVar ^bnd^{arg:3662}))))) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TR (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3662}) + (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.TR) + b + (IVar b) + $ IVar ^bnd^{arg:3659} + $ IVar ^bnd^{arg:3662}))))) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/006 gadt/expected b/tests/derivation/least-effort/print/gadt/006 gadt/expected index 1b655ce7f..0fee1efb8 100644 --- a/tests/derivation/least-effort/print/gadt/006 gadt/expected +++ b/tests/derivation/least-effort/print/gadt/006 gadt/expected @@ -49,19 +49,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal Prelude.Basics.Bool[] (non-recursive))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar ^fuel_arg^) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.Bool[] (non-recursive)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar ^fuel_arg^) - $ IVar Nil)))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar ^fuel_arg^) + $ IVar Nil))))) IClaim MW Export [] @@ -81,66 +81,72 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.False) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.False (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.False)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Basics.True) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Basics.True (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Basics.True)) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[] (dry fuel))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[] (dry fuel)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar Data.Fuel.Dry) - $ IVar Nil))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry) + $ IVar Nil)))) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))))) ])) IClaim MW Export [] @@ -192,98 +198,110 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg b : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.JJ) - b - (IVar b) - $ IVar ^bnd^{arg:3636} - $ IVar ^bnd^{arg:3639}))))))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.JJ (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg b : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.JJ) + b + (IVar b) + $ IVar ^bnd^{arg:3636} + $ IVar ^bnd^{arg:3639})))))))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3648}) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.FN) - b - (IVar b) - $ IVar ^bnd^{arg:3645} - $ IVar ^bnd^{arg:3648}))))) ])) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.FN (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3648}) + (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.FN) + b + (IVar b) + $ IVar ^bnd^{arg:3645} + $ IVar ^bnd^{arg:3648}))))) ]))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. IVar DerivedGen.TL - $ IVar ^bnd^{arg:3654}))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TL (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. IVar DerivedGen.TL + $ IVar ^bnd^{arg:3654})))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3662}) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (IVar DerivedGen.TR) - b - (IVar b) - $ IVar ^bnd^{arg:3659} - $ IVar ^bnd^{arg:3662}))))) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TR (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3662}) + (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (IVar DerivedGen.TR) + b + (IVar b) + $ IVar ^bnd^{arg:3659} + $ IVar ^bnd^{arg:3662}))))) ]))) ] ] IDef [0] [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ @@ -291,54 +309,54 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. INamedApp (INamedApp (IVar Test.DepTyCheck.Gen.oneOf) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[0] (dry fuel))) - em - (IVar MaybeEmpty) - $ (IApp. IVar :: - $ (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^<{arg:3630}>) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[0] (dry fuel)) + $ (IApp. INamedApp (IVar Test.DepTyCheck.Gen.oneOf) + em + (IVar MaybeEmpty) $ (IApp. IVar :: - $ (IApp. IVar <> + $ (IApp. IVar <> $ IVar Data.Fuel.Dry $ IVar inter^<{arg:3630}>) - $ IVar Nil))) + $ (IApp. IVar :: + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^<{arg:3630}>) + $ IVar Nil)))) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.D[0] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.D[0] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}>)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ $ IVar inter^<{arg:3630}>)) $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}>)) - $ IVar Nil))))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^<{arg:3630}>)) + $ IVar Nil)))))) ])) IClaim MW Export [] @@ -383,49 +401,55 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar b) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) - => (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.JJ) - b - (IVar b) - $ IVar ^bnd^{arg:3636} - $ IVar ^bnd^{arg:3639})))))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.JJ (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3636} : Implicit False) + => (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3639} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.JJ) + b + (IVar b) + $ IVar ^bnd^{arg:3636} + $ IVar ^bnd^{arg:3639}))))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IVar Prelude.Basics.False) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3648}) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.FN) - b - (IVar b) - $ IVar ^bnd^{arg:3645} - $ IVar ^bnd^{arg:3648})))) ])) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.FN (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3648}) + (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3645} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.FN) + b + (IVar b) + $ IVar ^bnd^{arg:3645} + $ IVar ^bnd^{arg:3648})))) ]))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -434,16 +458,19 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IVar Prelude.Basics.True) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar DerivedGen.TL - $ IVar ^bnd^{arg:3654})))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TL (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar DerivedGen.TL + $ IVar ^bnd^{arg:3654}))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -452,28 +479,31 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IVar Prelude.Basics.True) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar b - $ IBindVar ^bnd^{arg:3662}) - (IApp. IVar >>= - $ (IApp. IVar external^<^prim^.String>[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.TR) - b - (IVar b) - $ IVar ^bnd^{arg:3659} - $ IVar ^bnd^{arg:3662})))) ])) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.TR (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar b + $ IBindVar ^bnd^{arg:3662}) + (IApp. IVar >>= + $ (IApp. IVar external^<^prim^.String>[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3659} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.TR) + b + (IVar b) + $ IVar ^bnd^{arg:3659} + $ IVar ^bnd^{arg:3662})))) ]))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) diff --git a/tests/derivation/least-effort/print/gadt/007 eq-n/expected b/tests/derivation/least-effort/print/gadt/007 eq-n/expected index dbe3f133e..117214d3c 100644 --- a/tests/derivation/least-effort/print/gadt/007 eq-n/expected +++ b/tests/derivation/least-effort/print/gadt/007 eq-n/expected @@ -35,26 +35,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal Prelude.Types.Nat[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Nat[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -74,29 +77,38 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ IVar Prelude.Types.Z) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.Z (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ IVar Prelude.Types.Z)) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Prelude.Types.S - $ IVar ^bnd^{arg:651})))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal Prelude.Types.S (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg ^bnd^{arg:651} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Prelude.Types.S + $ IVar ^bnd^{arg:651}))))) ] ] IDef [] [ PatClause (IApp. IVar [] $ IBindVar ^fuel_arg^) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.EqualN[] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^))) IClaim MW Export [] @@ -116,18 +128,21 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg x : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.ReflN (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg x : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (IVar DerivedGen.ReflN) - x - (IVar x)))))) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.ReflN) + x + (IVar x))))))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/008 eq-n/expected b/tests/derivation/least-effort/print/gadt/008 eq-n/expected index 997f5eede..759ddfff6 100644 --- a/tests/derivation/least-effort/print/gadt/008 eq-n/expected +++ b/tests/derivation/least-effort/print/gadt/008 eq-n/expected @@ -26,9 +26,12 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar [0] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.EqualN[0] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}>))) IClaim MW Export [] @@ -47,12 +50,15 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.ReflN) - x - (IVar x))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.ReflN (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.ReflN) + x + (IVar x)))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/009 eq-n/expected b/tests/derivation/least-effort/print/gadt/009 eq-n/expected index f7463fc7a..1096706b4 100644 --- a/tests/derivation/least-effort/print/gadt/009 eq-n/expected +++ b/tests/derivation/least-effort/print/gadt/009 eq-n/expected @@ -26,9 +26,12 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar [1] $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3633}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3633}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.EqualN[1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3633}>))) IClaim MW Export [] @@ -47,12 +50,15 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.ReflN) - x - (IVar x))) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.ReflN (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.ReflN) + x + (IVar x)))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/010 eq-n/expected b/tests/derivation/least-effort/print/gadt/010 eq-n/expected index 51338ffef..6295f4afc 100644 --- a/tests/derivation/least-effort/print/gadt/010 eq-n/expected +++ b/tests/derivation/least-effort/print/gadt/010 eq-n/expected @@ -27,10 +27,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3630}> $ IBindVar inter^<{arg:3633}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.EqualN[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}>))) IClaim MW Export [] @@ -60,13 +63,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar x $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.ReflN) - x - (IVar x)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.ReflN (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.ReflN) + x + (IVar x))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x diff --git a/tests/derivation/least-effort/print/gadt/011 eq deepcons/expected b/tests/derivation/least-effort/print/gadt/011 eq deepcons/expected index 5243ccc2d..91600eae4 100644 --- a/tests/derivation/least-effort/print/gadt/011 eq deepcons/expected +++ b/tests/derivation/least-effort/print/gadt/011 eq deepcons/expected @@ -30,26 +30,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.LT2[] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^)) - $ IVar Nil))) ])) + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^)) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -85,46 +88,52 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar external^[] - $ IVar ^outmost-fuel^) - $ (ILam. (MW ExplicitArg x : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Base (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar external^[] + $ IVar ^outmost-fuel^) + $ (ILam. (MW ExplicitArg x : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (IVar DerivedGen.Base) - x - (IVar x)))))) ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.Base) + x + (IVar x))))))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^) - (IApp. IVar >>= - $ (IApp. IVar [] - $ IVar ^cons_fuel^) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar x - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar y - $ IBindVar ^bnd^{arg:3641})) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Step (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [] + $ IVar ^cons_fuel^) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar x + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar y + $ IBindVar ^bnd^{arg:3641})) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) - y - (IVar y)) - x - (IVar x) - $ IVar ^bnd^{arg:3641})))) ])) ] ] + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) + y + (IVar y)) + x + (IVar x) + $ IVar ^bnd^{arg:3641})))) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/012 eq deepcons/expected b/tests/derivation/least-effort/print/gadt/012 eq deepcons/expected index 885522d5a..3d46ebca7 100644 --- a/tests/derivation/least-effort/print/gadt/012 eq deepcons/expected +++ b/tests/derivation/least-effort/print/gadt/012 eq deepcons/expected @@ -29,29 +29,32 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^<{arg:3630}>) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[0] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^<{arg:3630}>)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.LT2[0] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}>)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[0] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}>)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^<{arg:3630}>)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -84,38 +87,44 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.Base) - x - (IVar x))) ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Base (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.Base) + x + (IVar x)))) ] IDef <> [ PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x) - (IApp. IVar >>= - $ (IApp. IVar [0] - $ IVar ^cons_fuel^ - $ IVar x) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar y - $ IBindVar ^bnd^{arg:3641}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) - y - (IVar y)) - x - (IVar x) - $ IVar ^bnd^{arg:3641}))) ])) ] ] + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Step (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [0] + $ IVar ^cons_fuel^ + $ IVar x) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar y + $ IBindVar ^bnd^{arg:3641}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) + y + (IVar y)) + x + (IVar x) + $ IVar ^bnd^{arg:3641}))) ]))) ] ] diff --git a/tests/derivation/least-effort/print/gadt/013 eq deepcons/expected b/tests/derivation/least-effort/print/gadt/013 eq deepcons/expected index 0c09ee83b..e2dd40aec 100644 --- a/tests/derivation/least-effort/print/gadt/013 eq deepcons/expected +++ b/tests/derivation/least-effort/print/gadt/013 eq deepcons/expected @@ -29,29 +29,32 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^<{arg:3633}>) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[1] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^<{arg:3633}>)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.LT2[1] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3633}>)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[1] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^<{arg:3633}>)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^<{arg:3633}>)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -86,15 +89,18 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar Prelude.Types.S $ (IApp. IVar Prelude.Types.S $ IBindVar x))) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ INamedApp (IVar DerivedGen.Base) - x - (IVar x))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Base (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (IVar DerivedGen.Base) + x + (IVar x)))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) @@ -104,28 +110,31 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^cons_fuel^ $ (IApp. IVar Prelude.Types.S $ IBindVar y)) - (IApp. IVar >>= - $ (IApp. IVar [1] - $ IVar ^cons_fuel^ - $ IVar y) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar x - $ IBindVar ^bnd^{arg:3641}) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) - y - (IVar y)) - x - (IVar x) - $ IVar ^bnd^{arg:3641}))) ])) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Step (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [1] + $ IVar ^cons_fuel^ + $ IVar y) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar x + $ IBindVar ^bnd^{arg:3641}) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) + y + (IVar y)) + x + (IVar x) + $ IVar ^bnd^{arg:3641}))) ]))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True) diff --git a/tests/derivation/least-effort/print/gadt/014 eq deepcons/expected b/tests/derivation/least-effort/print/gadt/014 eq deepcons/expected index 3870475fc..5f69d1995 100644 --- a/tests/derivation/least-effort/print/gadt/014 eq deepcons/expected +++ b/tests/derivation/least-effort/print/gadt/014 eq deepcons/expected @@ -30,32 +30,35 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}>) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[0, 1] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}>)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.LT2[0, 1] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}>)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.LT2[0, 1] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^<{arg:3630}> $ IVar inter^<{arg:3633}>)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}>)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -101,13 +104,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar x)) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.Base) - x - (IVar x)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Base (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.Base) + x + (IVar x))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar x @@ -128,22 +134,25 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar x $ (IApp. IVar Prelude.Types.S $ IBindVar y)) - (IApp. IVar >>= - $ (IApp. IVar [0, 1] - $ IVar ^cons_fuel^ - $ IVar x - $ IVar y) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3641} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) - y - (IVar y)) - x - (IVar x) - $ IVar ^bnd^{arg:3641})))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Step (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [0, 1] + $ IVar ^cons_fuel^ + $ IVar x + $ IVar y) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3641} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (IVar DerivedGen.Step) + y + (IVar y)) + x + (IVar x) + $ IVar ^bnd^{arg:3641}))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True diff --git a/tests/derivation/least-effort/print/regression/dependent-givens-big/expected b/tests/derivation/least-effort/print/regression/dependent-givens-big/expected index 9deca683c..8e6f36ad4 100644 --- a/tests/derivation/least-effort/print/regression/dependent-givens-big/expected +++ b/tests/derivation/least-effort/print/regression/dependent-givens-big/expected @@ -40,32 +40,35 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^ - $ IVar inter^<{arg:4011}>) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.VectMaybeAnyType.AtIndex[0, 3] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^ + $ IVar inter^<{arg:4011}>)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.VectMaybeAnyType.AtIndex[0, 3] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^ - $ IVar inter^<{arg:4011}>)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.VectMaybeAnyType.AtIndex[0, 3] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^ $ IVar inter^<{arg:4011}>)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^ + $ IVar inter^<{arg:4011}>)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -122,21 +125,24 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (Implicit True) $ IBindVar x $ IBindVar xs)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.VectMaybeAnyType.Here (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ INamedApp (INamedApp (INamedApp (IVar DerivedGen.VectMaybeAnyType.Here) - n - (IVar n)) - xs - (IVar xs)) - x - (IVar x)))) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ INamedApp (INamedApp (INamedApp (IVar DerivedGen.VectMaybeAnyType.Here) + n + (IVar n)) + xs + (IVar xs)) + x + (IVar x))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True @@ -152,39 +158,42 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (Implicit True) $ IBindVar z $ IBindVar zs)) - (IApp. IVar >>= - $ (IApp. IVar [0, 3] - $ IVar ^cons_fuel^ - $ IVar n - $ IVar zs) - $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) - => ICase (IVar {lamc:0}) - (Implicit False) - [ PatClause (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar i - $ (IApp. IVar Builtin.DPair.MkDPair - $ IBindVar x - $ IBindVar ^bnd^{arg:4025})) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar Builtin.DPair.MkDPair - $ Implicit True + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.VectMaybeAnyType.There (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [0, 3] + $ IVar ^cons_fuel^ + $ IVar n + $ IVar zs) + $ (ILam. (MW ExplicitArg {lamc:0} : Implicit False) + => ICase (IVar {lamc:0}) + (Implicit False) + [ PatClause (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar i + $ (IApp. IVar Builtin.DPair.MkDPair + $ IBindVar x + $ IBindVar ^bnd^{arg:4025})) + (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) $ (IApp. IVar Builtin.DPair.MkDPair $ Implicit True - $ (IApp. INamedApp (INamedApp (INamedApp (INamedApp (INamedApp (IVar DerivedGen.VectMaybeAnyType.There) - z - (IVar z)) - n - (IVar n)) - zs - (IVar zs)) - x - (IVar x)) - i - (IVar i) - $ IVar ^bnd^{arg:4025})))) ])) + $ (IApp. IVar Builtin.DPair.MkDPair + $ Implicit True + $ (IApp. INamedApp (INamedApp (INamedApp (INamedApp (INamedApp (IVar DerivedGen.VectMaybeAnyType.There) + z + (IVar z)) + n + (IVar n)) + zs + (IVar zs)) + x + (IVar x)) + i + (IVar i) + $ IVar ^bnd^{arg:4025})))) ]))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True diff --git a/tests/derivation/least-effort/print/regression/dependent-givens-small-deep/expected b/tests/derivation/least-effort/print/regression/dependent-givens-small-deep/expected index 1f3d684ff..618d5bea1 100644 --- a/tests/derivation/least-effort/print/regression/dependent-givens-small-deep/expected +++ b/tests/derivation/least-effort/print/regression/dependent-givens-small-deep/expected @@ -28,10 +28,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^ $ IBindVar inter^<{arg:3632}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^ - $ IVar inter^<{arg:3632}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^ + $ IVar inter^<{arg:3632}>))) IClaim MW Export [] @@ -59,13 +62,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) k (Implicit True) $ IBindVar f))) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar f)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar f))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True diff --git a/tests/derivation/least-effort/print/regression/dependent-givens-small-shallow/expected b/tests/derivation/least-effort/print/regression/dependent-givens-small-shallow/expected index c192693b4..0418bcf77 100644 --- a/tests/derivation/least-effort/print/regression/dependent-givens-small-shallow/expected +++ b/tests/derivation/least-effort/print/regression/dependent-givens-small-shallow/expected @@ -28,10 +28,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^ $ IBindVar inter^<{arg:3632}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^ - $ IVar inter^<{arg:3632}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^ + $ IVar inter^<{arg:3632}>))) IClaim MW Export [] @@ -54,13 +57,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) k (Implicit True) $ IBindVar f)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. IVar DerivedGen.MkX - $ IVar n - $ IVar f)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. IVar DerivedGen.MkX + $ IVar n + $ IVar f))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True diff --git a/tests/derivation/least-effort/print/regression/lost-deceq-four-occurences/expected b/tests/derivation/least-effort/print/regression/lost-deceq-four-occurences/expected index 8bee822d1..8f386757f 100644 --- a/tests/derivation/least-effort/print/regression/lost-deceq-four-occurences/expected +++ b/tests/derivation/least-effort/print/regression/lost-deceq-four-occurences/expected @@ -37,12 +37,15 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar inter^<{arg:3633}> $ IBindVar inter^<{arg:3636}> $ IBindVar inter^<{arg:3639}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}> - $ IVar inter^<{arg:3636}> - $ IVar inter^<{arg:3639}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1, 2, 3] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}> + $ IVar inter^<{arg:3636}> + $ IVar inter^<{arg:3639}>))) IClaim MW Export [] @@ -114,13 +117,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n diff --git a/tests/derivation/least-effort/print/regression/lost-deceq-three-occurences/expected b/tests/derivation/least-effort/print/regression/lost-deceq-three-occurences/expected index b0c158629..95d41c236 100644 --- a/tests/derivation/least-effort/print/regression/lost-deceq-three-occurences/expected +++ b/tests/derivation/least-effort/print/regression/lost-deceq-three-occurences/expected @@ -32,11 +32,14 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar inter^<{arg:3630}> $ IBindVar inter^<{arg:3633}> $ IBindVar inter^<{arg:3636}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3630}> - $ IVar inter^<{arg:3633}> - $ IVar inter^<{arg:3636}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.X[0, 1, 2] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3630}> + $ IVar inter^<{arg:3633}> + $ IVar inter^<{arg:3636}>))) IClaim MW Export [] @@ -85,13 +88,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.MkX) - n - (IVar n)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkX (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.MkX) + n + (IVar n))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ IBindVar n diff --git a/tests/derivation/least-effort/print/regression/too-early-rename-multiple-complex/expected b/tests/derivation/least-effort/print/regression/too-early-rename-multiple-complex/expected index 550038281..1cec5dd33 100644 --- a/tests/derivation/least-effort/print/regression/too-early-rename-multiple-complex/expected +++ b/tests/derivation/least-effort/print/regression/too-early-rename-multiple-complex/expected @@ -27,10 +27,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3665}> $ IBindVar inter^<{arg:3668}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3665}> - $ IVar inter^<{arg:3668}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.W[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3665}> + $ IVar inter^<{arg:3668}>))) IClaim MW Export [] @@ -158,15 +161,18 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (INamedApp (IVar DerivedGen.MkW) - m - (IVar m)) - n - (IVar n)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkW (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (INamedApp (IVar DerivedGen.MkW) + m + (IVar m)) + n + (IVar n))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ INamedApp (IApp. IVar DerivedGen.MkZ diff --git a/tests/derivation/least-effort/print/regression/too-early-rename-multiple-simple/expected b/tests/derivation/least-effort/print/regression/too-early-rename-multiple-simple/expected index 84e4dd639..f3914b7fe 100644 --- a/tests/derivation/least-effort/print/regression/too-early-rename-multiple-simple/expected +++ b/tests/derivation/least-effort/print/regression/too-early-rename-multiple-simple/expected @@ -27,10 +27,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3662}> $ IBindVar inter^<{arg:3665}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3662}> - $ IVar inter^<{arg:3665}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.W[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3662}> + $ IVar inter^<{arg:3665}>))) IClaim MW Export [] @@ -146,15 +149,18 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (INamedApp (IVar DerivedGen.MkW) - m - (IVar m)) - n - (IVar n)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkW (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (INamedApp (IVar DerivedGen.MkW) + m + (IVar m)) + n + (IVar n))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ INamedApp (IApp. IVar DerivedGen.MkZ diff --git a/tests/derivation/least-effort/print/regression/too-early-rename-single-dependency/expected b/tests/derivation/least-effort/print/regression/too-early-rename-single-dependency/expected index d6256a72b..406e5cb39 100644 --- a/tests/derivation/least-effort/print/regression/too-early-rename-single-dependency/expected +++ b/tests/derivation/least-effort/print/regression/too-early-rename-single-dependency/expected @@ -27,10 +27,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3658}> $ IBindVar inter^<{arg:3661}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3658}> - $ IVar inter^<{arg:3661}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.W[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3658}> + $ IVar inter^<{arg:3661}>))) IClaim MW Export [] @@ -96,13 +99,16 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (Implicit True)) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (IVar DerivedGen.MkW) - n - (IVar n)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkW (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (IVar DerivedGen.MkW) + n + (IVar n))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ INamedApp (IApp. IVar DerivedGen.MkZ diff --git a/tests/derivation/least-effort/print/regression/unification-mismatch-dependent/expected b/tests/derivation/least-effort/print/regression/unification-mismatch-dependent/expected index e2aff1074..a211634b5 100644 --- a/tests/derivation/least-effort/print/regression/unification-mismatch-dependent/expected +++ b/tests/derivation/least-effort/print/regression/unification-mismatch-dependent/expected @@ -27,10 +27,13 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IBindVar ^fuel_arg^ $ IBindVar inter^<{arg:3650}> $ IBindVar inter^<{arg:3653}>) - (ILocal (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^<{arg:3650}> - $ IVar inter^<{arg:3653}>)) + (ILocal (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Z[0, 1] (non-recursive)) + $ (IApp. IVar <> + $ IVar ^fuel_arg^ + $ IVar inter^<{arg:3650}> + $ IVar inter^<{arg:3653}>))) IClaim MW Export [] @@ -86,14 +89,17 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (IVar DerivedGen.MkZ) - x - (IVar x) - $ IVar prf)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.MkZ (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (IVar DerivedGen.MkZ) + x + (IVar x) + $ IVar prf))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ (IApp. IVar DerivedGen.Cons diff --git a/tests/derivation/least-effort/print/regression/unification-name-mismatch/expected b/tests/derivation/least-effort/print/regression/unification-name-mismatch/expected index ea443555d..39c6f7e1d 100644 --- a/tests/derivation/least-effort/print/regression/unification-name-mismatch/expected +++ b/tests/derivation/least-effort/print/regression/unification-name-mismatch/expected @@ -30,32 +30,35 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) (ILocal (ICase (IVar ^fuel_arg^) (IVar Data.Fuel.Fuel) [ PatClause (IVar Data.Fuel.Dry) - (IApp. IVar <> - $ IVar Data.Fuel.Dry - $ IVar inter^ - $ IVar inter^) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[0, 1] (dry fuel)) + $ (IApp. IVar <> + $ IVar Data.Fuel.Dry + $ IVar inter^ + $ IVar inter^)) , PatClause (IApp. IVar Data.Fuel.More $ IBindVar ^sub^fuel_arg^) - (IApp. INamedApp (IVar Test.DepTyCheck.Gen.frequency) - description - (IApp. IVar Just - $ IPrimVal DerivedGen.Y[0, 1] (spend fuel)) - $ (IApp. IVar :: - $ (IApp. IVar Builtin.MkPair - $ IVar Data.Nat.Pos.one - $ (IApp. IVar <> - $ IVar ^fuel_arg^ - $ IVar inter^ - $ IVar inter^)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.Y[0, 1] (spend fuel)) + $ (IApp. IVar Test.DepTyCheck.Gen.frequency $ (IApp. IVar :: $ (IApp. IVar Builtin.MkPair - $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth - $ IVar ^sub^fuel_arg^) - $ (IApp. IVar <> - $ IVar ^sub^fuel_arg^ + $ IVar Data.Nat.Pos.one + $ (IApp. IVar <> + $ IVar ^fuel_arg^ $ IVar inter^ $ IVar inter^)) - $ IVar Nil))) ])) + $ (IApp. IVar :: + $ (IApp. IVar Builtin.MkPair + $ (IApp. IVar Deriving.DepTyCheck.Util.Reflection.leftDepth + $ IVar ^sub^fuel_arg^) + $ (IApp. IVar <> + $ IVar ^sub^fuel_arg^ + $ IVar inter^ + $ IVar inter^)) + $ IVar Nil)))) ])) IClaim MW Export [] @@ -123,15 +126,18 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ IVar Builtin.Refl) $ (IApp. IVar Prelude.Yes $ IVar Builtin.Refl)) - (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ INamedApp (INamedApp (IVar DerivedGen.A) - xs - (IVar xs)) - x - (IVar x)) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.A (orders)) + $ (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ INamedApp (INamedApp (IVar DerivedGen.A) + xs + (IVar xs)) + x + (IVar x))) , PatClause (IApp. IVar <> $ IBindVar ^cons_fuel^ $ (IApp. IVar DerivedGen.(::) @@ -170,26 +176,29 @@ ILam. (MW ExplicitArg ^outmost-fuel^ : IVar Data.Fuel.Fuel) $ (IApp. IVar DerivedGen.(::) $ IBindVar y $ IBindVar ys)) - (IApp. IVar >>= - $ (IApp. IVar [0, 1] - $ IVar ^cons_fuel^ - $ IVar xs - $ IVar ys) - $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) - => (IApp. INamedApp (IVar Prelude.pure) - f - (IApp. IVar Test.DepTyCheck.Gen.Gen - $ Implicit True) - $ (IApp. INamedApp (INamedApp (INamedApp (INamedApp (IVar DerivedGen.B) - x - (IVar x)) - y - (IVar y)) - ys - (IVar ys)) - xs - (IVar xs) - $ IVar ^bnd^{arg:3654})))) + (IApp. IVar Test.DepTyCheck.Gen.label + $ (IApp. IVar fromString + $ IPrimVal DerivedGen.B (orders)) + $ (IApp. IVar >>= + $ (IApp. IVar [0, 1] + $ IVar ^cons_fuel^ + $ IVar xs + $ IVar ys) + $ (ILam. (MW ExplicitArg ^bnd^{arg:3654} : Implicit False) + => (IApp. INamedApp (IVar Prelude.pure) + f + (IApp. IVar Test.DepTyCheck.Gen.Gen + $ Implicit True) + $ (IApp. INamedApp (INamedApp (INamedApp (INamedApp (IVar DerivedGen.B) + x + (IVar x)) + y + (IVar y)) + ys + (IVar ys)) + xs + (IVar xs) + $ IVar ^bnd^{arg:3654}))))) , PatClause (IApp. IVar <> $ Implicit True $ Implicit True diff --git a/tests/derivation/utils/involved-types/_common-involved-types/Infra.idr b/tests/derivation/utils/involved-types/_common-involved-types/Infra.idr new file mode 100644 index 000000000..69fa95434 --- /dev/null +++ b/tests/derivation/utils/involved-types/_common-involved-types/Infra.idr @@ -0,0 +1,23 @@ +module Infra + +import public TypesAndInvolved + +import Data.Vect.Extra + +import Deriving.DepTyCheck.Gen.Core.Util + +%language ElabReflection + +printInvolvedTypesVerdict : Name -> List Name -> Elab Unit +printInvolvedTypesVerdict tyName expected = do + logMsg "gen.auto.involved-types" 0 "given type: \{show tyName}" + invTys <- allInvolvedTypes !(getInfo' tyName) + let invTys = sortBy (comparing show) $ invTys <&> name + expected <- for expected $ map name . getInfo' + let expected = sortBy (comparing show) expected + when (invTys /= expected) $ do + logMsg "gen.auto.involved-types" 0 "-------- !!! --------" + logMsg "gen.auto.involved-types" 0 "found : \{show invTys}" + logMsg "gen.auto.involved-types" 0 "expected: \{show expected}" + +%runElab for_ typesAndInvolved $ uncurry printInvolvedTypesVerdict diff --git a/tests/derivation/utils/involved-types/_common-involved-types/inv-ty.ipkg b/tests/derivation/utils/involved-types/_common-involved-types/inv-ty.ipkg new file mode 100644 index 000000000..7a2efe1b1 --- /dev/null +++ b/tests/derivation/utils/involved-types/_common-involved-types/inv-ty.ipkg @@ -0,0 +1,7 @@ +package inv-tys + +authors = "Denis Buzdalov" + +opts = "--no-color --console-width 0" + +depends = deptycheck, contrib, elab-util diff --git a/tests/derivation/utils/involved-types/_common-involved-types/run b/tests/derivation/utils/involved-types/_common-involved-types/run new file mode 100755 index 000000000..52af719da --- /dev/null +++ b/tests/derivation/utils/involved-types/_common-involved-types/run @@ -0,0 +1,6 @@ +rm -rf build + +flock "$1" pack -q install-deps inv-ty.ipkg && \ +idris2 --check --no-color --console-width 0 --no-banner --find-ipkg Infra.idr + +rm -rf build diff --git a/tests/derivation/utils/involved-types/norec-001/Infra.idr b/tests/derivation/utils/involved-types/norec-001/Infra.idr new file mode 120000 index 000000000..6ffcc8323 --- /dev/null +++ b/tests/derivation/utils/involved-types/norec-001/Infra.idr @@ -0,0 +1 @@ +../_common-involved-types/Infra.idr \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/norec-001/TypesAndInvolved.idr b/tests/derivation/utils/involved-types/norec-001/TypesAndInvolved.idr new file mode 100644 index 000000000..ae8cdd9c1 --- /dev/null +++ b/tests/derivation/utils/involved-types/norec-001/TypesAndInvolved.idr @@ -0,0 +1,19 @@ +module TypesAndInvolved + +import Language.Reflection +import Language.Reflection.Syntax + +%default total + +export +data X : Type -> Type -> Type where + XX : Either a b -> X a b + +public export +typesAndInvolved : List (Name, List Name) +typesAndInvolved = + [ ("Bool", ["Prelude.Basics.Bool"]) + , ("Bool", ["Bool"]) + , ("X", ["Prelude.Types.Either", "TypesAndInvolved.X"]) + , ("X", ["X", "Either"]) + ] diff --git a/tests/derivation/utils/involved-types/norec-001/expected b/tests/derivation/utils/involved-types/norec-001/expected new file mode 100644 index 000000000..9651a73ce --- /dev/null +++ b/tests/derivation/utils/involved-types/norec-001/expected @@ -0,0 +1,6 @@ +1/2: Building TypesAndInvolved (TypesAndInvolved.idr) +2/2: Building Infra (Infra.idr) +LOG gen.auto.involved-types:0: given type: Bool +LOG gen.auto.involved-types:0: given type: Bool +LOG gen.auto.involved-types:0: given type: X +LOG gen.auto.involved-types:0: given type: X diff --git a/tests/derivation/utils/involved-types/norec-001/inv-ty.ipkg b/tests/derivation/utils/involved-types/norec-001/inv-ty.ipkg new file mode 120000 index 000000000..1fd430b01 --- /dev/null +++ b/tests/derivation/utils/involved-types/norec-001/inv-ty.ipkg @@ -0,0 +1 @@ +../_common-involved-types/inv-ty.ipkg \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/norec-001/run b/tests/derivation/utils/involved-types/norec-001/run new file mode 120000 index 000000000..d61c21c60 --- /dev/null +++ b/tests/derivation/utils/involved-types/norec-001/run @@ -0,0 +1 @@ +../_common-involved-types/run \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-001/Infra.idr b/tests/derivation/utils/involved-types/rec-001/Infra.idr new file mode 120000 index 000000000..6ffcc8323 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-001/Infra.idr @@ -0,0 +1 @@ +../_common-involved-types/Infra.idr \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-001/TypesAndInvolved.idr b/tests/derivation/utils/involved-types/rec-001/TypesAndInvolved.idr new file mode 100644 index 000000000..70156a6e4 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-001/TypesAndInvolved.idr @@ -0,0 +1,14 @@ +module TypesAndInvolved + +import Language.Reflection +import Language.Reflection.Syntax + +%default total + +public export +typesAndInvolved : List (Name, List Name) +typesAndInvolved = + [ ("Nat", ["Nat"]) + , ("List", ["List"]) + , ("Vect", ["Vect", "Nat"]) + ] diff --git a/tests/derivation/utils/involved-types/rec-001/expected b/tests/derivation/utils/involved-types/rec-001/expected new file mode 100644 index 000000000..40bf33757 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-001/expected @@ -0,0 +1,5 @@ +1/2: Building TypesAndInvolved (TypesAndInvolved.idr) +2/2: Building Infra (Infra.idr) +LOG gen.auto.involved-types:0: given type: Nat +LOG gen.auto.involved-types:0: given type: List +LOG gen.auto.involved-types:0: given type: Vect diff --git a/tests/derivation/utils/involved-types/rec-001/inv-ty.ipkg b/tests/derivation/utils/involved-types/rec-001/inv-ty.ipkg new file mode 120000 index 000000000..1fd430b01 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-001/inv-ty.ipkg @@ -0,0 +1 @@ +../_common-involved-types/inv-ty.ipkg \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-001/run b/tests/derivation/utils/involved-types/rec-001/run new file mode 120000 index 000000000..d61c21c60 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-001/run @@ -0,0 +1 @@ +../_common-involved-types/run \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-002/Infra.idr b/tests/derivation/utils/involved-types/rec-002/Infra.idr new file mode 120000 index 000000000..6ffcc8323 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-002/Infra.idr @@ -0,0 +1 @@ +../_common-involved-types/Infra.idr \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-002/TypesAndInvolved.idr b/tests/derivation/utils/involved-types/rec-002/TypesAndInvolved.idr new file mode 100644 index 000000000..5f1f2811d --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-002/TypesAndInvolved.idr @@ -0,0 +1,51 @@ +module TypesAndInvolved + +import public Data.List.Alternating + +import Language.Reflection +import Language.Reflection.Syntax + +%default total + +public export +typesAndInvolved : List (Name, List Name) +typesAndInvolved = + [ ("Odd", ["Odd", "Even"]) + , ("TTImp", + [ "AltType" + , "BindMode" + , "BuiltinType" + , "Clause" + , "Constant" + , "Count" + , "Data" + , "DataOpt" + , "Decl" + , "DotReason" + , "FC" + , "FnOpt" + , "IField" + , "IFieldUpdate" + , "ITy" + , "LazyReason" + , "ModuleIdent" + , "Name" + , "Namespace" + , "OriginDesc" + , "PiInfo" + , "PrimType" + , "Record" + , "TTImp" + , "TotalReq" + , "UseSide" + , "UserName" + , "VirtualIdent" + , "Visibility" + , "WithFlag" + , "Bool" + , "List" + , "Maybe" + , "Nat" + , "Pair" + ]) + ] diff --git a/tests/derivation/utils/involved-types/rec-002/expected b/tests/derivation/utils/involved-types/rec-002/expected new file mode 100644 index 000000000..f3b66dbc8 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-002/expected @@ -0,0 +1,4 @@ +1/2: Building TypesAndInvolved (TypesAndInvolved.idr) +2/2: Building Infra (Infra.idr) +LOG gen.auto.involved-types:0: given type: Odd +LOG gen.auto.involved-types:0: given type: TTImp diff --git a/tests/derivation/utils/involved-types/rec-002/inv-ty.ipkg b/tests/derivation/utils/involved-types/rec-002/inv-ty.ipkg new file mode 120000 index 000000000..1fd430b01 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-002/inv-ty.ipkg @@ -0,0 +1 @@ +../_common-involved-types/inv-ty.ipkg \ No newline at end of file diff --git a/tests/derivation/utils/involved-types/rec-002/run b/tests/derivation/utils/involved-types/rec-002/run new file mode 120000 index 000000000..d61c21c60 --- /dev/null +++ b/tests/derivation/utils/involved-types/rec-002/run @@ -0,0 +1 @@ +../_common-involved-types/run \ No newline at end of file diff --git a/tests/lib/coverage/ty-and-con-derived-001/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-derived-001/PrintCoverage.idr new file mode 100644 index 000000000..8834fedf2 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-001/PrintCoverage.idr @@ -0,0 +1,35 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export %hint +smallStrs : Fuel -> Gen MaybeEmpty String +smallStrs _ = elements ["", "a", "bc"] + +export %hint +UsedConstructorDerivator : ConstructorDerivator +UsedConstructorDerivator = LeastEffort + +data X = X1 | X2 Nat | X3 String + +data Y = Y1 | Y2 X | Y3 X X + +genY : Fuel -> (Fuel -> Gen MaybeEmpty String) => Gen MaybeEmpty Y +genY = deriveGen + +main : IO () +main = do + let ci = initCoverageInfo genY + let vs = unGenTryND 100 someStdGen $ genY $ limit 10 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-derived-001/expected b/tests/lib/coverage/ty-and-con-derived-001/expected new file mode 100644 index 000000000..188148d74 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-001/expected @@ -0,0 +1,15 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat covered fully + - S: covered + - Z: covered + +PrintCoverage.X covered fully + - X1: covered + - X2: covered + - X3: covered + +PrintCoverage.Y covered fully + - Y1: covered + - Y2: covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-derived-001/run b/tests/lib/coverage/ty-and-con-derived-001/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-001/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-derived-001/test.ipkg b/tests/lib/coverage/ty-and-con-derived-001/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-001/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-derived-002/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-derived-002/PrintCoverage.idr new file mode 100644 index 000000000..4f5807e08 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-002/PrintCoverage.idr @@ -0,0 +1,38 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export %hint +smallStrs : Fuel -> Gen MaybeEmpty String +smallStrs _ = elements ["", "a", "bc"] + +export %hint +UsedConstructorDerivator : ConstructorDerivator +UsedConstructorDerivator = LeastEffort + +data X = X1 | X2 Nat | X3 String + +data Y : Nat -> Type where + Y1 : Y 0 + Y2 : X -> Y 1 + Y3 : X -> X -> Y 2 + +genY : Fuel -> (Fuel -> Gen MaybeEmpty String) => Gen MaybeEmpty (n ** Y n) +genY = deriveGen + +main : IO () +main = do + let ci = initCoverageInfo genY + let vs = unGenTryND 100 someStdGen $ genY $ limit 10 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-derived-002/expected b/tests/lib/coverage/ty-and-con-derived-002/expected new file mode 100644 index 000000000..188148d74 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-002/expected @@ -0,0 +1,15 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat covered fully + - S: covered + - Z: covered + +PrintCoverage.X covered fully + - X1: covered + - X2: covered + - X3: covered + +PrintCoverage.Y covered fully + - Y1: covered + - Y2: covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-derived-002/run b/tests/lib/coverage/ty-and-con-derived-002/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-002/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-derived-002/test.ipkg b/tests/lib/coverage/ty-and-con-derived-002/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-derived-002/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-001/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-001/PrintCoverage.idr new file mode 100644 index 000000000..2c6bf7749 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-001/PrintCoverage.idr @@ -0,0 +1,40 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y = Y1 | Y2 X | Y3 X X + +genY : Fuel -> Gen NonEmpty Y +genY fl = withCoverage $ oneOf + [ [| Y1 |] + , [| Y3 (genX fl) (genX fl) |] + ] + +main : IO () +main = do + let ci = initCoverageInfo genY + let vs = unGenTryND 100 someStdGen $ genY $ limit 10 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-001/expected b/tests/lib/coverage/ty-and-con-withCov-001/expected new file mode 100644 index 000000000..1af4947a3 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-001/expected @@ -0,0 +1,15 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X not covered + - X1: not covered + - X2: not covered + - X3: not covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-001/run b/tests/lib/coverage/ty-and-con-withCov-001/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-001/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-001/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-001/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-001/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-002/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-002/PrintCoverage.idr new file mode 100644 index 000000000..34988c716 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-002/PrintCoverage.idr @@ -0,0 +1,40 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = withCoverage $ oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y = Y1 | Y2 X | Y3 X X + +genY : Fuel -> Gen NonEmpty Y +genY fl = withCoverage $ oneOf + [ [| Y1 |] + , [| Y3 (genX fl) (genX fl) |] + ] + +main : IO () +main = do + let ci = initCoverageInfo genY + let vs = unGenTryND 100 someStdGen $ genY $ limit 10 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-002/expected b/tests/lib/coverage/ty-and-con-withCov-002/expected new file mode 100644 index 000000000..a8a07eb62 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-002/expected @@ -0,0 +1,15 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-002/run b/tests/lib/coverage/ty-and-con-withCov-002/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-002/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-002/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-002/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-002/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-003/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-003/PrintCoverage.idr new file mode 100644 index 000000000..f1b488b7a --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-003/PrintCoverage.idr @@ -0,0 +1,43 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = withCoverage $ oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y : Nat -> Type where + Y1 : Y 0 + Y2 : X -> Y 1 + Y3 : X -> X -> Y 2 + +genY : Fuel -> Gen NonEmpty (n ** Y n) +genY fl = withCoverage $ oneOf + [ pure (_ ** Y1) + , [| (\x1, x2 => (_ ** Y3 x1 x2)) (genX fl) (genX fl) |] + ] + +main : IO () +main = do + let ci = initCoverageInfo genY + let vs = unGenTryND 100 someStdGen $ genY $ limit 10 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-003/expected b/tests/lib/coverage/ty-and-con-withCov-003/expected new file mode 100644 index 000000000..a8a07eb62 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-003/expected @@ -0,0 +1,15 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-003/run b/tests/lib/coverage/ty-and-con-withCov-003/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-003/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-003/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-003/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-003/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr new file mode 100644 index 000000000..cc92289ae --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr @@ -0,0 +1,53 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = withCoverage $ oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y : Nat -> Type where + Y1 : Y 0 + Y2 : X -> Y 1 + Y3 : X -> X -> Y n + +genY' : Fuel -> (n : _) -> Gen NonEmpty $ Y n +genY' fl Z = oneOf + [ [| Y1 |] + , [| Y3 (genX fl) (genX fl) |] + ] +genY' fl 1 = [| Y2 (genX fl) |] +genY' fl n = [| Y3 (genX fl) (genX fl) |] + +genY : Fuel -> (n : _) -> Gen NonEmpty $ Y n +genY fl n = withCoverage $ genY' fl n + +main : IO () +main = do + let ci = initCoverageInfo genY + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 0 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-004/expected b/tests/lib/coverage/ty-and-con-withCov-004/expected new file mode 100644 index 000000000..e7ba804c1 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-004/expected @@ -0,0 +1,31 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered + +-------- + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: not covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-004/run b/tests/lib/coverage/ty-and-con-withCov-004/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-004/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-004/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-004/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-004/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr new file mode 100644 index 000000000..a9f02ab39 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr @@ -0,0 +1,50 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = withCoverage $ oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y : Nat -> Type where + Y1 : Y 0 + Y2 : X -> Y 1 + Y3 : X -> X -> Y n + +genY : Fuel -> (n : _) -> Gen NonEmpty $ Y n +genY fl Z = withCoverage $ oneOf + [ [| Y1 |] + , [| Y3 (genX fl) (genX fl) |] + ] +genY fl 1 = withCoverage [| Y2 (genX fl) |] +genY fl n = withCoverage [| Y3 (genX fl) (genX fl) |] + +main : IO () +main = do + let ci = initCoverageInfo genY + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 0 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-005/expected b/tests/lib/coverage/ty-and-con-withCov-005/expected new file mode 100644 index 000000000..e7ba804c1 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-005/expected @@ -0,0 +1,31 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered + +-------- + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: not covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-005/run b/tests/lib/coverage/ty-and-con-withCov-005/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-005/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-005/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-005/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-005/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr new file mode 100644 index 000000000..43c10da5e --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr @@ -0,0 +1,50 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +export +smallStrs : Fuel -> Gen NonEmpty String +smallStrs _ = elements ["", "a", "bc"] + +data X = X1 | X2 Nat | X3 String + +genX : Fuel -> Gen NonEmpty X +genX fl = withCoverage $ oneOf + [ pure X1 + , X3 <$> smallStrs fl + ] + +data Y : Nat -> Type where + Y1 : Y 0 + Y2 : X -> Y 1 + Y3 : X -> X -> Y n + +genY : Fuel -> (n : _) -> Gen NonEmpty $ Y n +genY fl Z = withCoverage $ oneOf + [ [| Y1 |] + , [| Y3 (genX fl) (genX fl) |] + ] +genY fl 1 = withCoverage [| Y2 (genX fl) |] +genY fl n = withCoverage [| Y3 (genX fl) (genX fl) |] + +main : IO () +main = do + let ci = initCoverageInfo genY + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 0 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show @{Colourful} ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show @{Colourful} ci diff --git a/tests/lib/coverage/ty-and-con-withCov-006/expected b/tests/lib/coverage/ty-and-con-withCov-006/expected new file mode 100644 index 000000000..82adbc9b9 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-006/expected @@ -0,0 +1,31 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: covered + - Y2: not covered + - Y3: covered + +-------- + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered + - X3: covered + +PrintCoverage.Y covered partially + - Y1: not covered + - Y2: not covered + - Y3: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-006/run b/tests/lib/coverage/ty-and-con-withCov-006/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-006/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-006/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-006/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-006/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr new file mode 100644 index 000000000..af512ef31 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr @@ -0,0 +1,40 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +%hide Language.Reflection.Syntax.var + +data X : (post : List ()) -> Type where + XZ : X post + XS : X post -> X (var::post) + +data Y : Type where + MkY : (all : List ()) -> X all -> Y + +genY : Nat -> Gen MaybeEmpty Y +genY 0 = pure $ MkY [] XZ +genY (S k) = do + MkY a b <- genY k + withCoverage (pure $ XS b) <&> MkY (()::a) + +main : IO () +main = do + let ci = initCoverageInfo genY + do let vs = unGenTryND 100 someStdGen $ genY 0 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genY 3 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-007/expected b/tests/lib/coverage/ty-and-con-withCov-007/expected new file mode 100644 index 000000000..da958db9f --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-007/expected @@ -0,0 +1,31 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Builtin.Unit not covered + - MkUnit: not covered + +Prelude.Basics.List not covered + - (::): not covered + - Nil: not covered + +PrintCoverage.X not covered + - XS: not covered + - XZ: not covered + +PrintCoverage.Y not covered + - MkY: not covered + +-------- + +Builtin.Unit not covered + - MkUnit: not covered + +Prelude.Basics.List not covered + - (::): not covered + - Nil: not covered + +PrintCoverage.X covered partially + - XS: covered + - XZ: not covered + +PrintCoverage.Y not covered + - MkY: not covered diff --git a/tests/lib/coverage/ty-and-con-withCov-007/run b/tests/lib/coverage/ty-and-con-withCov-007/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-007/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-007/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-007/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-007/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-008/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-008/PrintCoverage.idr new file mode 100644 index 000000000..ad1f4d06f --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-008/PrintCoverage.idr @@ -0,0 +1,28 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +data X : Bool -> Type where + X1 : X False + X2 : (a : Maybe ()) -> X (isJust a) + +genX : Gen MaybeEmpty (X False) +genX = do + withCoverage (pure $ X1) + +main : IO () +main = do + let ci = initCoverageInfo genX + let vs = unGenTryND 100 someStdGen genX + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-008/expected b/tests/lib/coverage/ty-and-con-withCov-008/expected new file mode 100644 index 000000000..05f5ed8da --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-008/expected @@ -0,0 +1,16 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Builtin.Unit not covered + - MkUnit: not covered + +Prelude.Basics.Bool not covered + - False: not covered + - True: not covered + +Prelude.Types.Maybe not covered + - Just: not covered + - Nothing: not covered + +PrintCoverage.X covered partially + - X1: covered + - X2: not covered diff --git a/tests/lib/coverage/ty-and-con-withCov-008/run b/tests/lib/coverage/ty-and-con-withCov-008/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-008/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-008/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-008/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-008/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr new file mode 100644 index 000000000..0c499c5e6 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr @@ -0,0 +1,42 @@ +module PrintCoverage + +import Test.DepTyCheck.Gen +import Test.DepTyCheck.Gen.Coverage + +import Deriving.DepTyCheck.Gen + +import System.Random.Pure.StdGen + +%default total + +%language ElabReflection + +data X : (n : Nat) -> Fin n -> Type where + X1 : X 1 FZ + X2 : (n : Nat) -> IsSucc n => X n (case n of S _ => FZ) + +genX' : (n : Nat) -> Gen MaybeEmpty (f ** X n f) +genX' 0 = empty +genX' 1 = oneOf [ pure (_ ** X1), pure (FZ ** X2 1) ] +genX' n@(S _) = pure (FZ ** X2 n) + +genX : (n : Nat) -> Gen MaybeEmpty (f ** X n f) +genX n = withCoverage $ genX' n + +main : IO () +main = do + let ci = initCoverageInfo genX + do let vs = unGenTryND 100 someStdGen $ genX 0 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genX 1 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci + putStrLn "\n--------\n" + do let vs = unGenTryND 100 someStdGen $ genX 2 + let mc = concatMap fst vs + let ci = registerCoverage mc ci + putStrLn $ show ci diff --git a/tests/lib/coverage/ty-and-con-withCov-009/expected b/tests/lib/coverage/ty-and-con-withCov-009/expected new file mode 100644 index 000000000..b47f9cc97 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-009/expected @@ -0,0 +1,50 @@ +1/1: Building PrintCoverage (PrintCoverage.idr) + +Data.Fin.Fin not covered + - FS: not covered + - FZ: not covered + +Data.Nat.IsSucc not covered + - ItIsSucc: not covered + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X not covered + - X1: not covered + - X2: not covered + +-------- + +Data.Fin.Fin not covered + - FS: not covered + - FZ: not covered + +Data.Nat.IsSucc not covered + - ItIsSucc: not covered + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered fully + - X1: covered + - X2: covered + +-------- + +Data.Fin.Fin not covered + - FS: not covered + - FZ: not covered + +Data.Nat.IsSucc not covered + - ItIsSucc: not covered + +Prelude.Types.Nat not covered + - S: not covered + - Z: not covered + +PrintCoverage.X covered partially + - X1: not covered + - X2: covered diff --git a/tests/lib/coverage/ty-and-con-withCov-009/run b/tests/lib/coverage/ty-and-con-withCov-009/run new file mode 100755 index 000000000..9706b3375 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-009/run @@ -0,0 +1,8 @@ +rm -rf build + +flock "$1" pack -q install-deps test.ipkg && \ +idris2 --no-color --console-width 0 --no-banner --find-ipkg --check PrintCoverage.idr && \ +echo && \ +pack exec PrintCoverage.idr + +rm -rf build diff --git a/tests/lib/coverage/ty-and-con-withCov-009/test.ipkg b/tests/lib/coverage/ty-and-con-withCov-009/test.ipkg new file mode 100644 index 000000000..879278361 --- /dev/null +++ b/tests/lib/coverage/ty-and-con-withCov-009/test.ipkg @@ -0,0 +1,6 @@ +package a-test +executable = a-test + +depends = deptycheck + +main = PrintCoverage diff --git a/tests/runner/Runner.idr b/tests/runner/Runner.idr index 2c0d41bae..d35711009 100644 --- a/tests/runner/Runner.idr +++ b/tests/runner/Runner.idr @@ -11,11 +11,13 @@ main : IO () main = goldenRunner $ [ "The `Gen` monad" `atDir` "lib/gen-monad" , "Distribution of generators" `atDir` "lib/distribution" + , "Model coverage" `atDir` "lib/coverage" , "The library documentation" `atDir` "docs" , "Derivation utils: TTImp equality up to renaming" `atDir` "derivation/utils/up-to-renaming-ttimp-eq" , "Derivation utils: canonic signature" `atDir` "derivation/utils/canonicsig" , "Derivation utils: constructors analysis" `atDir` "derivation/utils/cons-analysis" , "Derivation utils: argument dependencies" `atDir` "derivation/utils/arg-deps" + , "Reflection utils: involved types" `atDir` "derivation/utils/involved-types" , "Derivation: input validation" `atDir` "derivation/inputvalidation" , "Derivation: running harness" `atDir` "derivation/infra" , [ "Derivation: least effort (\{p}, \{w})" `atDir` "derivation/least-effort/\{p}/\{w}"