Deep map?
See original GitHub issueI often write several levels of map: map (map (...
Is it possible to implement a generic “deepMap” that maps the innermost or arbitrarily nested functors?
Possible inspiration: http://okmij.org/ftp/Haskell/typecast.html#deepest-functor
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (18 by maintainers)
Top Results From Across the Web
Deep map - Wikipedia
A deep map is a map with greater information than a two-dimensional image of places, names, and topography. One such kind of intensive...
Read more >Deep Maps and Spatial Narratives
Deep maps are finely detailed, multimedia depictions of a place and the people, buildings, objects, flora, and fauna that exist within it and...
Read more >The Deep Map The Philos Project
The Deep Map is a weekly podcast that explores the hidden religious and cultural forces driving headlines in the Near East and around...
Read more >DeepStateMAP | Map of the war in Ukraine
News of Russia's war against Ukraine on the map. ... It's dangerous and forbidden to use this map for green corridors – it...
Read more >Defining Deep Maps - The Polis Center - IUPUI
Don: Deep mapping is an epistemology for studying spatial patterns, processes, or phenomena through the integration of a wide-range of spatially and temporally ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are dealing with two monads - async and result… So monad transformers are just a type to help combine them.
I have
ResultT<Async<Result<_>>>
because I am combining with Async. It seems a bit backwards as the Result is inner. The ResultT can combine with any other monad.I wrote notes as I started to feel comfortable with them, because I also struggled to comprehend them for a long time… See here http://adzdavies.blogspot.com/2019/12/monadtransformers-lets-look-at-resultt.html
There is
Compose
which allows you to compose arbitrary functorshttps://github.com/fsprojects/FSharpPlus/blob/33fa3411cb080fc70d8b4ad4f71e16d63bc82128/src/FSharpPlus/Monoids.fs#L93-L114
But what you want is to avoid wrapping / unwrapping.
We could add a set of
map2
mapN
functions, additionally/alternatively we could add some funny versions of applicative operators like<!!>
and<**>
.Definitely it’s something to consider.
A full generic
deepmap
over an arbitrary number of functors is quite complex to encode, it might be possible I have to give it a try.Then if it works we have to see how is type inference, my feeling is that with the current state of the F# compiler it won’t be amazing.