WellFormed.hs 669 B

12345678910111213141516171819202122232425262728
  1. {-# LANGUAGE PatternSynonyms #-}
  2. module Data.SCargot.Repr.WellFormed
  3. ( -- * 'WellFormedSExpr' representation
  4. R.WellFormedSExpr(..)
  5. , R.toWellFormed
  6. , R.fromWellFormed
  7. -- * Useful pattern synonyms
  8. , pattern (:::)
  9. , pattern L
  10. , pattern A
  11. , pattern Nil
  12. ) where
  13. import Data.SCargot.Repr as R
  14. -- | A shorter infix alias to grab the head
  15. -- and tail of a `WFSList`
  16. pattern x ::: xs = R.WFSList (x : xs)
  17. -- | A shorter alias for `WFSList`
  18. pattern L xs = R.WFSList xs
  19. -- | A shorter alias for `WFSAtom`
  20. pattern A a = R.WFSAtom a
  21. -- | A shorter alias for `WFSList []`
  22. pattern Nil = R.WFSList []