module Language.PureScript.CoreFn.Binders where
import Prelude.Compat
import Language.PureScript.AST.Literals
import Language.PureScript.Names
data Binder a
= NullBinder a
| LiteralBinder a (Literal (Binder a))
| VarBinder a Ident
| ConstructorBinder a (Qualified (ProperName 'TypeName)) (Qualified (ProperName 'ConstructorName)) [Binder a]
| NamedBinder a Ident (Binder a) deriving (Show, Functor)
extractBinderAnn :: Binder a -> a
extractBinderAnn (NullBinder a) = a
extractBinderAnn (LiteralBinder a _) = a
extractBinderAnn (VarBinder a _) = a
extractBinderAnn (ConstructorBinder a _ _ _) = a
extractBinderAnn (NamedBinder a _ _) = a