Remove the deprecated patBind and bump to 0.2. (#15)

This commit is contained in:
Judah Jacobson 2019-07-28 13:33:52 -07:00 committed by GitHub
parent 2929534d05
commit 3de930e086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 38 deletions

View File

@ -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.

View File

@ -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"

View File

@ -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

View File

@ -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)"#-}