Skip to content

Commit cc7e092

Browse files
committed
libraries: replace deprecated hashmap by unordered-container
this also fixes a macos compilation error of the "hashmap" library
1 parent 6880910 commit cc7e092

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

oopetris-haskell-wrapper.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.36.0.
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
44
--
55
-- see: https://github.com/sol/hpack
66

@@ -37,7 +37,7 @@ library
3737
build-depends:
3838
base >=4.7 && <5
3939
, c-storable-deriving >=0.1.3
40-
, hashmap >=1.3.3
40+
, unordered-containers >=0.2.20
4141
default-language: Haskell2010
4242

4343
executable oopetris-haskell-wrapper-exe
@@ -50,8 +50,8 @@ executable oopetris-haskell-wrapper-exe
5050
build-depends:
5151
base >=4.7 && <5
5252
, c-storable-deriving >=0.1.3
53-
, hashmap >=1.3.3
5453
, oopetris-haskell-wrapper
54+
, unordered-containers >=0.2.20
5555
default-language: Haskell2010
5656

5757
test-suite oopetris-haskell-wrapper-test
@@ -65,6 +65,6 @@ test-suite oopetris-haskell-wrapper-test
6565
build-depends:
6666
base >=4.7 && <5
6767
, c-storable-deriving >=0.1.3
68-
, hashmap >=1.3.3
6968
, oopetris-haskell-wrapper
69+
, unordered-containers >=0.2.20
7070
default-language: Haskell2010

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ description: Please see the README.md
2020
dependencies:
2121
- base >= 4.7 && < 5
2222
- c-storable-deriving >= 0.1.3
23-
- hashmap >= 1.3.3
23+
- unordered-containers >= 0.2.20
2424

2525
ghc-options:
2626
- -Wall

src/Lib.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Lib (isRecordingFile, getLibVersion, getGridProperties, getRecordingInformation, RecordingReturnValue (..)) where
22

33
import qualified AdditionalInformationType as AdType
4-
import Data.HashMap (fromList)
4+
import Data.HashMap.Strict (fromList)
55
import FFI (c_additional_information_field_get_bool, c_additional_information_field_get_double, c_additional_information_field_get_float, c_additional_information_field_get_i32, c_additional_information_field_get_i64, c_additional_information_field_get_i8, c_additional_information_field_get_string, c_additional_information_field_get_type, c_additional_information_field_get_u32, c_additional_information_field_get_u64, c_additional_information_field_get_u8, c_additional_information_field_get_vector, c_additional_information_get_field, c_additional_information_get_keys, c_additional_information_keys_free, c_array_len, c_free_grid_properties, c_free_recording_value_whole, c_get_error, c_get_grid_properties, c_get_information, c_get_lib_version, c_get_recording_information, c_is_error, c_is_recording_file)
66
import Foreign (Storable (sizeOf), withForeignPtr)
77
import Foreign.C (CChar (), CDouble (CDouble), CFloat (CFloat), withCString)

src/Structs.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Structs
2222
)
2323
where
2424

25-
import Data.HashMap (Map)
25+
import Data.HashMap.Strict (HashMap)
2626
import Data.Int (Int32, Int64, Int8)
2727
import Data.Word (Word32, Word64, Word8)
2828
import Foreign.CStorable (CStorable (..))
@@ -51,7 +51,7 @@ data AdditionalInformationField
5151
| FieldVector [AdditionalInformationField]
5252
deriving (Eq, Show)
5353

54-
type AdditionalInformation = Map String AdditionalInformationField
54+
type AdditionalInformation = HashMap String AdditionalInformationField
5555

5656
-- | This aligns the sizeof, so that it works correctly with the library!!
5757
cSizeOfPatch :: (CStorable a) => a -> Int

0 commit comments

Comments
 (0)