Skip to content

Commit

Permalink
refactor: rename MakeConSat -> MakeCon (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
brprice authored May 16, 2023
2 parents cc62697 + d8a8e2a commit 2ff4cb5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions primer-service/test/outputs/OpenAPI/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
},
"InputAction": {
"enum": [
"MakeConSat",
"MakeCon",
"MakeInt",
"MakeChar",
"MakeVar",
Expand Down Expand Up @@ -1062,7 +1062,7 @@
"required": true,
"schema": {
"enum": [
"MakeConSat",
"MakeCon",
"MakeInt",
"MakeChar",
"MakeVar",
Expand Down
2 changes: 1 addition & 1 deletion primer/src/Primer/Action.hs
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ toProgActionInput ::
Available.InputAction ->
Either ActionError [ProgAction]
toProgActionInput def defName mNodeSel opt0 = \case
Available.MakeConSat -> do
Available.MakeCon -> do
opt <- optGlobal
toProg [ConstructSaturatedCon opt]
Available.MakeInt -> do
Expand Down
8 changes: 4 additions & 4 deletions primer/src/Primer/Action/Available.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ data NoInputAction

-- | An action which requires extra data (often a name) before it can be applied.
data InputAction
= MakeConSat
= MakeCon
| MakeInt
| MakeChar
| MakeVar
Expand Down Expand Up @@ -201,7 +201,7 @@ forExpr tydefs l expr =
EmptyHole{} ->
annotate
<> [ Input MakeVar
, Input MakeConSat
, Input MakeCon
]
<> mwhen (Map.member tInt tydefs) [Input MakeInt]
<> mwhen (Map.member tChar tydefs) [Input MakeChar]
Expand Down Expand Up @@ -326,7 +326,7 @@ options ::
-- or found but didn't correspond to the expected sort of entity (type/expr/pattern).
Maybe Options
options typeDefs defs cxt level def mNodeSel = \case
MakeConSat ->
MakeCon ->
pure
. noFree
. map (globalOpt . valConName . snd)
Expand Down Expand Up @@ -451,7 +451,7 @@ sortByPriority l =
DuplicateDef -> P.duplicate
DeleteDef -> P.delete
Input a -> case a of
MakeConSat -> P.useSaturatedValueCon
MakeCon -> P.useSaturatedValueCon
MakeInt -> P.makeInt
MakeChar -> P.makeChar
MakeVar -> P.useVar
Expand Down
6 changes: 3 additions & 3 deletions primer/test/Tests/Action/Available.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import Primer.Action (
toProgActionInput,
toProgActionNoInput,
)
import Primer.Action.Available (InputAction (MakeConSat), NoInputAction (Raise), Option (Option))
import Primer.Action.Available (InputAction (MakeCon), NoInputAction (Raise), Option (Option))
import Primer.Action.Available qualified as Available
import Primer.App (
App,
Expand Down Expand Up @@ -368,7 +368,7 @@ unit_sat_con_1 =
Intermediate
(emptyHole `ann` (tEmptyHole `tfun` tEmptyHole))
[Child1]
(Right (MakeConSat, Option "Cons" $ Just $ unName <$> unModuleName builtinModuleName))
(Right (MakeCon, Option "Cons" $ Just $ unName <$> unModuleName builtinModuleName))
(hole (con cCons [emptyHole, emptyHole] `ann` tEmptyHole) `ann` (tEmptyHole `tfun` tEmptyHole))

unit_sat_con_2 :: Assertion
Expand All @@ -378,7 +378,7 @@ unit_sat_con_2 =
Intermediate
(emptyHole `ann` ((tcon tList `tapp` tcon tNat) `tfun` (tcon tList `tapp` tcon tNat)))
[Child1]
(Right (MakeConSat, Option "Cons" $ Just $ unName <$> unModuleName builtinModuleName))
(Right (MakeCon, Option "Cons" $ Just $ unName <$> unModuleName builtinModuleName))
(hole (con cCons [emptyHole, emptyHole] `ann` tEmptyHole) `ann` ((tcon tList `tapp` tcon tNat) `tfun` (tcon tList `tapp` tcon tNat)))

-- | Apply the action to the node in the input expression pointed to by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -381,7 +381,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -929,7 +929,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -680,7 +680,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -1714,7 +1714,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -491,7 +491,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down Expand Up @@ -1151,7 +1151,7 @@ Output
}
)
, NoInput MakeCase
, Input MakeConSat
, Input MakeCon
( Options
{ opts =
[ Option
Expand Down

1 comment on commit 2ff4cb5

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Primer benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 2ff4cb5 Previous: cc62697 Ratio
evalTestM/discard logs/mapEven 1: outlier variance 0.18483393065861176 outlier variance 0.023795359904818562 outlier variance 7.77
typecheck/mapOddPrim 100: outlier variance 0.5257880501606573 outlier variance 0.020399305555555254 outlier variance 25.77

This comment was automatically generated by workflow using github-action-benchmark.

CC: @dhess

Please sign in to comment.