Skip to content

Commit

Permalink
Fix (ie delete) bad type signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolverson committed Dec 5, 2019
1 parent 98c04b6 commit d2af10c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/Erl/Data/Map.purs
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,13 @@ fromFoldable :: forall f k v. Ord k => Foldable f => f (Tuple k v) -> Map k v
fromFoldable = foldl (\m (Tuple k v) -> insert k v m) empty

instance foldableMap :: Foldable (Map a) where
foldr :: forall a b. (a -> b -> b) -> b -> f a -> b
foldr f z m = foldr f z (values m)
foldl :: forall a b. (b -> a -> b) -> b -> f a -> b
foldl f = fold (\z _ -> f z)
foldMap :: forall a m. Monoid m => (a -> m) -> f a -> m
foldMap f = foldMap (const f)

instance foldableWithIndexMap :: FoldableWithIndex a (Map a) where
foldrWithIndex :: forall a b. (i -> a -> b -> b) -> b -> f a -> b
foldrWithIndex f = fold (\b i a -> f i a b)
foldlWithIndex :: forall a b. (i -> b -> a -> b) -> b -> f a -> b
foldlWithIndex f = fold (\b i a -> f i b a)
foldMapWithIndex :: forall a m. Monoid m => (i -> a -> m) -> f a -> m
foldMapWithIndex = foldMap

instance traversableMap :: Traversable (Map a) where
Expand Down
2 changes: 2 additions & 0 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ module Test.Main where
import Prelude

import Data.Maybe (Maybe(..))
import Effect (Effect)
import Erl.Data.List (nil, (:))
import Erl.Data.Map as Map
import Test.Assert (assertEqual)

main :: Effect Unit
main = do
assertEqual { actual: Map.lookup 42 (Map.insert 42 "abc" Map.empty)
, expected: Just "abc"
Expand Down

0 comments on commit d2af10c

Please sign in to comment.