mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-26 10:37:00 +00:00
Update generator for GHC 9.2 (#48)
This commit is contained in:
parent
5634b6f67d
commit
b921a72960
@ -135,13 +135,13 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
|
|||||||
derivClause = TH.derivClause ( Just TH.NewtypeStrategy ) classes
|
derivClause = TH.derivClause ( Just TH.NewtypeStrategy ) classes
|
||||||
|
|
||||||
newtypeDecl <-
|
newtypeDecl <-
|
||||||
#if MIN_VERSION_base(4,16,0)
|
#if MIN_VERSION_template_haskell(2,18,0)
|
||||||
( if null docs
|
( if null docs
|
||||||
then TH.newtypeD
|
then TH.newtypeD
|
||||||
else
|
else
|
||||||
\ ctx name bndrs kd con derivs ->
|
\ ctx name bndrs kd con derivs ->
|
||||||
TH.newtypeD_doc ctx name ( fmap pure bndrs ) ( fmap pure kd ) ( con, "", [] ) derivs
|
TH.newtypeD_doc ctx name ( fmap pure bndrs ) ( fmap pure kd ) ( con, Nothing, [] ) derivs
|
||||||
( Text.unpack . Text.unlines . coerce $ docs )
|
( Just . Text.unpack . Text.unlines . coerce $ docs )
|
||||||
)
|
)
|
||||||
#else
|
#else
|
||||||
TH.newtypeD
|
TH.newtypeD
|
||||||
@ -168,13 +168,13 @@ declareEnumeration finiteEnumName countName ( Enumeration {..} ) = do
|
|||||||
patName <- TH.newName patNameStr
|
patName <- TH.newName patNameStr
|
||||||
patSynSig <- TH.patSynSigD patName ( TH.conT tyName )
|
patSynSig <- TH.patSynSigD patName ( TH.conT tyName )
|
||||||
pat <-
|
pat <-
|
||||||
#if MIN_VERSION_base(4,16,0)
|
#if MIN_VERSION_template_haskell(2,18,0)
|
||||||
( if Text.null patDoc
|
( if Text.null patDoc
|
||||||
then TH.patSynD
|
then TH.patSynD
|
||||||
else
|
else
|
||||||
\ nm args dir pat ->
|
\ nm args dir pat ->
|
||||||
TH.patSynD_doc nm args dir pat
|
TH.patSynD_doc nm args dir pat
|
||||||
( Text.unpack patDoc ) []
|
( Just $ Text.unpack patDoc ) []
|
||||||
)
|
)
|
||||||
#else
|
#else
|
||||||
TH.patSynD
|
TH.patSynD
|
||||||
|
@ -243,11 +243,11 @@ patternNameAndValue
|
|||||||
patternNameAndValue enumName =
|
patternNameAndValue enumName =
|
||||||
try do
|
try do
|
||||||
sz <- count
|
sz <- count
|
||||||
modify' ( ( \ st -> st { enumSize = sz, hasExplicitCount = True } ) :: EnumState -> EnumState )
|
modify' ( \ ( EnumState {..} ) -> EnumState { enumSize = sz, hasExplicitCount = True, .. } )
|
||||||
pure Nothing
|
pure Nothing
|
||||||
<|> do
|
<|> do
|
||||||
pat@( _, val ) <- value
|
pat@( _, val ) <- value
|
||||||
modify' ( \ st -> st { enumSize = ( enumSize :: EnumState -> Integer ) st + 1, currEnumTag = val + 1} )
|
modify' ( \ ( EnumState {..} ) -> EnumState { enumSize = enumSize + 1, currEnumTag = val + 1, .. } )
|
||||||
pure ( Just pat )
|
pure ( Just pat )
|
||||||
where
|
where
|
||||||
count :: StateT EnumState m Integer
|
count :: StateT EnumState m Integer
|
||||||
|
Loading…
Reference in New Issue
Block a user