{-# LANGUAGE Rank2Types #-} module Data.TrieMap.Sized where -- class Sized f where -- getSize :: f a -> Int -- -- newtype Elem a = Elem {getElem :: a} -- -- instance Sized Elem where -- getSize _ = 1 type Sized f = forall ix . f ix -> Int newtype Elem a = Elem {getElem :: a} elemSize :: Sized Elem elemSize _ = 1