mirror of
https://github.com/google/ghc-source-gen.git
synced 2024-12-02 10:03:30 +03:00
Remove the deprecated patBind
and bump to 0.2. (#15)
This commit is contained in:
parent
2929534d05
commit
3de930e086
@ -1,11 +1,9 @@
|
||||
# Changelog for haskell-syntax
|
||||
|
||||
## 0.1.1.0
|
||||
## 0.2
|
||||
- Improved comments for instances of `HasValBind'.
|
||||
- Generalized `patBind` to any `HasValBind` so it can be used
|
||||
with `let'` and `while'`. The old version is still exported
|
||||
from `GHC.SourceGen.Decl`, but deprecated. The new version is
|
||||
exported from `GHC.SourceGen.Binds` and `GHC.SourceGen`.
|
||||
with `let'` and `while'`.
|
||||
|
||||
## 0.1.0.0
|
||||
Initial version.
|
||||
|
@ -5,7 +5,7 @@
|
||||
# https://developers.google.com/open-source/licenses/bsd
|
||||
|
||||
name: ghc-source-gen
|
||||
version: 0.1.1.0
|
||||
version: 0.2
|
||||
github: "google/ghc-source-gen"
|
||||
license: BSD3
|
||||
author: "Judah Jacobson"
|
||||
|
@ -32,7 +32,7 @@ module GHC.SourceGen
|
||||
) where
|
||||
|
||||
import GHC.SourceGen.Binds
|
||||
import GHC.SourceGen.Decl hiding (patBind)
|
||||
import GHC.SourceGen.Decl
|
||||
import GHC.SourceGen.Expr
|
||||
import GHC.SourceGen.Lit
|
||||
import GHC.SourceGen.Module
|
||||
|
@ -11,8 +11,6 @@ module GHC.SourceGen.Decl
|
||||
type'
|
||||
, newtype'
|
||||
, data'
|
||||
-- * Pattern bindings
|
||||
, patBind
|
||||
-- * Data constructors
|
||||
, prefixCon
|
||||
, infixCon
|
||||
@ -32,7 +30,6 @@ module GHC.SourceGen.Decl
|
||||
|
||||
import BasicTypes (LexicalFixity(Prefix))
|
||||
import Bag (listToBag)
|
||||
import HsBinds (HsBindLR(..))
|
||||
import HsDecls
|
||||
import HsTypes
|
||||
( ConDeclField(..)
|
||||
@ -52,7 +49,6 @@ import PlaceHolder (PlaceHolder(..))
|
||||
#endif
|
||||
|
||||
import GHC.SourceGen.Binds hiding (patBind)
|
||||
import GHC.SourceGen.Binds.Internal (mkGRHSs)
|
||||
import GHC.SourceGen.Lit.Internal (noSourceText)
|
||||
import GHC.SourceGen.Name.Internal
|
||||
import GHC.SourceGen.Syntax
|
||||
@ -317,31 +313,3 @@ renderCon98Decl name details = noExt ConDeclH98 (typeRdrName name)
|
||||
Nothing
|
||||
details
|
||||
Nothing
|
||||
|
||||
-- | A pattern binding.
|
||||
--
|
||||
-- > x = y
|
||||
-- > =====
|
||||
-- > patBind (var "x") $ rhs $ var "y"
|
||||
--
|
||||
-- > (x, y) = e
|
||||
-- > =====
|
||||
-- > patBind (tuple [var "x", var "y"]) $ rhs e
|
||||
--
|
||||
-- > (x, y)
|
||||
-- > | test = (1, 2)
|
||||
-- > | otherwise = (2, 3)
|
||||
-- > =====
|
||||
-- > patBind (tuple [var "x", var "y"])
|
||||
-- > $ guardedRhs
|
||||
-- > [ var "test" `guard` tuple [int 1, int 2]
|
||||
-- > , var "otherwise" `guard` [int 2, int 3]
|
||||
-- > ]
|
||||
patBind :: Pat' -> RawGRHSs -> HsDecl'
|
||||
patBind p g =
|
||||
bindB
|
||||
$ withPlaceHolder
|
||||
(withPlaceHolder
|
||||
(noExt PatBind (builtPat p) (mkGRHSs g)))
|
||||
$ ([],[])
|
||||
{-# DEPRECATED patBind "Use GHC.SourceGen.patBind (equivalently: GHC.SourceGen.Binds.patBind)"#-}
|
||||
|
Loading…
Reference in New Issue
Block a user