diff options
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r-- | compiler/GHC/Core/DataCon.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Core/Multiplicity.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Core/Opt/Arity.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Core/Opt/Monad.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Core/Opt/Simplify.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Core/Opt/Simplify/Env.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Core/SimpleOpt.hs | 2 |
7 files changed, 10 insertions, 12 deletions
diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index 04570f9af7..87e6bf10c9 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -1321,7 +1321,7 @@ dataConStupidTheta dc = dcStupidTheta dc Note [Displaying linear fields] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A constructor with a linear field can be written either as -MkT :: a #-> T a (with -XLinearTypes) +MkT :: a %1 -> T a (with -XLinearTypes) or MkT :: a -> T a (with -XNoLinearTypes) @@ -1330,7 +1330,7 @@ They differ in how linear fields are handled. 1. dataConWrapperType: The type of the wrapper in Core. -For example, dataConWrapperType for Maybe is a #-> Just a. +For example, dataConWrapperType for Maybe is a %1 -> Just a. 2. dataConNonlinearType: The type of the constructor, with linear arrows replaced by unrestricted ones. diff --git a/compiler/GHC/Core/Multiplicity.hs b/compiler/GHC/Core/Multiplicity.hs index 8c3ad88fc2..73535a3e15 100644 --- a/compiler/GHC/Core/Multiplicity.hs +++ b/compiler/GHC/Core/Multiplicity.hs @@ -216,7 +216,7 @@ That is, in We have - Just :: a #-> Just a + Just :: a %1 -> Just a The goal is to maximise reuse of types between linear code and traditional code. This is argued at length in the proposal and the article (links in Note @@ -232,7 +232,7 @@ backwards compatibility. Consider We have map :: (a -> b) -> f a -> f b - Just :: a #-> Just a + Just :: a %1 -> Just a Types don't match, we should get a type error. But this is legal Haskell 98 code! Bad! Bad! Bad! @@ -242,7 +242,7 @@ polymorphism. Instead, we generalise the type of Just, when used as term: - Just :: forall {p}. a #p-> Just a + Just :: forall {p}. a %p-> Just a This is solely a concern for higher-order code like this: when called fully applied linear constructors are more general than constructors with unrestricted diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs index 2471470814..1526be01ca 100644 --- a/compiler/GHC/Core/Opt/Arity.hs +++ b/compiler/GHC/Core/Opt/Arity.hs @@ -1490,7 +1490,7 @@ pushCoValArg co -- We can't push the coercion in the case where co_mult isn't reflexivity: -- it could be an unsafe axiom, and losing this information could yield -- ill-typed terms. For instance (fun x ::(1) Int -> (fun _ -> () |> co) x) - -- with co :: (Int -> ()) ~ (Int #-> ()), would reduce to (fun x ::(1) Int + -- with co :: (Int -> ()) ~ (Int %1 -> ()), would reduce to (fun x ::(1) Int -- -> (fun _ ::(Many) Int -> ()) x) which is ill-typed -- If co :: (tyL1 -> tyL2) ~ (tyR1 -> tyR2) diff --git a/compiler/GHC/Core/Opt/Monad.hs b/compiler/GHC/Core/Opt/Monad.hs index 070ea11cc2..e7298fef54 100644 --- a/compiler/GHC/Core/Opt/Monad.hs +++ b/compiler/GHC/Core/Opt/Monad.hs @@ -412,7 +412,7 @@ EtaExpansion: fail = \void. (\s. (e |> g) s) |> sym g where g :: IO () ~ S -> (S,()) --> Next iteration of simplify fail1 = \void. \s. (e |> g) s - fail = fail1 |> Void#->sym g + fail = fail1 |> Void# -> sym g And now inline 'fail' CaseMerge: diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs index 6c207766bd..96d9cfc61e 100644 --- a/compiler/GHC/Core/Opt/Simplify.hs +++ b/compiler/GHC/Core/Opt/Simplify.hs @@ -2640,7 +2640,7 @@ rebuildCase env scrut case_bndr alts cont -- -- As an illustration, consider the following -- case[Many] case[1] of { C x -> C x } of { C x -> (x, x) } - -- Where C :: A #-> T is linear + -- Where C :: A %1 -> T is linear -- If we were to produce a case[1], like the inner case, we would get -- case[1] of { C x -> (x, x) } -- Which is ill-typed with respect to linearity. So it needs to be a diff --git a/compiler/GHC/Core/Opt/Simplify/Env.hs b/compiler/GHC/Core/Opt/Simplify/Env.hs index 7049e3e578..7d53a2db2b 100644 --- a/compiler/GHC/Core/Opt/Simplify/Env.hs +++ b/compiler/GHC/Core/Opt/Simplify/Env.hs @@ -953,7 +953,7 @@ adjustJoinPointType mult new_res_ty join_id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider a join point which is linear in its variable, in some context E: -E[join j :: a #-> a +E[join j :: a %1 -> a j x = x in case v of A -> j 'x' @@ -961,7 +961,7 @@ E[join j :: a #-> a The simplifier changes to: -join j :: a #-> a +join j :: a %1 -> a j x = E[x] in case v of A -> j 'x' diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs index 67f08cdd23..d066535e30 100644 --- a/compiler/GHC/Core/SimpleOpt.hs +++ b/compiler/GHC/Core/SimpleOpt.hs @@ -1342,5 +1342,3 @@ exprIsLambda_maybe (in_scope_set, id_unf) e exprIsLambda_maybe _ _e = -- pprTrace "exprIsLambda_maybe:Fail" (vcat [ppr _e]) Nothing - - |