module Derive.List.Main where
import Derive.List.Internal
import Data.Semigroup
import GHC.Exts (IsList (..))
import Language.Haskell.TH
data Elisp
= ElispAtom (Either String Integer)
| ElispSexp [Elisp]
deriving (Show)
deriveList ''Elisp 'ElispSexp
emptyElisp :: Elisp
appendElisp :: Elisp -> Elisp -> Elisp
toElispList :: Elisp -> [Elisp]
main = do
putStrLn ""
print $ makeDeriveListNames defaultDeriveListConfig ''Elisp 'ElispSexp
putStrLn ""
print$ emptyElisp
print$ toElispList (ElispAtom (Right 1))
print$ ElispSexp [ElispAtom (Left "+"), ElispAtom (Right 1), ElispAtom (Right 2)] <> mempty <> ElispAtom (Right 3)