Preprocessing library hflags-0.4.1...
[1 of 1] Compiling HFlags ( HFlags.hs, dist/build/HFlags.o )
HFlags.hs:406:42: error:
• Ambiguous type variable ‘b0’ arising from a use of ‘show’
prevents the constraint ‘(Show b0)’ from being solved.
Relevant bindings include
dupe :: [(b0, [Char])] (bound at HFlags.hs:405:6)
Probable fix: use a type annotation to specify what ‘b0’ should be.
These potential instances exist:
instance Show NestedAtomically
-- Defined in ‘Control.Exception.Base’
instance Show NoMethodError -- Defined in ‘Control.Exception.Base’
instance Show NonTermination -- Defined in ‘Control.Exception.Base’
...plus 97 others
...plus 88 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the second argument of ‘(++)’, namely ‘(show $ map fst dupe)’
In the second argument of ‘(++)’, namely
‘", modules: " ++ (show $ map fst dupe)’
In the second argument of ‘(++)’, namely
‘(snd $ head dupe) ++ ", modules: " ++ (show $ map fst dupe)’
HFlags.hs:409:27: error:
• The constructor ‘InstanceD’ should have 4 arguments, but has been given 3
• In the pattern: InstanceD _ (AppT _ inst) _
In an equation for ‘instanceToFlagData’:
instanceToFlagData (InstanceD _ (AppT _ inst) _)
= [| getFlagData (undefined :: $(return inst)) |]
pending(rn) [<splice, return inst>]
In an equation for ‘getFlagsData’:
getFlagsData
= do { ClassI _ instances <- reify ''Flag;
case dupes instances of {
[] -> return ()
(dupe : _)
-> fail
("Multiple definition of flag "
++ (snd $ head dupe) ++ ", modules: " ++ (show $ map fst dupe)) };
listE $ map instanceToFlagData instances }
where
instanceToFlagData (InstanceD _ (AppT _ inst) _)
= [| getFlagData (undefined :: $(return inst)) |]
pending(rn) [<splice, return inst>]
instanceToFlagData _ = error "Shouldn't happen"
instanceToModuleNamePair (InstanceD _ (AppT _ (ConT inst)) _)
= let ... in (modName, flag)
instanceToModuleNamePair _ = error "Shouldn't happen"
dupes instances
= filter ((> 1) . length)
$ groupBy ((==) `on` snd)
$ sortBy (compare `on` snd)
$ map instanceToModuleNamePair instances
HFlags.hs:415:33: error:
• The constructor ‘InstanceD’ should have 4 arguments, but has been given 3
• In the pattern: InstanceD _ (AppT _ (ConT inst)) _
In an equation for ‘instanceToModuleNamePair’:
instanceToModuleNamePair (InstanceD _ (AppT _ (ConT inst)) _)
= let
(flagrev, modrev) = span (/= '.') $ reverse $ show inst
modName = reverse $ drop 1 modrev
....
in (modName, flag)
In an equation for ‘getFlagsData’:
getFlagsData
= do { ClassI _ instances <- reify ''Flag;
case dupes instances of {
[] -> return ()
(dupe : _)
-> fail
("Multiple definition of flag "
++ (snd $ head dupe) ++ ", modules: " ++ (show $ map fst dupe)) };
listE $ map instanceToFlagData instances }
where
instanceToFlagData (InstanceD _ (AppT _ inst) _)
= [| getFlagData (undefined :: $(return inst)) |]
pending(rn) [<splice, return inst>]
instanceToFlagData _ = error "Shouldn't happen"
instanceToModuleNamePair (InstanceD _ (AppT _ (ConT inst)) _)
= let ... in (modName, flag)
instanceToModuleNamePair _ = error "Shouldn't happen"
dupes instances
= filter ((> 1) . length)
$ groupBy ((==) `on` snd)
$ sortBy (compare `on` snd)
$ map instanceToModuleNamePair instances