Skip to content

Commit 4260212

Browse files
committed
Module renaming, updating imports
1 parent 44044d5 commit 4260212

File tree

11 files changed

+42
-42
lines changed

11 files changed

+42
-42
lines changed

lambda-buffers-compiler/lambda-buffers-compiler.cabal

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ library
120120
LambdaBuffers.Compiler.ProtoCompat
121121
LambdaBuffers.Compiler.ProtoCompat.FromProto
122122
LambdaBuffers.Compiler.ProtoCompat.Types
123-
LambdaBuffers.Compiler.TypeClass.Compat
124-
LambdaBuffers.Compiler.TypeClass.Pat
125-
LambdaBuffers.Compiler.TypeClass.Pretty
126-
LambdaBuffers.Compiler.TypeClass.Rules
127-
LambdaBuffers.Compiler.TypeClass.Solve
128-
LambdaBuffers.Compiler.TypeClass.Utils
129-
LambdaBuffers.Compiler.TypeClass.Validate
130123
LambdaBuffers.Compiler.TypeClassCheck
124+
LambdaBuffers.Compiler.TypeClassCheck.Compat
125+
LambdaBuffers.Compiler.TypeClassCheck.Pat
126+
LambdaBuffers.Compiler.TypeClassCheck.Pretty
127+
LambdaBuffers.Compiler.TypeClassCheck.Rules
128+
LambdaBuffers.Compiler.TypeClassCheck.Solve
129+
LambdaBuffers.Compiler.TypeClassCheck.Utils
130+
LambdaBuffers.Compiler.TypeClassCheck.Validate
131131

132132
hs-source-dirs: src
133133

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ import LambdaBuffers.Compiler.ProtoCompat.Types (
1919
LocalClassRef (LocalClassRef),
2020
TyClassRef (ForeignCI, LocalCI),
2121
)
22-
import LambdaBuffers.Compiler.TypeClass.Pretty (spaced, (<//>))
23-
import LambdaBuffers.Compiler.TypeClass.Utils (
22+
import LambdaBuffers.Compiler.TypeClassCheck.Pretty (spaced, (<//>))
23+
import LambdaBuffers.Compiler.TypeClassCheck.Utils (
2424
Instance,
2525
ModuleBuilder (mbInstances),
2626
TypeClassError (FailedToSolveConstraints),
2727
checkInstance,
2828
mkBuilders,
2929
)
30-
import LambdaBuffers.Compiler.TypeClass.Validate (checkDerive)
30+
import LambdaBuffers.Compiler.TypeClassCheck.Validate (checkDerive)
3131
import Prettyprinter (
3232
Doc,
3333
Pretty (pretty),

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Compat.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Compat.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE OverloadedLabels #-}
22

3-
module LambdaBuffers.Compiler.TypeClass.Compat (
3+
module LambdaBuffers.Compiler.TypeClassCheck.Compat (
44
modulename,
55
defToExp,
66
tyToExp,
@@ -17,7 +17,7 @@ import Data.List.NonEmpty qualified as NE
1717
import Data.Map qualified as M
1818
import Data.Text qualified as T
1919
import LambdaBuffers.Compiler.ProtoCompat qualified as P
20-
import LambdaBuffers.Compiler.TypeClass.Pat (
20+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (
2121
Exp (AppE, DecE, LitE, NilE, RefE),
2222
ExpressionLike (nil, (*:), (*=)),
2323
Literal (ModuleName, Name, Opaque, TyVar),

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Pat.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Pat.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE LambdaCase #-}
22

3-
module LambdaBuffers.Compiler.TypeClass.Pat (
3+
module LambdaBuffers.Compiler.TypeClassCheck.Pat (
44
Pat (..),
55
Exp (..),
66
Literal (..),

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Pretty.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Pretty.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- orphans are the whole point of this module!
33
{-# OPTIONS_GHC -Wno-orphans #-}
44

5-
module LambdaBuffers.Compiler.TypeClass.Pretty (
5+
module LambdaBuffers.Compiler.TypeClassCheck.Pretty (
66
spaced,
77
pointies,
88
(<//>),
@@ -13,14 +13,14 @@ import Control.Lens.Operators ((^.))
1313
import Data.Generics.Labels ()
1414
import Data.Text qualified as T
1515
import LambdaBuffers.Compiler.ProtoCompat qualified as P
16-
import LambdaBuffers.Compiler.TypeClass.Pat (
16+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (
1717
Exp (AppE, ConsE, DecE, LabelE, LitE, NilE, ProdE, RecE, RefE, SumE),
1818
Literal (ModuleName, Name, Opaque, TyVar),
1919
Pat (AppP, ConsP, DecP, LabelP, LitP, NilP, ProdP, RecP, RefP, SumP, VarP),
2020
expList,
2121
patList,
2222
)
23-
import LambdaBuffers.Compiler.TypeClass.Rules (
23+
import LambdaBuffers.Compiler.TypeClassCheck.Rules (
2424
Class (Class),
2525
Constraint (C),
2626
FQClassName (FQClassName),

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Rules.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Rules.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{-# LANGUAGE GADTs #-}
22
{-# LANGUAGE TypeFamilies #-}
33

4-
module LambdaBuffers.Compiler.TypeClass.Rules (
4+
module LambdaBuffers.Compiler.TypeClassCheck.Rules (
55
FQClassName (..),
66
Class (..),
77
Constraint (..),

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Solve.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Solve.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE LambdaCase #-}
22

3-
module LambdaBuffers.Compiler.TypeClass.Solve (solve, inst, Overlap (..)) where
3+
module LambdaBuffers.Compiler.TypeClassCheck.Solve (solve, inst, Overlap (..)) where
44

55
import Control.Monad.Except (throwError)
66
import Control.Monad.Reader (ReaderT, runReaderT)
@@ -11,8 +11,8 @@ import Data.Foldable (traverse_)
1111
import Data.Map qualified as M
1212
import Data.Set qualified as S
1313
import Data.Text (Text)
14-
import LambdaBuffers.Compiler.TypeClass.Pat (Exp (AppE, ConsE, DecE, LabelE, LitE, NilE, ProdE, RecE, RefE, SumE), ExpressionLike ((*:), (*=)), Literal (TyVar), Pat (AppP, ConsP, DecP, LabelP, LitP, NilP, ProdP, RecP, RefP, SumP, VarP), matches)
15-
import LambdaBuffers.Compiler.TypeClass.Rules (Class (csupers), Constraint (C), Rule ((:<=)), ruleClass, ruleHead)
14+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (Exp (AppE, ConsE, DecE, LabelE, LitE, NilE, ProdE, RecE, RefE, SumE), ExpressionLike ((*:), (*=)), Literal (TyVar), Pat (AppP, ConsP, DecP, LabelP, LitP, NilP, ProdP, RecP, RefP, SumP, VarP), matches)
15+
import LambdaBuffers.Compiler.TypeClassCheck.Rules (Class (csupers), Constraint (C), Rule ((:<=)), ruleClass, ruleHead)
1616

1717
{- Pattern/Template/Unification variable substitution.
1818
Given a string that represents a variable name,

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Utils.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Utils.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE OverloadedLabels #-}
22

3-
module LambdaBuffers.Compiler.TypeClass.Utils (
3+
module LambdaBuffers.Compiler.TypeClassCheck.Utils (
44
-- exports for Validate & Tests
55
type Instance,
66
TypeClassError (..),
@@ -27,12 +27,12 @@ import Data.Map qualified as M
2727
import Data.Set qualified as S
2828
import Data.Text qualified as T
2929

30-
import LambdaBuffers.Compiler.TypeClass.Compat (
30+
import LambdaBuffers.Compiler.TypeClassCheck.Compat (
3131
defToExp,
3232
modulename,
3333
tyToPat,
3434
)
35-
import LambdaBuffers.Compiler.TypeClass.Rules (
35+
import LambdaBuffers.Compiler.TypeClassCheck.Rules (
3636
Class (Class),
3737
Constraint (C),
3838
FQClassName (FQClassName),
@@ -50,10 +50,10 @@ import LambdaBuffers.Compiler.ProtoCompat.Types qualified as P (
5050
SourceInfo,
5151
TyClassRef (ForeignCI, LocalCI),
5252
)
53-
import LambdaBuffers.Compiler.TypeClass.Pat (Exp, Literal (ModuleName), Pat (AppP, ConsP, DecP, LabelP, LitP, NilP, ProdP, RecP, RefP, SumP, VarP))
53+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (Exp, Literal (ModuleName), Pat (AppP, ConsP, DecP, LabelP, LitP, NilP, ProdP, RecP, RefP, SumP, VarP))
5454

55-
import LambdaBuffers.Compiler.TypeClass.Pretty (pointies, (<///>))
56-
import LambdaBuffers.Compiler.TypeClass.Solve (Overlap (Overlap))
55+
import LambdaBuffers.Compiler.TypeClassCheck.Pretty (pointies, (<///>))
56+
import LambdaBuffers.Compiler.TypeClassCheck.Solve (Overlap (Overlap))
5757
import Prettyprinter (
5858
Pretty (pretty),
5959
hcat,

lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClass/Validate.hs renamed to lambda-buffers-compiler/src/LambdaBuffers/Compiler/TypeClassCheck/Validate.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module LambdaBuffers.Compiler.TypeClass.Validate (
1+
module LambdaBuffers.Compiler.TypeClassCheck.Validate (
22
-- structural rules
33
mkStructuralRules,
44
-- pattern vars (for tests)
@@ -18,14 +18,14 @@ import Control.Monad.Except (throwError)
1818
import LambdaBuffers.Compiler.ProtoCompat.Types qualified as P (
1919
ModuleName,
2020
)
21-
import LambdaBuffers.Compiler.TypeClass.Pat (Exp (DecE), Literal (Opaque), Pat (ConsP, LabelP, LitP, NilP, ProdP, RecP, SumP, VarP), getLocalRefE)
22-
import LambdaBuffers.Compiler.TypeClass.Rules (
21+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (Exp (DecE), Literal (Opaque), Pat (ConsP, LabelP, LitP, NilP, ProdP, RecP, SumP, VarP), getLocalRefE)
22+
import LambdaBuffers.Compiler.TypeClassCheck.Rules (
2323
Class,
2424
Constraint (C),
2525
Rule ((:<=)),
2626
)
27-
import LambdaBuffers.Compiler.TypeClass.Solve (Overlap, inst, solve)
28-
import LambdaBuffers.Compiler.TypeClass.Utils (
27+
import LambdaBuffers.Compiler.TypeClassCheck.Solve (Overlap, inst, solve)
28+
import LambdaBuffers.Compiler.TypeClassCheck.Utils (
2929
BasicConditionViolation (OverlapDetected),
3030
ModuleBuilder (mbInstances, mbScope, mbTyDefs),
3131
TypeClassError (BadInstance, LocalTyRefNotFound, MalformedTyDef),

lambda-buffers-compiler/test/Test/DeriveCheck.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@ import Data.Map qualified as M
1111
import Data.Set qualified as S
1212
import Data.Text (Text)
1313
import LambdaBuffers.Compiler.ProtoCompat.Types qualified as PC
14-
import LambdaBuffers.Compiler.TypeClass.Pat (
14+
import LambdaBuffers.Compiler.TypeClassCheck (runDeriveCheck)
15+
import LambdaBuffers.Compiler.TypeClassCheck.Pat (
1516
Exp (AppE, DecE, LitE, NilE, RefE),
1617
ExpressionLike (nil, (*:), (*=)),
1718
Literal (ModuleName, Name, Opaque, TyVar),
1819
Pat (AppP, LitP, NilP, RefP),
1920
toProdE,
2021
toSumE,
2122
)
22-
import LambdaBuffers.Compiler.TypeClass.Rules (
23+
import LambdaBuffers.Compiler.TypeClassCheck.Rules (
2324
Class (Class),
2425
Constraint (C),
2526
FQClassName (FQClassName),
2627
Rule ((:<=)),
2728
)
28-
import LambdaBuffers.Compiler.TypeClass.Utils (
29+
import LambdaBuffers.Compiler.TypeClassCheck.Utils (
2930
Instance,
3031
ModuleBuilder (ModuleBuilder, mbClasses, mbInstances, mbScope, mbTyDefs),
3132
TypeClassError,
3233
)
33-
import LambdaBuffers.Compiler.TypeClass.Validate (_X)
34-
import LambdaBuffers.Compiler.TypeClassCheck (runDeriveCheck)
34+
import LambdaBuffers.Compiler.TypeClassCheck.Validate (_X)
3535
import Test.Tasty (TestTree, testGroup)
3636
import Test.Tasty.HUnit (Assertion, assertBool, testCase)
3737

0 commit comments

Comments
 (0)