typeLiteral :: TypeLiteralVariant -> Gen TypeLiteral
typeLiteral variant = frequency $
    [ (3, Parameter <$> lowerLetter)
    , (3, Concrete <$> rightCapitalIdentifier)
    , (1, Generic <$> rightCapitalIdentifier <*> resize 3 (listOf1 (typeLiteral WithNothing)))
    , (2, Function <$> typeLiteral WithNothing <*> typeLiteral WithUnit) ]
    ++ case variant of WithVar     -> [(3, return Var)]
                       WithUnit    -> [(3, return Unit)]
                       WithNothing -> []
typeLiteral :: TypeLiteralVariant -> Gen TypeLiteral
typeLiteral variant = frequency $
    [ (3, Parameter <$> lowerLetter)
    , (3, Concrete <$> rightCapitalIdentifier)
    , (1, Generic <$> rightCapitalIdentifier <*> resize 3 (listOf1 (typeLiteral WithNothing)))
    , (2, Function <$> typeLiteral WithNothing <*> typeLiteral WithUnit) ]
    ++ case variant of WithVar     -> [(3, return Var)]
                       WithUnit    -> [(3, return Unit)]
                       WithNothing -> []
typeLiteral variant = frequency $
    [ (3, Parameter <$> lowerLetter)
    , (3, Concrete <$> rightCapitalIdentifier)
    , (1, Generic <$> rightCapitalIdentifier <*> resize 3 (listOf1 (typeLiteral WithNothing)))
    , (2, Function <$> typeLiteral WithNothing <*> typeLiteral WithUnit) ]
    ++ case variant of WithVar     -> [(3, return Var)]
                       WithUnit    -> [(3, return Unit)]
                       WithNothing -> []