Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Item has a foo field of type Foo
- -- Foo has bar and bazzes fields of types Bar and [Baz]
- func :: Item -> Map Bar [Baz]
- func i = case foo i of
- Nothing -> mempty
- Just fu -> Map.fromListWith (++) tups
- where tups = map (\x -> (bar x, bazzes x)) fu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement