1{-# LANGUAGE TypeFamilies #-}
2-- Must come after TypeFamilies, otherwise it is re-enabled.
3-- MonoLocalBinds enabled by TypeFamilies causes perf regressions in general.
4{-# LANGUAGE NoMonoLocalBinds #-}
6{-# OPTIONS_GHC -Wno-orphans #-}
9-- Module : Streamly.Internal.Data.IsMap.HashMap
10-- Copyright : (c) 2022 Composewell Technologies
11-- License : BSD-3-Clause
12-- Maintainer : streamly@composewell.com
13-- Stability : experimental
16-- Adds an orphan HashMap instance for the IsMap type class from streamly-core
17-- package. This is useful for various combinators that use a map type. We
18-- cannot define this in streamly-core as it adds several non-boot library
19-- dependencies on streamly-core.
21module Streamly.Internal.Data.IsMap.HashMap () where
23import Data.Hashable (Hashable)
24import Streamly.Internal.Data.IsMap (IsMap(..))
26import qualified Data.HashMap.Strict as HashMap
28#if MIN_VERSION_hashable(1,4,0)
29instance (Hashable k) => IsMap (HashMap.HashMap k) where
31instance (Hashable k, Eq k) => IsMap (HashMap.HashMap k) where
33 type Key (HashMap.HashMap k) = k
35 mapEmpty = HashMap.empty
36 mapAlterF = HashMap.alterF
37 mapLookup = HashMap.lookup
38 mapInsert = HashMap.insert
39 mapDelete = HashMap.delete
40 mapUnion = HashMap.union
41 mapNull = HashMap.null
42 mapTraverseWithKey = HashMap.traverseWithKey
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list