-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sdl2
compatible with base
< 4.11
#310
Comments
sdl2
compatible with base
< 4.11
base-4.11 is over 4 years old. Pre 4.11 puts you all the way back to GHC 8.2. I'm not sure we've ever decided what our support policy is, but that is a whopping huge window and not sure we have the resources to actually commit to that |
From the current version of the same file in Lines 67 to 69 in 5c92d46
Those three lines help support the GHC 7 series (the last version of which was released 9 years ago; incidentally, both I'm not trying to stir a debate on where the line should be drawn. All I'm asking is if you'd accept a 3 line patch in the same file :) |
Of course we could accept such a patch, I'm just saying don't expect it to not just break again :) |
This commit enables compatibility of sdl2 with base versions prior to 4.11 (corresponding to GHC versions prior to 8.4). The patch requires introducing protections around a warning flag that didn't exist prior to GHC 8.4, and a conditional import.
Thanks! I've sent a PR. I tried it with GHC 7.10 (since |
The module
SDL.Input.Mouse
assumes that(<>)
is defined inPrelude
, but that only happened inbase
4.11. Until then, the symbol was defined inData.Semigroup
, and another is defined inData.Monoid
(for some types, the two are equivalent).It's being used here: https://github.com/haskell-game/sdl2/blob/master/src/SDL/Input/Mouse.hs#L307
We are trying to move
dunai
to usesdl2
, and we are hitting a problem with supporting older versions of GHC.Would it be possible to add a conditional import so that
sdl2
compiles with older versions of GHC as well?Since
<>
is used onString
s, which are lists of characters, and lists are monoids, then it's safe to pick the version fromData.Monoid
because they are equivalent per the definition of Semigroup:Therefore, something along the following lines would do:
The text was updated successfully, but these errors were encountered: