git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fixes Language.PureScript.Types.everywhereOnTypesTopDown

The function everywhereOnTypesTopDown didn't work consistently over parenthesized and binary operator types. This can be seen in the type signature here: https://pursuit.purescript.org/packages/purescript-day/6.0.0/docs/Data.Functor.Day#v:runDay

commit029c4d9d06e5316f905639dac3b853cb2364e972 authorIan D. Bollinger <ian.bollinger@gmail.com> dateMon 15 Aug 2016, 00:54 (10 years ago) parent9b34d87
4 files changed+6−2
CONTRIBUTORS.md+1 examples/docs/src/ExplicitTypeSignatures.purs+2 src/Language/PureScript/Types.hs+2−2 tests/TestDocs.hs+1
CONTRIBUTORS.md+1
@@ -30,6 +30,7 @@ This file lists the contributors to the PureScript compiler project, and the ter
3030- [@felixSchl](https://github.com/felixSchl) (Felix Schlitter) My existing contributions and all future contributions until further notice are Copyright Felix Schlitter, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3131- [@garyb](https://github.com/garyb) (Gary Burgess) My existing contributions and all future contributions until further notice are Copyright Gary Burgess, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3232- [@hdgarrood](https://github.com/hdgarrood) (Harry Garrood) My existing contributions and all future contributions until further notice are Copyright Harry Garrood, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
33+- [@ianbollinger](https://github.com/ianbollinger) (Ian D. Bollinger) My existing contributions and all future contributions until further notice are Copyright Ian D. Bollinger, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3334- [@ilovezfs](https://github.com/ilovezfs) - My existing contributions and all future contributions until further notice are Copyright ilovezfs, and are licensed to the owners and users of the PureScript compiler project under the terms of the MIT license
3435- [@izgzhen](https://github.com/izgzhen) (Zhen Zhang) My existing contributions and all future contributions until further notice are Copyright Zhen Zhang, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
3536- [@jacereda](https://github.com/jacereda) (Jorge Acereda) My existing contributions and all future contributions until further notice are Copyright Jorge Acereda, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
examples/docs/src/ExplicitTypeSignatures.purs+2
@@ -14,3 +14,5 @@ anInt = 0
1414
1515-- This should infer a type.
1616aNumber = 1.0
17+
18+foreign import nestedForAll :: forall c. (forall a b. c)
src/Language/PureScript/Types.hs+2−2
@@ -257,8 +257,8 @@ everywhereOnTypesTopDown f = go . f
257257 go (PrettyPrintFunction t1 t2) = PrettyPrintFunction (go (f t1)) (go (f t2))
258258 go (PrettyPrintObject t) = PrettyPrintObject (go (f t))
259259 go (PrettyPrintForAll args t) = PrettyPrintForAll args (go (f t))
260− go (BinaryNoParensType t1 t2 t3) = BinaryNoParensType (f (go t1)) (f (go t2)) (f (go t3))
261− go (ParensInType t) = ParensInType (f (go t))
260+ go (BinaryNoParensType t1 t2 t3) = BinaryNoParensType (go (f t1)) (go (f t2)) (go (f t3))
261+ go (ParensInType t) = ParensInType (go (f t))
262262 go other = f other
263263
264264everywhereOnTypesM :: Monad m => (Type -> m Type) -> Type -> m Type
tests/TestDocs.hs+1
@@ -278,6 +278,7 @@ testCases =
278278 [ ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "explicit" (ShowFn (hasTypeVar "something"))
279279 , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "anInt" (ShowFn (P.tyInt ==))
280280 , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "aNumber" (ShowFn (P.tyNumber ==))
281+ , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "nestedForAll" (renderedType "forall c. (forall a b. c)")
281282 ])
282283
283284 , ("ConstrainedArgument",