packages feed

tilia-0.1.0.0: corpora/vendored/other/cpp/macro-uses-at-the-top-level-out.hs

{-# LANGUAGE CPP #-}

module Terminal.Named where

class Named a where
  name :: a -> String

#define NAMED(ty, str) \
instance Named ty where { name _ = str }

#define NAMED_PAIR(a, b) \
NAMED(a, "first") ; \
NAMED(b, "second")

NAMED(Int, "int")
NAMED(Bool, "bool")

NAMED_PAIR(Char, Double)