diff --git a/aeson-flowtyped.cabal b/aeson-flowtyped.cabal
--- a/aeson-flowtyped.cabal
+++ b/aeson-flowtyped.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           aeson-flowtyped
-version:        0.8.0
+version:        0.8.1
 synopsis:       Create Flow type definitions from Haskell data types.
 description:    Create Flow type definitions from Haskell data types.
 category:       Web
diff --git a/src/Data/Aeson/Flow.hs b/src/Data/Aeson/Flow.hs
--- a/src/Data/Aeson/Flow.hs
+++ b/src/Data/Aeson/Flow.hs
@@ -85,6 +85,7 @@
 import qualified Data.Vector.Unboxed              as VU
 import qualified Data.Void                        as Void
 import           Data.Word
+import           Data.Maybe
 import           GHC.Generics
 import           GHC.TypeLits
 import qualified Text.PrettyPrint.Leijen          as PP
@@ -368,13 +369,17 @@
     pGetName _ = Proxy
 
 flowTypePreferName :: (Typeable a, FlowTyped a) => Proxy a -> FlowType
-flowTypePreferName p = case flowTypeName p of
-  Just n | null vars -> name
-         | otherwise -> Fix (PolyApply name vars)
+flowTypePreferName p = fromMaybe (flowType p) (flowTypeRecur p)
+
+flowTypeRecur :: (Typeable a, FlowTyped a) => Proxy a -> Maybe FlowType
+flowTypeRecur p = case flowTypeName p of
+  Just n
+    | null vars -> Just name
+    | otherwise -> Just (Fix (PolyApply name vars))
     where
       vars = flowTypeVars p
       name = Fix (Name (FlowName p n))
-  Nothing -> flowType p
+  Nothing -> Nothing
 
 class Typeable a => FlowTyped a where
   flowType :: Proxy a -> FlowType
@@ -693,25 +698,25 @@
   flowType _ = Fix (Array (flowTypePreferName (Proxy :: Proxy a)))
   flowTypeName _ = Nothing
 
-data Var :: Nat -> Type where Var :: Var a
+data Var :: k -> Type where Var :: Var a
 
-instance Typeable a => FlowTyped (Var a) where
+instance (Typeable a, Typeable k) => FlowTyped (Var (a :: k)) where
   isPrim _ = False
-  flowType _ = Fix (PolyVar (typeRep (Proxy :: Proxy (Var a))))
+  flowType _ = Fix (PolyVar (typeRep (Var :: Var a)))
   flowTypeName _ = Nothing
 
 -- | This instance is defined recursively. You'll probably need to use
 -- 'dependencies' to extract a usable definition
-instance (Typeable a, KnownNat a, v ~ Var a) => FlowTyped (Tree.Tree v) where
+instance Typeable a => FlowTyped (Tree.Tree a) where
   isPrim _ = False
-  flowType _ = Fix
-    (Tuple
-     (V.fromList
-      [ flowType (Proxy :: Proxy v)
-      , Fix (Array (flowTypePreferName (Proxy :: Proxy (Tree.Tree v))))
-      ]))
+  flowType _ = Fix (Tuple
+                    (V.fromList
+                     [ flowType (Proxy :: Proxy (Var a))
+                     , Fix (Array
+                            (fromJust (flowTypeRecur (Proxy :: Proxy (Tree.Tree a)))))
+                     ]))
   flowTypeName _ = Just "Tree"
-  flowTypeVars _ = [typeRep (Proxy :: Proxy v)]
+  flowTypeVars _ = [typeRep (Var :: Var a)]
 
 instance FlowTyped () where
   isPrim _ = False
diff --git a/test/Spec.hs b/test/Spec.hs
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -56,10 +56,11 @@
 data Poly2 a b = Poly2 a b | Poly2Go (Poly2 a b)
   deriving (Generic)
 
-instance (a ~ Var 0, b ~ Var 1) => FlowTyped (Poly2 a b) where
+instance (Typeable a, FlowTyped a, Typeable b, FlowTyped b) =>
+         FlowTyped (Poly2 a b) where
   flowTypeVars _ =
-    [ typeRep (Proxy :: Proxy a)
-    , typeRep (Proxy :: Proxy b)
+    [ typeRep (Var :: Var 0)
+    , typeRep (Var :: Var 1)
     ]
 
 main :: IO ()
