1{-# OPTIONS_GHC -Wno-orphans #-}
4-- Module : Streamly.Internal.Data.IsMap.HashMap
5-- Copyright : (c) 2022 Composewell Technologies
6-- License : BSD-3-Clause
7-- Maintainer : streamly@composewell.com
8-- Stability : experimental
11-- Adds an orphan HashMap instance for the IsMap type class from streamly-core
12-- package. This is useful for various combinators that use a map type. We
13-- cannot define this in streamly-core as it adds several non-boot library
14-- dependencies on streamly-core.
16module Streamly.Internal.Data.IsMap.HashMap () where
18import Data.Hashable (Hashable)
19import Streamly.Internal.Data.IsMap (IsMap(..))
21import qualified Data.HashMap.Strict as HashMap
23instance (Hashable k, Eq k) => IsMap (HashMap.HashMap k) where
24 type Key (HashMap.HashMap k) = k
26 mapEmpty = HashMap.empty
27 mapAlterF = HashMap.alterF
28 mapLookup = HashMap.lookup
29 mapInsert = HashMap.insert
30 mapDelete = HashMap.delete
31 mapUnion = HashMap.union
32 mapNull = HashMap.null
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