-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unification pertaining to evidence (#1885)
* Fix unification pertaining to evidence * Cleanup interface; better names * Need to reapply the substituion after each arg * Reenable error debugging * Add destruct_all evidence test * Fix tests that were accidentally sorted incorrectly Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4091538
commit 1163ae7
Showing
13 changed files
with
155 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
plugins/hls-tactics-plugin/test/golden/AutoThetaMultipleUnification.expected.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE KindSignatures #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
|
||
import Data.Kind | ||
|
||
data Nat = Z | S Nat | ||
|
||
data HList (ls :: [Type]) where | ||
HNil :: HList '[] | ||
HCons :: t -> HList ts -> HList (t ': ts) | ||
|
||
data ElemAt (n :: Nat) t (ts :: [Type]) where | ||
AtZ :: ElemAt 'Z t (t ': ts) | ||
AtS :: ElemAt k t ts -> ElemAt ('S k) t (u ': ts) | ||
|
||
lookMeUp :: ElemAt i ty tys -> HList tys -> ty | ||
lookMeUp AtZ (HCons t _) = t | ||
lookMeUp (AtS ea') (HCons t hl') = _ | ||
|
21 changes: 21 additions & 0 deletions
21
plugins/hls-tactics-plugin/test/golden/AutoThetaMultipleUnification.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE KindSignatures #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
|
||
import Data.Kind | ||
|
||
data Nat = Z | S Nat | ||
|
||
data HList (ls :: [Type]) where | ||
HNil :: HList '[] | ||
HCons :: t -> HList ts -> HList (t ': ts) | ||
|
||
data ElemAt (n :: Nat) t (ts :: [Type]) where | ||
AtZ :: ElemAt 'Z t (t ': ts) | ||
AtS :: ElemAt k t ts -> ElemAt ('S k) t (u ': ts) | ||
|
||
lookMeUp :: ElemAt i ty tys -> HList tys -> ty | ||
lookMeUp AtZ (HCons t hl') = _ | ||
lookMeUp (AtS ea') (HCons t hl') = _ | ||
|
21 changes: 21 additions & 0 deletions
21
plugins/hls-tactics-plugin/test/golden/DestructAllGADTEvidence.expected.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE KindSignatures #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
|
||
import Data.Kind | ||
|
||
data Nat = Z | S Nat | ||
|
||
data HList (ls :: [Type]) where | ||
HNil :: HList '[] | ||
HCons :: t -> HList ts -> HList (t ': ts) | ||
|
||
data ElemAt (n :: Nat) t (ts :: [Type]) where | ||
AtZ :: ElemAt 'Z t (t ': ts) | ||
AtS :: ElemAt k t ts -> ElemAt ('S k) t (u ': ts) | ||
|
||
lookMeUp :: ElemAt i ty tys -> HList tys -> ty | ||
lookMeUp AtZ (HCons t hl') = _ | ||
lookMeUp (AtS ea') (HCons t hl') = _ | ||
|
20 changes: 20 additions & 0 deletions
20
plugins/hls-tactics-plugin/test/golden/DestructAllGADTEvidence.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE KindSignatures #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
|
||
import Data.Kind | ||
|
||
data Nat = Z | S Nat | ||
|
||
data HList (ls :: [Type]) where | ||
HNil :: HList '[] | ||
HCons :: t -> HList ts -> HList (t ': ts) | ||
|
||
data ElemAt (n :: Nat) t (ts :: [Type]) where | ||
AtZ :: ElemAt 'Z t (t ': ts) | ||
AtS :: ElemAt k t ts -> ElemAt ('S k) t (u ': ts) | ||
|
||
lookMeUp :: ElemAt i ty tys -> HList tys -> ty | ||
lookMeUp ea hl = _ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
maybeAp :: Maybe (a -> b) -> Maybe a -> Maybe b | ||
maybeAp Nothing Nothing = Nothing | ||
maybeAp (Just _) Nothing = Nothing | ||
maybeAp Nothing (Just _) = Nothing | ||
maybeAp (Just _) Nothing = Nothing | ||
maybeAp (Just fab) (Just a) = Just (fab a) |