G
Size: a a a
G
IR
IR
ЗП
G
G
{-# LANGUAGE FlexibleInstances #-}но конструировать — нет (cannot construct infinite type)
class N a where
nNested :: a -> Int
instance N a => N [a] where
nNested = succ . nNested . head
instance {-# OVERLAPS #-} N a where
nNested _ = 0
nNested ([[[[]]]]::[[[[()]]]]) -- gives `4`
G
DB
JS
A
JS
A
JS