joelwilliamson / bimap Goto Github PK
View Code? Open in Web Editor NEWBidirectional mapping between two key types
License: BSD 3-Clause "New" or "Revised" License
Bidirectional mapping between two key types
License: BSD 3-Clause "New" or "Revised" License
Sorry if I'm missing something obvious, but why do you have the Ord
constraint on map
and mapR
?
The instance is free and allows things like using Bimap
s as Map
keys.
@ivanperez-keera @intricate @bingis-khan
I just uploaded v0.5 containing both the recent changes to Hackage. Would one of you mind testing to make sure it's usable?
Is there a reason why there's no IsList
instance? If such instance would make sense I could submit a PR for adding it 🙏
Hi! Latest version does not build:
➜ /tmp cabal get bimap
Downloading bimap-0.3.1...
Unpacking to bimap-0.3.1/
➜ /tmp cd bimap-0.3.1
➜ bimap-0.3.1 cabal sandbox init
Writing a default package environment file to
/tmp/bimap-0.3.1/cabal.sandbox.config
Creating a new sandbox at /tmp/bimap-0.3.1/.cabal-sandbox
➜ bimap-0.3.1 cabal install
Resolving dependencies...
Notice: installing into a sandbox located at /tmp/bimap-0.3.1/.cabal-sandbox
Configuring stm-2.4.4...
Configuring transformers-0.4.3.0...
Building stm-2.4.4...
Building transformers-0.4.3.0...
Installed stm-2.4.4
Installed transformers-0.4.3.0
Configuring transformers-compat-0.4.0.4...
Configuring mtl-2.2.1...
Building transformers-compat-0.4.0.4...
Building mtl-2.2.1...
Installed transformers-compat-0.4.0.4
Installed mtl-2.2.1
Configuring exceptions-0.8.0.2...
Building exceptions-0.8.0.2...
Installed exceptions-0.8.0.2
Configuring bimap-0.3.1...
Building bimap-0.3.1...
Failed to install bimap-0.3.1
Build log ( /tmp/bimap-0.3.1/.cabal-sandbox/logs/bimap-0.3.1.log ):
Configuring bimap-0.3.1...
Building bimap-0.3.1...
Preprocessing library bimap-0.3.1...
[1 of 1] Compiling Data.Bimap ( Data/Bimap.hs, dist/dist-sandbox-ea5d7e38/build/Data/Bimap.o )
Data/Bimap.hs:120:22:
Can't make a derived instance of ‘Typeable BimapException’:
You need DeriveDataTypeable to derive an instance for this class
In the data declaration for ‘BimapException’
cabal: Error: some packages failed to install:
bimap-0.3.1 failed during the building phase. The exception was:
ExitFailure 1
➜ bimap-0.3.1 ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
The last release was in 2017 was we are actually using things that are currently only in the git version.
I see: #17
maybe it wasn't pushed here?
Bimap 0.3.3 was automatically marked as safe by GHC, but that was lost with bimap 0.4 due to the import of GHC.Exts
which is itself not safe.
Perhaps it could make sense to mark this module as trustworthy for newer GHC versions (where the import of GHC.Exts
is used), and Safe
otherwise (or perhaps GHC can figure that out for older versions).
At present this is limiting the use of bimap
0.4.0 in copilot-theorem
because we have a module marked as Safe there.
It would be nice if keys
and keysR
returned Set
a
instead of [a]
by using the Data.Map.keysSet
function. Set's are often preferable and this conversion would have a smaller constant factor than Set.fromListAsc . toMap
. Plus there's always elems
for getting the [a]
type.
Is there someway to use this as trimap? Or n-map?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.