purescript-0.8.0.0: src/Language/PureScript/CoreFn/Binders.hs
{-# LANGUAGE DeriveFunctor #-}
-- |
-- The core functional representation for binders
--
module Language.PureScript.CoreFn.Binders where
import Language.PureScript.CoreFn.Literals
import Language.PureScript.Names
-- |
-- Data type for binders
--
data Binder a
-- |
-- Wildcard binder
--
= NullBinder a
-- |
-- A binder which matches a literal value
--
| LiteralBinder a (Literal (Binder a))
-- |
-- A binder which binds an identifier
--
| VarBinder a Ident
-- |
-- A binder which matches a data constructor
--
| ConstructorBinder a (Qualified (ProperName 'TypeName)) (Qualified (ProperName 'ConstructorName)) [Binder a]
-- |
-- A binder which binds its input to an identifier
--
| NamedBinder a Ident (Binder a)
deriving (Show, Read, Functor)