module Floskell.Fixities ( builtinFixities, packageFixities ) where
import Language.Haskell.Exts.Fixity
( Fixity, baseFixities, infix_, infixl_, infixr_ )
builtinFixities :: [Fixity]
builtinFixities = concatMap snd packageFixities
packageFixities :: [(String, [Fixity])]
packageFixities = [ ("base", baseFixities)
, ("aeson", aesonFixities)
, ("conduit", conduitFixities)
, ("lens", lensFixities)
, ("pipes", pipesFixities)
, ("servant", servantFixities)
]
aesonFixities :: [Fixity]
aesonFixities =
infixr_ 8 [ ".=" ]
++ infixr_ 6 [ ">*<" ] ++ infixr_ 6 [ "><" ]
++ infixr_ 6 [ "<^>" ] ++ infixr_ 4 [ "<%>" ]
conduitFixities :: [Fixity]
conduitFixities =
infixr_ 0 [ "$$" ] ++ infixl_ 1 [ "$=" ] ++ infixr_ 2 [ "=$" ]
++ infixr_ 2 [ "=$=" ] ++ infixr_ 0 [ "$$+" ] ++ infixr_ 0 [ "$$++" ]
++ infixr_ 0 [ "$$+-" ] ++ infixl_ 1 [ "$=+" ] ++ infixr_ 2 [ ".|" ]
++ infixr_ 0 [ "=$$+" ] ++ infixr_ 0 [ "=$$++" ] ++ infixr_ 0 [ "=$$+-" ]
++ infixr_ 9 [ "<+<" ] ++ infixl_ 9 [ ">+>" ]
lensFixities :: [Fixity]
lensFixities =
infixr_ 4 [ "</>~", "<</>~", "<<</>~", "<.>~", "<<.>~", "<<<.>~" ]
++ infix_ 4 [ "</>=", "<</>=", "<<</>=", "<.>=", "<<.>=", "<<<.>=" ]
++ infixr_ 4 [ ".|.~", ".&.~", "<.|.~", "<.&.~", "<<.|.~", "<<.&.~" ]
++ infix_ 4 [ ".|.=", ".&.=", "<.|.=", "<.&.=", "<<.|.=", "<<.&.=" ]
++ infixl_ 8 [ "^..", "^?", "^?!", "^@..", "^@?", "^@?!" ]
++ infixr_ 9 [ "<.>", "<.", ".>" ]
++ infixr_ 4
[ "%@~"
, ".@~"
, ".~"
, "+~"
, "*~"
, "-~"
, "//~"
, "^~"
, "^^~"
, "**~"
, "&&~"
, "<>~"
, "||~"
, "%~"
, "<.~"
, "?~"
, "<?~"
]
++ infix_ 4
[ "%@="
, ".@="
, ".="
, "+="
, "*="
, "-="
, "//="
, "^="
, "^^="
, "**="
, "&&="
, "<>="
, "||="
, "%="
, "<.="
, "?="
, "<?="
] ++ infixr_ 2 [ "<~" ]
++ infixr_ 5 [ "<|", "`cons`" ] ++ infixl_ 5 [ "|>", "`snoc`" ]
++ infixr_ 5 [ ":<" ] ++ infixl_ 5 [ ":>" ]
++ infixr_ 9 [ "..." ]
++ infixl_ 8 [ "^.", "^@." ]
++ infixr_ 2 [ "`zoom`", "`magnify`" ]
++ infixl_ 8 [ "^#" ]
++ infixr_ 4
[ "%%@~"
, "<%@~"
, "<<%@~"
, "%%~"
, "<+~"
, "<*~"
, "<-~"
, "<//~"
, "<^~"
, "<^^~"
, "<**~"
, "<&&~"
, "<||~"
, "<<>~"
, "<%~"
, "<<%~"
, "<<.~"
, "<<?~"
, "<#~"
, "#~"
, "#%~"
, "<#%~"
, "#%%~"
]
++ infix_ 4
[ "%%@="
, "<%@="
, "<<%@="
, "%%="
, "<+="
, "<*="
, "<-="
, "<//="
, "<^="
, "<^^="
, "<**="
, "<&&="
, "<||="
, "<<>="
, "<%="
, "<<%="
, "<<.="
, "<<?="
, "<#="
, "#="
, "#%="
, "<#%="
, "#%%="
] ++ infixr_ 2 [ "<<~" ] ++ infixl_ 1 [ "??", "&~" ]
++ infixl_ 1 [ "&" ] ++ infixl_ 1 [ "<&>" ]
++ infixr_ 8 [ "#" ]
++ infixl_ 5 [ "`failing`" ]
pipesFixities :: [Fixity]
pipesFixities =
infixl_ 4 [ "<~" ] ++ infixr_ 4 [ "~>" ] ++ infixl_ 5 [ "~<" ]
++ infixr_ 5 [ ">~" ] ++ infixl_ 7 [ ">->" ] ++ infixr_ 7 [ "<-<" ]
++ infixl_ 3 [ "//>" ] ++ infixr_ 3 [ "<\\\\" ]
++ infixr_ 4 [ "/>/", ">\\\\" ] ++ infixl_ 4 [ "\\<\\", "//<" ]
++ infixl_ 5 [ "\\>\\" ] ++ infixr_ 5 [ "/</" ] ++ infixl_ 6 [ "<<+" ]
++ infixr_ 6 [ "+>>" ] ++ infixl_ 7 [ ">+>", ">>~" ]
++ infixr_ 7 [ "<+<", "~<<" ] ++ infixl_ 8 [ "<~<" ] ++ infixr_ 8 [ ">~>" ]
servantFixities :: [Fixity]
servantFixities =
infixr_ 4 [ ":>" ]
++ infixr_ 3 [ ":<|>" ]
++ infixl_ 0 [ ":-" ]