-
-
Save m2ym/8384137 to your computer and use it in GitHub Desktop.
Data.Heap.MaxPrioHeap can't type fmap
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.Heap as H | |
h :: H.MaxPrioHeap Int Char | |
h = H.fromList [(1, 'a')] | |
h' :: H.MaxPrioHeap Int String | |
h' = fmap (:[]) h | |
main :: IO () | |
main = do | |
print h | |
print h' |
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
a.hs:7:17: | |
Couldn't match type `Char' with `[Char]' | |
Expected type: H.HeapT (H.Prio H.FstMaxPolicy (Int, String)) Char | |
Actual type: H.MaxPrioHeap Int Char | |
In the second argument of `fmap', namely `h' | |
In the expression: fmap (: []) h | |
In an equation for h': h' = fmap (: []) h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment