typerep-map
typerep-map copied to clipboard
Use 'inspection-testing' to guarantee that implementation for `TMap` is as efficient as for `TypeRepMap`
@ChShersh @vrom911 is this still a valid/wanted task? If so I'll like to give it a go.
@qoelet Sure, go for it! But I would like you to add some documentation while you work on this. I never used inspection-testing by myself, so looking just at the code might be a little bit difficult to review.
I've been taking a look at this issue, read the blog post to find out more about the library. But I'm not grasping what Tmap is as efficient as TypeRepMap?
Also been looking at the inspection-testing examples to try and find something that might fit the problem but with no luck.
I also saw the use in stan but that didn't give me clues either 😄
Hi @Cmdv! TypeRepMap is parametrized by a polymorphic type variable, and TMap is special case of TypeRepMap with Identify instead of the f type variable.
However, despite being a specialization of TypeRepMap, TMap implements almost all functions separately, e.g. insert.
inspection-testing is a Haskell library for checking, wether two functions are compiled to the same code in the end. And we want to check this for similar functions of TMap and TypeRepMap. I haven't used inspections-testing before, so this task requires some research :slightly_smiling_face:
@chshersh ah cool, so do I'd want to check for example: https://github.com/kowainik/typerep-map/blob/22af85834199e41ec7edefe48a6f45dc3abde751/src/Data/TMap.hs#L95-L96 https://github.com/kowainik/typerep-map/blob/22af85834199e41ec7edefe48a6f45dc3abde751/src/Data/TypeRepMap/Internal.hs#L184-L191
making sure they compile to the same code? do you test agains the empty function or is it against its results when being run?
@Cmdv Yes, you got the idea right :+1: Checking just functions without applying them to any arguments should be enough.
Perfect I'll give it a go 😄
After spending best part of the day trying to use haskell-language-server things seem to compile but they aren't working the the ./test dir for some reason.
I've tried both with cabal and stack but can't seem to get around it. 😢
Will try pick it up if I can get things working 😄