Skip to content

Commit

Permalink
Address @marcosh's comments from #128. #146
Browse files Browse the repository at this point in the history
  • Loading branch information
epost committed Aug 7, 2019
1 parent bbca707 commit 7da0cb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Language/Instance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}

{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
Expand Down Expand Up @@ -644,7 +643,7 @@ pivot (Instance sch _ idp (Algebra _ ens _ fk fn tys nnf rep2'' teqs)) = (sch',
dp' (EQ (l, r)) = idp $ EQ (instToInst l, instToInst r)

ens' = Set.singleton
gen' = id
gen' = id
fk' (x, f) (x', _) | x == x' = (fk f x', snd $ Schema.sch_fks sch ! f)
| otherwise = error "anomaly, please report"
rep' = Gen
Expand All @@ -669,14 +668,17 @@ pivot (Instance sch _ idp (Algebra _ ens _ fk fn tys nnf rep2'' teqs)) = (sch',
inst = Instance sch' (Presentation gens' sks' eqs') dp' alg'
mapp = Mapping sch' sch em fm am

schToInst' :: x -> Term () ty sym (x, en) (x, fk) (x, att) Void Void -> Term Void ty sym en fk att gen sk
schToInst'
:: x
-> Term () ty sym (x, en) (x, fk) (x, att) Void Void
-> Term Void ty sym en fk att gen sk
schToInst' x z = case z of
Sym f as -> Sym f $ fmap (schToInst' x) as
Att (_, f) a -> Att f $ schToInst' x a
Sk x0 -> absurd x0
Var () -> upp $ fn x
Fk (_, f) a -> Fk f $ schToInst' x a
Gen x0 -> absurd x0
Gen x0 -> absurd x0

instToInst :: Term Void ty sym (x, en) (x, fk) (x, att) (x, en) y -> Term Void ty sym en fk att gen sk
instToInst z = case z of
Expand Down
1 change: 0 additions & 1 deletion src/Language/Parser/Instance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-}

{-# LANGUAGE TupleSections #-}

module Language.Parser.Instance where
Expand Down

0 comments on commit 7da0cb7

Please sign in to comment.