[Haskell-beginners] Trying to understand type families.

Michael Litchard michael at schmong.org
Sat Aug 20 00:27:24 CEST 2011


For this question, I'll refer to
http://www.haskell.org/haskellwiki/GHC/Type_families#A_unit_instance

In particular this example


instance GMapKey () where
  data GMap () v           = GMapUnit (Maybe v)
  empty                    = GMapUnit Nothing
  lookup () (GMapUnit v)   = v
  insert () v (GMapUnit _) = GMapUnit $ Just v

Could someone explain what the () is doing?



More information about the Beginners mailing list