Last active
December 27, 2015 08:09
-
-
Save jsl/7294493 to your computer and use it in GitHub Desktop.
Deserialization breaking the way that Haskell looks up keys in Maps?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ: import qualified Data.Map as M | |
λ: :t M.keys Metadata.Prelude.interfaces | |
M.keys Metadata.Prelude.interfaces :: [String] | |
λ: M.keys Metadata.Prelude.interfaces | |
["Automaton","Basics","Bitwise","Char","Color","Date","Dict","Either","Http","JavaScript","Json","Keyboard","List","Maybe","Mouse","Prelude","Random","Regex","Set","Signal","String","Text","Time","Touch","Transform2D","WebSocket","Window","Graphics.Collage","Graphics.Element","Graphics.Input","JavaScript.Experimental"] | |
λ: M.member "Graphics.Element" Metadata.Prelude.interfaces | |
False | |
λ: M.member "Graphics.Element" $ M.fromList $ M.toList Metadata.Prelude.interfaces | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Metadata.Prelude.interfaces is loaded from a file using Binary's
decodeOrFail
. For some reason it's unable to figure out if a given string is an existing key.