# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # --type-backward Types4.Foo --type-backward Types4.Foo2 --type-backward Types4.Foo3 --type-backward Types4.Foo4 # TODO --type-backward Types4.Foo5 === {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UnboxedSums #-} module Types4 where type Foo = [String] -type Foo2 = ([String], Int) +type Foo2 = (Foo, Int) -foo :: [String] +foo :: Foo foo = ["foo", "bar"] -foo2 :: ([String], Int) +foo2 :: Foo2 foo2 = (foo, 2) type Foo3 = (Functor f, Traversable t) => t (f a) -> f (t a) -foo3 :: (Functor f, Traversable t) => t (f a) -> f (t a) +foo3 :: Foo3 foo3 = sequence type Foo4 a = (# (# Int, String #) | a #) -foo4 :: (# (# Int, String #) | Bool #) +foo4 :: Foo4 Bool foo4 = (# | True #) type Foo5 = forall r (a :: Type) (b :: TYPE r). (a -> b) -> a -> b #-foo5 :: forall s (c :: Type) (d :: TYPE s). (c -> d) -> c -> d foo5 :: Foo5 foo5 = ($)