Rich.hs 734 B

1234567891011121314151617181920212223242526272829303132
  1. {-# LANGUAGE PatternSynonyms #-}
  2. module Data.SCargot.Repr.Rich
  3. ( -- * 'RichSExpr' representation
  4. R.RichSExpr(..)
  5. , R.toRich
  6. , R.fromRich
  7. -- * Useful pattern synonyms
  8. , pattern (:::)
  9. , pattern A
  10. , pattern L
  11. , pattern DL
  12. , pattern Nil
  13. ) where
  14. import Data.SCargot.Repr as R
  15. -- | A shorter infix alias to grab the head
  16. -- and tail of an `RSList`.
  17. pattern x ::: xs = R.RSList (x : xs)
  18. -- | A shorter alias for `RSAtom`
  19. pattern A a = R.RSAtom a
  20. -- | A shorter alias for `RSList`
  21. pattern L xs = R.RSList xs
  22. -- | A shorter alias for `RSDotted`
  23. pattern DL xs x = R.RSDotted xs x
  24. -- | A shorter alias for `RSList []`
  25. pattern Nil = R.RSList []