module Sym.Internal.Size (Size (..)) where

import qualified Data.Set as Set

class Size a where
    size :: a -> Int

instance Size [a] where
    size :: [a] -> Int
size = [a] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length

instance Size (Set.Set a) where
    size :: Set a -> Int
size = Set a -> Int
forall a. Set a -> Int
Set.size

instance Size a => Size (Maybe a) where
    size :: Maybe a -> Int
size Maybe a
Nothing  = Int
0
    size (Just a
x) = a -> Int
forall a. Size a => a -> Int
size a
x