Skip to content

Commit 9c0fe3d

Browse files
committed
fix: fix type errors in boundedEnumShowParser
1 parent 40cab5d commit 9c0fe3d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Text/Megaparsec/Utils.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{-# LANGUAGE TypeFamilies #-}
1+
{-# LANGUAGE FlexibleContexts #-}
2+
{-# LANGUAGE ScopedTypeVariables #-}
3+
{-# LANGUAGE TypeFamilies #-}
24

35
module Text.Megaparsec.Utils
46
( boolParser
@@ -44,13 +46,13 @@ boolParser = true <|> false
4446
-- | Parse a 'Bounded' 'Enum' type that has a 'Show' instance, trying all
4547
-- possibilities, case-insensitive, in the 'Enum' order.
4648
boundedEnumShowParser
47-
:: Ord e
49+
:: forall a e. Ord e
4850
=> Bounded a
4951
=> Enum a
5052
=> Show a
5153
=> Parsec e String a
5254
boundedEnumShowParser =
53-
choice . map parseShow $ sortOn (negate . length . show) [minBound ..]
55+
choice . map parseShow $ sortOn (negate . length . show) [(minBound :: a) ..]
5456
where parseShow a = string' (show a) $> a
5557

5658
-- | Parse a comma-separated list of items.

0 commit comments

Comments
 (0)